Skip to main content

ffmpeg-wrap

Tests Prek checks PyPI Downloads

A typed Python wrapper for FFmpeg and ffprobe CLI tools. Build FFmpeg commands with a fluent API and parse ffprobe output into typed data structures.

Requirements

  • Python 3.10+
  • FFmpeg and ffprobe installed and available on PATH
  • filter_complex_script() emits the ffmpeg 7.0+ -/filter_complex file syntax by default; pass legacy=True on ffmpeg 6.1 and older

Installation

With uv:

uv add ffmpeg-wrap

With pip:

pip install ffmpeg-wrap

Quick start

import ffmpeg_wrap as ffmpeg

# Probe a file into typed structures
result = ffmpeg.probe("video.mkv")
for stream in result.streams:
    print(stream.codec_name, stream.codec_type, stream.bit_depth())

# Build and run a command with the fluent builder
ffmpeg.input("input.mkv").output("output.mp4", c="copy").overwrite_output().run()

# Bound the wall-clock time; FFmpegTimeoutError is raised after ffmpeg is killed
ffmpeg.input("input.mkv").output("output.mp4", c="copy").overwrite_output().run(timeout=60)

Async

The asynchronous mirror of the API ships as an optional extra. With uv:

uv add "ffmpeg-wrap[async]"

With pip:

pip install "ffmpeg-wrap[async]"
import anyio

from ffmpeg_wrap import aio, input


async def main():
    await input("input.mkv").output("output.mp4", c="copy").overwrite_output().arun()
    result = await aio.probe("output.mp4")
    print(result.format.format_name if result.format else None)


anyio.run(main)

Documentation

Full documentation, including guides and the complete API reference, is hosted at gitbib.github.io/ffmpeg-wrap:

  • Guide — a walkthrough of the synchronous API: probing files, building and running commands, mapping streams, complex filtergraphs, validation, encoder discovery, timeouts, and error handling.
  • Async API — the AnyIO-backed asynchronous mirror, backend choice (asyncio or trio), timeouts, and bounding concurrency.
  • API Reference — the auto-generated reference for every public function, builder method, and model.

Development

Install the locked development environment and run the complete local checks:

uv sync --all-extras --dev
uv run ty check
uv run pytest
prek run --all-files

CI additionally runs make test (downloads the real media fixtures once and runs the integration tests) and make test-platform (the timeout suites, which fail if any test is skipped).

Metadata

Release files for ffmpeg-wrap 0.5.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 ffmpeg-wrap 0.5.1
File Size Uploaded Provenance Actions
ffmpeg_wrap-0.5.1.tar.gz 132.5 kB Without provenance Details for ffmpeg_wrap-0.5.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ffmpeg-wrap 0.5.1
File Interpreter ABI Platform Actions
ffmpeg_wrap-0.5.1-py3-none-any.whl Python 3 none any Details for ffmpeg_wrap-0.5.1-py3-none-any.whl

Total release size: 164.2 kB

Release files / ffmpeg_wrap-0.5.1.tar.gz

Download URL ffmpeg_wrap-0.5.1.tar.gz
Size 132.5 kB
Tags Source
SHA-256 checksum
How to use checksums
dcf6370ad9f615f144ebe8fb4926a49212637abd822343cbb851a1a8fa1b3207
BLAKE2b-256 checksum
How to use checksums
041ee968a701940a6053440b00527d5f3bf97beefce67e049367d8e7c9fa855a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / ffmpeg_wrap-0.5.1-py3-none-any.whl

Download URL ffmpeg_wrap-0.5.1-py3-none-any.whl
Size 31.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e5b6c408507c234d0496e567a59702dd05bb5c7965bd8d218e30dedf8f7e2808
BLAKE2b-256 checksum
How to use checksums
f724fe63b2882da8461dc882c814a79b122cb53f3032f07f5ba888e7bd297a7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for ffmpeg-wrap 0.5.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.

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