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
Features - Requirements - Installation - Quick usage
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
toFalse
duringcompile
orrun
. 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()
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
Built Distribution
Hashes for typed_ffmpeg-0.1.31-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee105992e962a1fa30d80925d207a2fd79ff847e2a24862686bfc3580e3a0e7e |
|
MD5 | 733eb9d6fa61de3ad82c32964442af4b |
|
BLAKE2b-256 | 1221c04f6fdc8f12620fe367dd88a1c08823f9319052b08aafd83ec08e811f1b |