On a dev machine, FFmpeg is one line away: sudo apt install ffmpeg, check it's on your PATH, call it with subprocess. The cost shows up when you ship the app to people who have no terminal and just want an installer.
I build VoxCut, a silence remover for audio and video. It ships on Windows (PyInstaller), Linux (AppImage, Snap, Flatpak) and Android. Here is how FFmpeg is packaged in each, what it weighs, and one check to run before shipping.
One PATH hook for the desktop builds
The desktop app is Python. Instead of hard-coding a binary path everywhere, there is one place that decides where FFmpeg lives, and every subprocess call just says ffmpeg:
def _get_base_dir() -> Path: if getattr(sys, "frozen", False): return Path(sys._MEIPASS) return Path(__file__).parent.parent def _setup_ffmpeg_path(): ffmpeg_dir = _get_base_dir() / "ffmpeg" if ffmpeg_dir.exists(): os.environ["PATH"] = str(ffmpeg_dir) + os.pathsep + os.environ.get("PATH", "") _setup_ffmpeg_path() In development there is no ffmpeg/ folder next to the code, so the system FFmpeg is used. In a frozen build the folder is inside the bundle and goes first on PATH. The same code serves Windows and Linux; only the PyInstaller spec file differs. The bundled binary wins over whatever the user has installed, which is what you want: you tested your filters against one version.
Windows: two binaries of about 100 MB each
The Windows spec copies both executables into an ffmpeg/ folder of the bundle:
datas = [ (str(app_dir / 'ffmpeg' / 'ffmpeg.exe'), 'ffmpeg'), (str(app_dir / 'ffmpeg' / 'ffprobe.exe'), 'ffmpeg'), ] The build is onedir, not onefile. The comment in my spec says why: the executable holds only the code and the binaries sit beside it, so the app starts almost instantly with no temporary extraction.
What this costs: ffmpeg.exe is 101 MB and ffprobe.exe 101 MB. They are two statically linked copies of the same libraries, so you pay twice. If you only need one of them, ship one.
One small Windows detail: the subprocess calls are started with CREATE_NO_WINDOW, otherwise a console window flashes at each call.
Linux: the same bundle, three containers
The Linux build downloads a static FFmpeg in build_linux.sh, marks it executable, and PyInstaller packs it into the same ffmpeg/ folder:
wget -O "$tmp/ffmpeg.tar.xz" "$FFMPEG_STATIC_URL" # a static Linux build cp "$d/ffmpeg" ffmpeg-linux/ffmpeg cp "$d/ffprobe" ffmpeg-linux/ffprobe chmod +x ffmpeg-linux/ffmpeg ffmpeg-linux/ffprobe These are about 80 MB each (79.8 MB and 79.7 MB). The result is then packaged three ways, and the sandbox is where the differences are:
- AppImage: the bundle as-is, no sandbox.
- Snap:
confinement: strictoncore24, with thehomeandremovable-mediaplugs. The snap doesn't compile FFmpeg; it unpacks the PyInstaller tarball intoopt/voxcut/and a one-line launcher runs it. So FFmpeg travels inside the bundle and the PATH hook above works unchanged. The cost is access: files outside the home folder and removable media are out of reach unless the user connects another plug. - Flatpak:
--filesystem=homeso the app can read the chosen file and write the export.
I did not need classic confinement, because the app only works on files the user picks in their home folder or on external media. If your users keep audio on another internal drive, that is exactly the case where strict confinement will bite.
Android: no binary at all
Android is not a port of the Python code. It is a Flutter app, and FFmpeg comes as a library through the ffmpeg_kit_flutter_new package (^4.2.1), so nothing is executed as a separate process:
final session = await FFmpegKit.execute( '-y -f concat -safe 0 -i "${concatFile.path}" -af "$af" "$tempOutputPath"'); if (!ReturnCode.isSuccess(await session.getReturnCode())) { /* handle error */ } Intermediate files go to the app's temporary directory, and the export is saved into Downloads through MediaStore on Android 10 and later (the saved name can differ if a file with the same name exists, so the app reads back the name that was actually written). Cancelling is FFmpegKit.cancel().
The mobile-specific cost is memory, not packaging: I cap the total input size at 500 MB, a limit written in the code as an out-of-memory safety margin for phones.
One check before you ship: the licence
FFmpeg is released under the LGPL or the GPL depending on how a given binary was built. Run ffmpeg -version and read the configuration: line: if it contains --enable-gpl, that build is GPL, and the obligations that come with redistributing it are different. The FFmpeg project explains them on its legal page. Check this for the exact build you bundle, before your first release.
What I'd do again
- One PATH hook, one folder. Every call says
ffmpeg; the packaging decides which one. Switching bundling method didn't touch the audio code. - Count your copies.
ffmpegandffprobeare about 100 MB each on Windows. Ship only what you call. - Test the packaged build, not the dev run. In development the system FFmpeg masks a missing bundle.
- Read the
configuration:line of every FFmpeg you redistribute.

