Skip to main content

Portable FFmpeg

FFmpeg and FFprobe for Windows x86-64, Linux x86-64/ARM64, and macOS Intel/Apple Silicon. Downloads and installed executables are verified with pinned SHA-256 hashes.

uv add portable-ffmpeg

For an offline installation, use the platform-specific binary bundle instead:

uv add portable-ffmpeg-full

portable-ffmpeg-full depends on the matching version of portable-ffmpeg and adds only its platform's compressed payload. The Python wrapper is shared. get_ffmpeg() prefers that payload, verifies it, and extracts it into the cache without contacting the network. A corrupt or incompatible installed payload raises an error rather than silently downloading another copy.

Python API

from portable_ffmpeg import get_ffmpeg, add_to_path, remove_from_path

ffmpeg_path, ffprobe_path = get_ffmpeg()
add_to_path()
add_to_path(weak=True)  # Preserve an existing ffmpeg on PATH.
remove_from_path()

get_ffmpeg() and get_ffmpeg(FFmpegVersions.V9) use the same pinned FFmpeg 9 build and share a cache. LATEST selects the stable build pinned by this package release. FFmpeg 5–8 selectors have been removed; existing applications using them must switch to V9.

Command line

static_ffmpeg -i input.mp4 output.mp3
static_ffprobe -v quiet -print_format json -show_format input.mp4
print_paths
clear_cache

Builds and hardware support

Platform FFmpeg build Minimum runtime
Windows x86-64 BtbN 9.0.2, commit 7adfbe40dc Windows 10 22H2
Linux x86-64 / ARM64 Same BtbN snapshot glibc 2.28, Linux 4.18
macOS Intel / Apple Silicon Martin Riedl 9.0.2 macOS 12

The executables include software encoding and decoding of H.264, H.265, VP9, and AV1. Windows/Linux builds include NVIDIA, AMD AMF, Vulkan, and (on x86-64) Intel QSV; Linux also includes VAAPI. macOS uses VideoToolbox, with H.264/H.265 hardware encoding and hardware decoding where the machine supports the codec. GPU generation, drivers, codec profiles, and input formats determine actual hardware availability.

This package returns executable paths and forwards CLI arguments. The calling application chooses the encoder and implements software retry when a hardware operation is unsupported.

Download and cache contract

Each owned release asset is one .tar.xz with both executables at the root (.exe on Windows), GPL and third-party notices, source references, and provenance. It uses one solid XZ stream with a 256 MiB LZMA2 dictionary. Decoding needs approximately 256 MiB of dictionary memory. No extra compression dependency is required.

The downloader verifies the archive before parsing it, copies only regular root files, then verifies the actual FFmpeg and FFprobe hashes before making the complete cache directory available. Missing, empty, duplicate, linked, nested-only, or checksum-mismatched executables cannot become a valid installation. Socket waits are bounded to 30 seconds. Archive readers and multi-file upstream layouts exist only in release preparation; the installed package reads TAR.XZ only.

Binaries are cached inside the package's binaries/ directory. Each virtual environment gets its own cache. The cache key includes the pinned artifact configuration, so updates use a fresh cache. Both downloaded and bundled payloads use the same installation path. clear_cache() removes cached installations; it leaves an installed offline payload intact.

Licenses and corresponding source

The Python wrapper is MIT-licensed. FFmpeg reports GPL version 3 or later; included dependencies retain their respective license and copyright terms. No --enable-nonfree binaries are selected. The offline binary distribution includes GPL and third-party notices and source-access directions.

The binary release includes the exact BtbN build-run dependency cache, FFmpeg source and build recipes, reconstructed macOS dependency archives and recipes, locked Rust dependencies, copyright/license notices, and source identity records. The macOS x264 source was identified through the official repository history: master had not changed between the binary build and source collection. Source locks record the evidence and limitations. No bit-for-bit rebuild is claimed.

The source archives are separate release assets; GitHub's automatic archive of this Python repository is not FFmpeg's corresponding source. Preserve the source and notice assets for as long as the binaries remain available.

Preparing and publishing

The release-preparation command requires reviewed source inputs and refuses incomplete reviews, mismatched source/binary hashes, or existing output directories:

uv run -m scripts.prepare_release dist/ffmpeg-9.0.2-1 dist/source-inputs-9.0.2
uv run -m scripts.publish_release dist/ffmpeg-9.0.2-1
uv run pytest --release-dir dist/ffmpeg-9.0.2-1
uv build --out-dir dist/python
uv run -m scripts.build_full_wheels dist/ffmpeg-9.0.2-1 dist/python

SOURCE_MANIFEST.json supplies the reviewed input identities. Final manifest.json describes the five executable archives and individual executable hashes; SHA256SUMS covers every upload asset. Source ZIPs are split below GitHub's 2 GiB-per-file limit. Binary TARs and offline wheels have fixed archive metadata for repeatable packaging.

To upload the verified binary/source set as a draft, without publishing it:

uv run -m scripts.publish_release dist/ffmpeg-9.0.2-1 --draft

The draft uploader requires a clean, committed checkout and targets its exact commit. Push that commit before uploading. Merge the scoped publishing workflow before making any binary release public, and enable immutable releases in the GitHub repository. Publish binary/source release ffmpeg-9.0.2-1 before releasing Python packages portable-ffmpeg and portable-ffmpeg-full version 0.5.0. The client URLs become publicly usable only after that binary release is published.

Python package releases use v tags. The publication workflow downloads the already-published binary set, runs tests, builds the base package and all five offline wheels, and publishes dist/python/*. Both PyPI projects need trusted-publisher configuration: owner mrkbac, repository portable-ffmpeg, workflow filename publish.yml, environment release. Configure the existing base project under its Publishing settings; add portable-ffmpeg-full as a pending publisher before its first upload. Binary release tags do not trigger PyPI publication.

Metadata

Release files for portable-ffmpeg 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for portable-ffmpeg 0.5.0
File Size Uploaded Provenance Actions
portable_ffmpeg-0.5.0.tar.gz 99.4 kB Without provenance Details for portable_ffmpeg-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for portable-ffmpeg 0.5.0
File Interpreter ABI Platform Actions
portable_ffmpeg-0.5.0-py3-none-any.whl Python 3 none any Details for portable_ffmpeg-0.5.0-py3-none-any.whl

Total release size: 110.7 kB

Release files / portable_ffmpeg-0.5.0.tar.gz

Download URL portable_ffmpeg-0.5.0.tar.gz
Size 99.4 kB
Tags Source
SHA-256 checksum
How to use checksums
def745c013c687d56c8285734eb5f01741f49bae00b0495ddeaee56a5f5a2b3a
BLAKE2b-256 checksum
How to use checksums
f064d6509bb79c4378efb480150596b2915de183c87b4123cc7c13496126d626
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / portable_ffmpeg-0.5.0-py3-none-any.whl

Download URL portable_ffmpeg-0.5.0-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98f0f24e85721ea6f4a4998df158600f96a77093d4448b0d4b445eb874a8b2e5
BLAKE2b-256 checksum
How to use checksums
3bf9c4b061f08fac83490764f01e02114b7fa74e6b0ba0f9d0cf6eccf6efad7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for portable-ffmpeg 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page