Package: ffmpeg-downloader
Pythonffmpeg-downloaderpackage automatically downloads the latest FFmpeg prebuilt binaries for Windows, Linux, & MacOS.
It’s cli interface mimics that ofpipto install, uninstall, list, search, and download available FFmpeg versions. This package
is ideal for those who:Use the git snapshot version of FFmpegAre in Windows environmentThose who intend to use a release version in Linux and MacOS are encouraged to install via the OS package manager
(e.g.,apt-getfor Ubuntu andbrewfor MacOS).The FFmpeg builds will be downloaded from 3rd party hosts:Windowshttps://www.gyan.dev/ffmpeg/buildsLinuxhttps://johnvansickle.com/ffmpegMacOShttps://evermeet.cx/ffmpegIf you appreciate their effort to build and host these builds, please consider donating on their websites.Installationpipinstallffmpeg-downloaderConsole CommandsIn cli, useffdlcommand after the package is installed. Alternately, you can call the module bypython -m ffmpeg_downloader. For full help, run:ffdl -h <command>To download and install FFmpeg binariesffdlinstallThis command downloads and installs the latest FFmpegrelease. You will see the progress messages
similar to the following:CollectingffmpegUsingcachedffmpeg-5.1.2-essentials_build.zip(79MB)InstallingcollectedFFmpegbinaries:5.1.2@essentialsSuccessfullyinstalledFFmpegbinaries:5.1.2@essentialsinC:\Users\User\AppData\Local\ffmpegio\ffmpeg-downloader\ffmpeg\binIn Linux, symlinks fo the installed binaries are automatically created in~/.local/binor~/binso the FFmpeg commands are immediately available (only if one of these directories already exists).In Windows and MacOS, the binary folder can be added to the system path by–add-pathoption:ffdlinstall--add-pathThe new system paths won’t be applied to the current console window. You may need to close and reopen
or possibly log out and log back in for the change to take effect.To install the latest git master snapshot build:ffdlinstallsnapshotTo list or search available release versions:Uselistandsearchcommands.ffdllist# lists all available releasesffdlsearch5# lists all v5 releasesTo specify a release version:Add version number as the last argument of the command:ffdlinstall4.4Additionally, there are multiple options for each build for the Windows builds:essentialsBuilt only with commonly used third-party libraries (default option)fullBuilt with the most third-party librariesfull-sharedSame asfullbut separate shared libraries (DLLs) and development files
(release builds only)Visitgyan.devfor more information.
To specify which flavor to install, use@ffdlinstallsnapshot@full# full build of latest snapshotffdlinstall5.2@full-shared# full build of v5.2To update or change version if availableLikepip, use-Uor--upgradeflagffdlinstall-UTo uninstallffdluninstallIn PythonThis package has the following useful attributes:importffmpeg_downloaderasffdlffdl.ffmpeg_dir# FFmpeg binaries directoryffdl.ffmpeg_version# version string of the intalled FFmpegffdl.ffmpeg_path# full path of the FFmpeg binaryffdl.ffprobe_path# full path of the FFprobe binaryffdl.ffplay_path# full path of the FFplay binaryTheffxxx_pathattributes are useful to call FFxxx command withsubprocess:# To call FFmpeg via subprocessimportsubprocessasspsp.run([ffdl.ffmpeg_path,'-i','input.mp4','output.mkv'])Meanwhile, there are many FFmpeg wrapper packages which do not let you specify the
FFmpeg path or cumbersome to do so. If installing the FFmpeg with--add-pathoption is
not preferable, useffmpeg_downloader.add_path()function to make the binaries available
to these packages.