wiki:

CompilationGuide


Version 45 (modified by slhck, 4 months ago) (diff)

style the warning

FFmpeg Compilation Guide

This page contains a list of resources which describe the necessary steps required for compiling FFmpeg from scratch.

All platforms

Read the Generic compilation guide, regardless of your platform. It provides generic compilation and installation instructions, including the use of configure.

Linux

Note: If you are using gcc-4.2, please read ticket 1464 first, and try to update your compiler. A message to that effect is printed on running configure off the master branch.

A Docker image with pre-compiled ffmpeg and libraries is available as well.

macOS

Windows

Other Platforms

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