lucemia/typed-ffmpeg

Type-safe FFmpeg bindings for Python & TypeScript — filters, typing, and docs

What it solves

FFmpeg is a powerful but complex tool for media processing that often lacks a developer-friendly interface. typed-ffmpeg provides a modern, type-safe wrapper for Python and TypeScript that makes building complex media filter graphs intuitive, reliable, and easy to debug.

How it works

The library allows you to construct FFmpeg command chains using a fluent, Pythonic or idiomatic TypeScript interface. It provides built-in support for FFmpeg filters with IDE auto-completion and inline documentation. You can serialize these filter graphs into JSON for reuse, visualize them using Graphviz, and perform media file analysis via ffprobe with structured data outputs.

Who it’s for

It is designed for developers working with media processing who want to avoid the pitfalls of manual command-line string construction. It is particularly useful for those who need robust IDE support, static type checking, and the ability to manage complex filter chains across different versions of FFmpeg.

Highlights

  • Zero dependencies: Built entirely with the Python standard library.
  • Version-specific packages: Separate bindings for FFmpeg versions 5 through 9 to ensure compatibility.
  • Robust typing: Provides static and dynamic type checking for filter parameters.
  • Integrated documentation: In-line docstrings provide immediate guidance while coding.
  • Graph visualization: Built-in support for generating visual representations of filter graphs.
  • Media analysis: Includes a ffprobe wrapper for extracting metadata as dictionaries or dataclasses.

Related

  • Project
  • Project
  • Project
  • Project