Skip to main content

Typed fluent FFmpeg/ffprobe wrapper with msgspec models

Project description

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)

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

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, and error handling.
  • Async API — the AnyIO-backed asynchronous mirror, backend choice (asyncio or trio), and bounding concurrency.
  • API Reference — the auto-generated reference for every public function, builder method, and model.

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

ffmpeg_wrap-0.4.0.tar.gz (106.3 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.4.0-py3-none-any.whl (27.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ffmpeg_wrap-0.4.0.tar.gz
  • Upload date:
  • Size: 106.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","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.4.0.tar.gz
Algorithm Hash digest
SHA256 fef29c7f3ea85dc54b321b4ef392872b28a7913dd709e7277a4ece7270362f5c
MD5 add86db77b7d0c4102eb59df1de56c96
BLAKE2b-256 bb301cb1f310d7d55ebab03a76b423c248d4a81b78b940d4a4df3f31697880a6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ffmpeg_wrap-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 27.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2c28ae9a8eac01442d8717fde54065fa125f1f0fa05155ecbe8fae790a024c21
MD5 5227a3ce3df87959db515fff60caf28d
BLAKE2b-256 7c051e5dda1899cc1c9085f037edae9c6287bbadd6b6403529445992c8f4bebb

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