Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pwhiddy/notebook-video-writer
Create videos from numpy arrays in a jupyter notebook
https://github.com/pwhiddy/notebook-video-writer
ffmpeg interactive jupyter notebook numpy render video
Last synced: about 1 month ago
JSON representation
Create videos from numpy arrays in a jupyter notebook
- Host: GitHub
- URL: https://github.com/pwhiddy/notebook-video-writer
- Owner: PWhiddy
- License: mit
- Created: 2021-10-18T03:19:18.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-18T18:59:28.000Z (about 3 years ago)
- Last Synced: 2024-11-15T03:05:34.578Z (about 1 month ago)
- Topics: ffmpeg, interactive, jupyter, notebook, numpy, render, video
- Language: Python
- Homepage:
- Size: 237 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Video from numpy array in Jupyter Notebook
[![PyPI version](https://badge.fury.io/py/notebook-video-writer.svg)](https://badge.fury.io/py/notebook-video-writer)
Create videos from numpy arrays in a jupyter notebookPackaged version of [Alexander Mordvintsev's Colab Snippets](https://github.com/znah/notebooks/blob/master/external_colab_snippets.ipynb)
### Install
`pip install notebook-video-writer`### Dependencies
- Must have ffmpeg installed### Usage
```pythonimport numpy as np
# optionally wrap with tqdm for progress bar
from tqdm import tqdm
from notebook_video_writer import VideoWriterwith VideoWriter(fps=40) as vw:
for i in tqdm(range(100)):
frame = np.random.rand(256,256,3)
vw.add(frame)```
This will immediately display the video inline below the cell:
![screenshot](imgs/screenshot.png)
An mp4 file is also saved to the current directory. Default name is `_autoplay.mp4`, but can be set with `name` keyword arg.