Registry / data / python-ffmpeg

python-ffmpeg

JSON →
library2.0.12pypypi✓ verified 87d ago

A Python binding for FFmpeg that provides both synchronous and asynchronous APIs to transcode, process, and stream media files. Current version is 2.0.12, with active development and regular releases.

pip install python-ffmpeg
INSTALL
IMPORT
SIG · PYTHON-FFMPEG
P
python-ffmpeg
datapythonv2.0.12
Install
1.7s avg
Import
237ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.12 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.256s · 18.4MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.218s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FFmpeg
from ffmpeg import FFmpeg
Direct import of the main class.
Progress
from ffmpeg.progress import Progress
from ffmpeg import Progress
Progress is in the submodule ffmpeg.progress.

Basic async usage: transcode an MP4 file.

import asyncio from ffmpeg import FFmpeg async def main(): ffmpeg = FFmpeg() ffmpeg.input('input.mp4') ffmpeg.output('output.mp4') await ffmpeg.execute() asyncio.run(main())
Debug
Known issues
breakingVersion 2.0 completely rewrote the API from v1.x. The old `ffmpeg-python`-style FFmpeg() is replaced with the new async-first API.
fix
Migrate to new async/sync API. See migration guide in repo.
affects: 2.0.0+
breakingAsync methods must be awaited; calling execute() without await returns a coroutine object instead of running.
fix
Use 'await ffmpeg.execute()' inside an async function.
affects: 2.0.0+
gotchaProgress callbacks require the 'Progress' class from ffmpeg.progress module, not from ffmpeg itself.
fix
Use: from ffmpeg.progress import Progress
affects: all
gotchaFFmpeg binary must be installed separately and accessible via PATH, otherwise the library will raise a subprocess error.
fix
Install FFmpeg (e.g., 'sudo apt install ffmpeg' or download from ffmpeg.org).
affects: all
Errors
Common errors & fixes
FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg'
FFmpeg executable not installed or not in PATH.
fix
Install FFmpeg (e.g., 'sudo apt install ffmpeg' or 'brew install ffmpeg') and ensure it's in PATH.
TypeError: cannot be used with 'await'
Calling an async method without await, or calling a coroutine as if it were a sync function.
fix
Use 'await ffmpeg.execute()' inside an async function.
Upgrade
Version history
2.0.12latest on PyPI · released Apr 15, 2024
Audit
Dependencies
ffmpegrequiredBinary FFmpeg executable must be installed and accessible in PATH.
Agent activity
16 hits · last 30 days
node
14
Resources
python-ffmpeg — pip install python-ffmpeg · libregistry