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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file typed_ffmpeg-0.1.31.tar.gz.

File metadata

  • Download URL: typed_ffmpeg-0.1.31.tar.gz
  • Upload date:
  • Size: 122.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for typed_ffmpeg-0.1.31.tar.gz
Algorithm Hash digest
SHA256 340121e92d8537843c69804143713ce3a34f86412a4c310c83d5164b33c953ef
MD5 6c02a95f3d3d0596111d3a7a0672c721
BLAKE2b-256 2cd6c8c6f855ed62347c15b2a93f970e00b889245c149d3724b831481e11ad2b

See more details on using hashes here.

File details

Details for the file typed_ffmpeg-0.1.31-py3-none-any.whl.

File metadata

File hashes

Hashes for typed_ffmpeg-0.1.31-py3-none-any.whl
Algorithm Hash digest
SHA256 ee105992e962a1fa30d80925d207a2fd79ff847e2a24862686bfc3580e3a0e7e
MD5 733eb9d6fa61de3ad82c32964442af4b
BLAKE2b-256 1221c04f6fdc8f12620fe367dd88a1c08823f9319052b08aafd83ec08e811f1b

See more details on using hashes here.

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