A terminal-first media toolkit built on top of ffmpeg and ffprobe.
Use it when you want to:
- inspect a video or audio file
- convert video formats
- compress large videos
- extract audio from video
- grab thumbnails
- generate waveform images
- join clips together
- add, extract, or burn subtitles
- mix or normalize audio
- batch-convert images
PyFFmpegCore is now designed to be used first as a CLI:
pyffmpegcore ...It also still exposes a Python API for developers, but the easiest way to use the project is now the terminal command.
As of March 28, 2026, the repo was validated locally with:
- Python
3.12 ffmpegandffprobeavailable onPATH105library and CLI tests- real downloaded video, audio, subtitle, and image fixtures
- end-to-end CLI checks for the shipped commands
- path handling for spaces and apostrophes in important workflows
The strongest validation was done on Linux. The repo also now includes installer, packaging, and clean-install checks for the CLI path.
You need:
- Python
3.8+ ffmpegffprobe
Install the CLI with pipx:
pipx install pyffmpegcoreOr with regular pip:
python -m pip install --user pyffmpegcoreFrom a repo checkout you can also use the one-command installers:
./install.shWindows uses the PowerShell installer instead:
.\install.ps1Then confirm the install:
pyffmpegcore --version
pyffmpegcore doctorMore install details are in CLI_INSTALL.md.
If you already have your own files, replace the sample names below with your own.
pyffmpegcore doctorpyffmpegcore probe --input my-video.mp4pyffmpegcore convert --input input.webm --output output.mp4 --video-codec libx264 --audio-codec aacpyffmpegcore compress --input large-video.mp4 --output smaller-video.mp4 --crf 28pyffmpegcore extract-audio --input interview.mp4 --output interview.mp3If you want safe practice files instead of your own media, download the same fixtures used in real validation:
python tests/media/download_fixtures.pyThat creates files under tests/media/downloads/.
Main practice files:
| File | What it represents |
|---|---|
tests/media/downloads/sample_mp4_h264.mp4 |
a normal MP4 clip with video and audio |
tests/media/downloads/sample_webm_vp9.webm |
a WebM video you want to convert |
tests/media/downloads/sample_video_mov.mov |
a camera or editor export |
tests/media/downloads/sample_audio_mp3.mp3 |
a song, podcast, or voice-over clip |
tests/media/downloads/sample_audio_wav.wav |
an uncompressed audio recording |
tests/media/downloads/sample_image_png.png |
a graphic or screenshot |
tests/media/downloads/sample_image_jpg.jpg |
a photo |
tests/media/downloads/sample_subtitles.srt |
a subtitle file you want to attach or burn |
pyffmpegcore probe --input tests/media/downloads/sample_mp4_h264.mp4
pyffmpegcore probe --input tests/media/downloads/sample_mp4_h264.mp4 --jsonpyffmpegcore convert \
--input tests/media/downloads/sample_webm_vp9.webm \
--output converted.mp4 \
--video-codec libx264 \
--audio-codec aacpyffmpegcore compress \
--input tests/media/downloads/sample_mp4_h264.mp4 \
--output compressed.mp4 \
--crf 28pyffmpegcore extract-audio \
--input tests/media/downloads/sample_mp4_h264.mp4 \
--output audio-only.mp3pyffmpegcore thumbnail \
--input tests/media/downloads/sample_mp4_h264.mp4 \
--output thumbnail.jpg \
--timestamp 00:00:01 \
--width 640pyffmpegcore waveform \
--input tests/media/downloads/sample_audio_mp3.mp3 \
--output waveform.png \
--width 1200 \
--height 300pyffmpegcore subtitles burn \
--video tests/media/downloads/sample_mp4_h264.mp4 \
--subtitle tests/media/downloads/sample_subtitles.srt \
--output burned-subtitles.mp4pyffmpegcore concat \
--inputs tests/media/downloads/sample_mp4_h264.mp4 tests/media/downloads/sample_mp4_h264.mp4 \
--output joined.mp4 \
--mode copyReplace the sample paths with your own real filenames:
tests/media/downloads/sample_webm_vp9.webm->holiday-video.webmtests/media/downloads/sample_mp4_h264.mp4->screen-recording.mp4tests/media/downloads/sample_audio_mp3.mp3->podcast-intro.mp3tests/media/downloads/sample_subtitles.srt->captions/english.srt
Good habits:
- put quotes around paths that contain spaces
- choose the output extension you actually want, like
.mp4,.mp3,.wav,.jpg, or.webp - use
pyffmpegcore probe --input your-filefirst if you are not sure what kind of file you have - open the output file in your normal media player after each command
Built-in help:
pyffmpegcore --help
pyffmpegcore convert --help
pyffmpegcore subtitles --helpShell completion:
pyffmpegcore completion bash
pyffmpegcore completion zsh
pyffmpegcore completion powershellThe quick command guide is in CLI_HELP.md. More task-based examples are in EXAMPLES.md.
If you want to call the project from Python code instead of the CLI:
python -m pip install pyffmpegcoreExample:
from pyffmpegcore import FFmpegRunner
ffmpeg = FFmpegRunner()
result = ffmpeg.extract_audio("video.mp4", "audio.mp3")
print(result.returncode)The Python API remains useful, but the supported public path is now the pyffmpegcore terminal command first.