Skip to main content

Worry-free inline videos in Jupyter Notebooks that stay.

Project description

JupyterVideo

Worry-free inline videos in Jupyter Notebooks that stay.

Installation

pip install jupytervideo

Usage

from jupytervideo import JupyterVideo


video = JupyterVideo("path/to/video.mp4")


for _ in range(10):
    # frame = ...  Get a frame from somewhere

    video.write(frame)

video.show()

# The video will be displayed inline in the notebook

Why?

Jupyter Notebooks support displaying videos inline using HTML5 video tags. However, the videos are embedded as base64 strings, which can make the notebook size very large. Using compressed short video files is less likely to bloat the notebook size, but when generating videos frame by frame (e.g. in a simulation, or with opencv), the video is not compressed optimally. This package aims to provide a simple way to generate videos frame by frame, compress them with ffmpeg, and display them inline in Jupyter Notebooks.

How?

The JupyterVideo class writes frames to a temporary directory, and when the video is displayed, it compresses the video using ffmpeg and displays it inline in the notebook.

Requirements

  • ffmpeg must be installed and available in the system path.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jupytervideo-0.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jupytervideo-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file jupytervideo-0.1.0.tar.gz.

File metadata

  • Download URL: jupytervideo-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.6 Windows/11

File hashes

Hashes for jupytervideo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a6ca8441d548e30be85d2825bf33dfbd2e199c14822fc8fbf1fa2ac357866b9d
MD5 502efef23f55db42e76fed545d78f97c
BLAKE2b-256 01c66d6f35d1bcb110c22c826eee0b8dcf8b82ea17340bd926fcff9d7815c964

See more details on using hashes here.

File details

Details for the file jupytervideo-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: jupytervideo-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.6 Windows/11

File hashes

Hashes for jupytervideo-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 deaf79732a2b51384a17824a39c8d7ced23d77df0771d3fc3f56e9f63674565f
MD5 cab8e247cbd7a61b54f1e40307e45f8d
BLAKE2b-256 73c83b59b3d166c4cc676dbae76979432c86d73573e99b989b19c42fdabe89dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page