Quick Start
The basic build process follows these steps:Configure the build
Run the configure script to set up the build configuration:To see all available options:
Prerequisites
Required Tools
- GNU Make 3.81 or later
- C compiler supporting ISO C11 (public headers must stay C99 compatible)
- Assembler for platform-specific optimizations:
- NASM on x86
- GAS on ARM and RISC-V
Build Dependencies
Non-system dependencies (e.g. libx264, libvpx) are disabled by default.
Configuration Options
Out-of-Tree Builds
You can build FFmpeg outside the source directory:configure from outside the source tree.
Source Plugins
If you want to include source plugins, merge them before running configure:Platform-Specific Notes
Language Requirements
Main Language:- FFmpeg is primarily programmed in ISO C11
- Public headers must maintain C99 compatibility
- Compiler-specific extensions may be used but code must still compile without them
- Compiler intrinsics or inline assembly - When code cannot be written in standard C and needs to be inlined
- Objective-C - Required for macOS-specific interfaces
SIMD and DSP Optimization
FFmpeg uses handwritten assembly for performance-critical code since compilers cannot generate efficient SIMD/DSP code from plain C. Standard Approach:- Write a plain C version that works everywhere
- Write architecture-specific optimized versions
- Initialization code selects the best version at runtime
- Function is called through a function pointer
- x86: NASM
- ARM: GAS
- RISC-V: GAS
checkasm tests:
For Package Maintainers
To avoid circular dependencies, build FFmpeg twice:First Build - Minimal Dependencies
Build with minimal external dependencies:This allows 3rd party packages to build against FFmpeg’s core libraries.
Build 3rd Party Packages
Build packages that depend on libavutil/libavfilter/libavcodec/libavformat.
Common Configuration Examples
Minimal Build
Full-Featured Build
Development Build with Debugging
Troubleshooting
Configuration Issues
If configure fails, check:- Required dependencies are installed
- Compiler version is compatible
- External library development packages are available
Build Failures
For build errors:- Ensure GNU Make 3.81 or later is installed
- Check that all required headers are available
- Verify disk space is sufficient
Runtime Issues
If the built binary doesn’t work:- Check that all enabled libraries are properly linked
- Verify library paths are correctly set (
LD_LIBRARY_PATHon Linux) - Test with a minimal configuration first
Next Steps
Contributing
Learn how to contribute your changes back to FFmpeg
Code Style
Follow FFmpeg’s coding standards and style guidelines
Testing
Run FATE tests to verify your build