Skip to main content

ffmpegio_plugin_mpl: ffmpegio plugin to output matplotlib figures

PyPI PyPI - Status PyPI - Python Version GitHub License GitHub Workflow Status

This plugin enables Python ffmpegio package to output matplotlib’s Figure.

Installation

To enable it, install along with ffmpegio-core or ffmpegio package:

pip install ffmpegio-core # or ffmpegio if also performing media I/O
pip install ffmpegio-plugin-mpl

The plugin will be automatically loaded whenever ffmpegio package is imported.

Example

Create an MP4 video of Matplotlib’s animation example.

import ffmpegio
from matplotlib import pyplot as plt
import numpy as np


fig, ax = plt.subplots()

x = np.arange(0, 2*np.pi, 0.01)
line, = ax.plot(x, np.sin(x))

interval=20 # delay in milliseconds
save_count=50 # number of frames

def animate(i):
    line.set_ydata(np.sin(x + i / 50))  # update the data.
    return line


with ffmpegio.open(
  "output.mp4", # output file name
  "wv", # open file in write-video mode
  1e3/interval, # framerate in frames/second
  pix_fmt="yuv420p", # specify the pixel format (default is yuv444p)
) as f:
    for n in range(save_count):
        animate(n) # update figure
        f.write(fig) # write new frame

Metadata

Release files for ffmpegio-plugin-mpl 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ffmpegio-plugin-mpl 0.1.1
File Size Uploaded Provenance
ffmpegio-plugin-mpl-0.1.1.tar.gz 10.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ffmpegio-plugin-mpl 0.1.1
File Interpreter ABI Platform
ffmpegio_plugin_mpl-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 20.6 kB

Release files / ffmpegio-plugin-mpl-0.1.1.tar.gz

Download URL ffmpegio-plugin-mpl-0.1.1.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7eb724ef6e1fb7a483ab66114a5c14ee0a72886bf3125b7011e4d73bc56f63fa
BLAKE2b-256 checksum
How to use checksums
1f733a109b0ca3f8946a16d75d13714c4ce7671cd5d5d80e6bbfa89674a3c4a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release files / ffmpegio_plugin_mpl-0.1.1-py3-none-any.whl

Download URL ffmpegio_plugin_mpl-0.1.1-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed1f4cb262349e4db58472fdf5aa201cc7131315d23fe98c8aa687da0848474f
BLAKE2b-256 checksum
How to use checksums
e7cfbf104d81caabc79d945fc48ae2ee0ac35b88b346ad325ec5f9a7fae0ba7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Security for ffmpegio-plugin-mpl 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page