Skip to main content

No project description provided

Reason this release was yanked:

it is prerelease, use 1.0.0 instead

Project description

typed-ffmpeg

Modern Python FFmpeg wrappers offer comprehensive support for complex filters, complete with detailed typing and documentation.

This API design is based on the helpful ffmpeg-python package, which serves as a Python binding for FFmpeg. Acting as a wrapper around the FFmpeg command line utility, it provides a Pythonic interface for accessing FFmpeg functionality. However, the ffmpeg-python package lacks some crucial features, including:

  • Documentation for filters
  • Comprehensive typing and type checking
  • Support for serialization and deserialization of filter graphs
  • Support for partial evaluation of filter graphs

ci documentation pypi version


Features - Requirements - Installation - Quick usage

mkdocstrings_gif1

Features

  • Built-in Documentation: Checking the FFmpeg documentation every time you want to use a filter can be cumbersome. typed-ffmpeg utilizes docstrings to provide comprehensive documentation for all filters. IDEs and text editors can display this documentation as a tooltip when you hover over a filter.

  • Typed: This package offers comprehensive typing for all filters, including both input and output types. For non-dynamic inputs/outputs, typing is checked by static type checkers such as mypy; for dynamic inputs/outputs, typing is checked at runtime. This can help catch errors early and make your code more robust.

  • No Dependency: typed-ffmpeg is a pure Python package and has no dependency on the FFmpeg command line utility. This allows you to use typed-ffmpeg in a platform-independent manner.

  • Serialization: typed-ffmpeg provides a way to serialize and deserialize filter graphs. This allows you to save the filter graph to a file and load it later.

  • Validate and Auto Fix: typed-ffmpeg offers a feature to automatically fix the filter graph. This can help fix the filter graph when it is not valid.

    Note: This feature can be turned off by setting auto_fix to False during compile or run. Opt-in.

  • Partial Evaluation (Coming Soon): typed-ffmpeg provides a way to partially evaluate the filter graph. This can help evaluate the filter graph step by step.

Installation

With pip:

pip install typed-ffmpeg

You can also install support for visualizing filter graphs with graphviz:

pip install 'typed-ffmpeg[graph]'

Note: You need to install FFmpeg / Graphviz to your system.

Quick Usage

import ffmpeg

f = (
    ffmpeg
    .input(filename='input.mp4')
    .hflip()
    .output(filename='output.mp4')
)

f.run()

quickstart

NOTE: you can get the graph easily by using f.view()

See the Usage section of the docs for more examples!

Acknowledgements

This project was initially conceived upon the release of GPT-3. I embarked on this endeavor to test GPT-3's capability to generate a functional SDK for FFmpeg by providing it with FFmpeg documentation. However, I soon realized that it remained a challenging task for GPT to create a truly usable SDK for FFmpeg. Therefore, I opted to develop an SDK for FFmpeg using traditional code generation methods. Nevertheless, without the assistance of Copilot and GPT, I would not have had the time to complete this project.

I have decided to release this open-source project on February 24, 2024, to commemorate the seventh birthday of my son, Austin. His curiosity and enthusiasm for exploring the world have been a constant source of inspiration throughout this journey.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

typed_ffmpeg-0.1.31.tar.gz (122.9 kB view hashes)

Uploaded Source

Built Distribution

typed_ffmpeg-0.1.31-py3-none-any.whl (129.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page