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

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).

Download files

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

Source Distribution

ffmpeg_wrap-0.5.0.tar.gz (130.6 kB view details)

Uploaded Source

Built Distribution

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

ffmpeg_wrap-0.5.0-py3-none-any.whl (31.3 kB view details)

Uploaded Python 3

File details

Details for the file ffmpeg_wrap-0.5.0.tar.gz.

File metadata

  • Download URL: ffmpeg_wrap-0.5.0.tar.gz
  • Upload date:
  • Size: 130.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","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}

File hashes

Hashes for ffmpeg_wrap-0.5.0.tar.gz
Algorithm Hash digest
SHA256 61c23e5086c76fca602729201869b012d44358c68737dfbf0ff0760b522d798a
MD5 3d7d5015d5dc4ce3d22fd01e7b907a58
BLAKE2b-256 473f8b2f043d12112ac9092672d68db7f9718f467134696e3fadd3f0216a7187

See more details on using hashes here.

File details

Details for the file ffmpeg_wrap-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: ffmpeg_wrap-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 31.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","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}

File hashes

Hashes for ffmpeg_wrap-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a9d3168d5e8e85170679d7a0976b86bebd228b696a78457a5b64a62befa0697a
MD5 3e2cd9150d0ce8711756f858b1c1e1d2
BLAKE2b-256 2313ee8c720e20920aa6e8d622a1577bc3d64208bb30e87d415a39537b0f8732

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

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