= FFmpeg Compilation Guide = This page contains a list of resources which describe the necessary steps required for compiling FFmpeg from scratch or with the help of build scripts and/or package managers. == All platforms == Read the [[CompilationGuide/Generic|Generic compilation guide]], regardless of your platform. It provides generic compilation and installation instructions, including the use of `configure`. * [[CompilationGuide/vcpkg]] – vcpkg also aims to be portable accross all platforms. For windows it uses MinGW/MSYS compilation toolchain. == Linux == * [[CompilationGuide/Ubuntu|Compiling FFmpeg on Ubuntu / Debian / Mint]] * [[CompilationGuide/Centos|Compiling FFmpeg on CentOS / RHEL / Fedora]] Alternative ways to obtain/compile ffmpeg under Linux: * [https://hub.docker.com/r/jrottenberg/ffmpeg/ Docker image with pre-compiled ffmpeg] and libraries * [https://linuxbrew.sh/ Linuxbrew] == macOS == * [[CompilationGuide/macOS|Compiling FFmpeg on macOS]] == Windows == * [[CompilationGuide/MinGW]] – MinGW Compilation Guide for compiling FFmpeg with Windows/MinGW/MSYS. * [[CompilationGuide/CrossCompilingForWindows]] – Cross compiling for Windows is sometimes easier than using MSYS+MinGW. * [[CompilationGuide/WinRT]] – Compiling FFmpeg for Windows Apps (Windows 10 and Windows 8.1) * [[CompilationGuide/MSVC]] – Compiling FFmpeg using MSYS+MSVC, see also: * [http://ffmpeg.org/platform.html Instructions on the reference web page] * [https://www.roxlu.com/2019/062/compiling-ffmpeg-with-x264-on-windows-10-using-msvc Roxlu's guide] Using external scripts or tools: * [https://github.com/m-ab-s/media-autobuild_suite Media Autobuild Suite] – Automatically build FFmpeg under Windows * [https://linuxbrew.sh/ Linuxbrew], which can be used with Windows Subsystem for Linux (WSL) * [https://chocolatey.org/packages/ffmpeg Chocolatey] – a package manager for Windows with an FFmpeg package == Other Platforms == * [[CompilationGuide/RaspberryPi|How to compile FFmpeg for Raspberry Pi (Raspbian)]] * [[https://github.com/sitkevij/ffmpeg/tree/master/ffmpeg-3.4.1-resin-rpi-raspbian|Pre-compiled FFmpeg for Raspberry Pi (Raspbian) Docker image]] * [[CompilationGuide/Android|How to compile FFmpeg for Android]] * [[CompilationGuide/MIPS|How to cross-compile FFmpeg for MIPS]] * [[CompilationGuide/Haiku|How to compile FFmpeg for Haiku]] == Performance Tips == There are numerous avenues to extract maximum performance out of FFmpeg when it is built from source. The following list describes some of them: * If using {{{GCC/Clang}}}, consider adding {{{-march=native}}} to {{{--extra-cflags}}} to make slightly better use of your hardware. Alternatively, for a more general solution, examine the {{{--arch}}} and {{{--cpu}}} options. Gains are variable, and usually quite small. However, this is usually even more safe than the above, and is thus listed here. * Depending on your use case, {{{--enable-hardcoded-tables}}} may be a useful option. It results in an increase of approximately 15% in the size of {{{libavcodec}}}, the main library impacted by this change. It enables savings in table generation time, done once at codec initialization, since by hardcoding the tables, they do not need to be computed at runtime. However, the savings are often negligible (~100k cycles is a typical number) especially when amortized over the entire encoding/decoding operation. By default, this is not enabled. Improvements are being made to the runtime initialization, and so over time, this option will have an impact on fewer and fewer codecs. * Other options may be found by examining {{{./configure --help}}}. = Guides for developers = * [[Setup_Eclipse_IDE_for_FFmpeg_(Linux)|Setup Eclipse IDE for FFmpeg (Linux)]]