FFmpeg build script
Find a file
2026-05-14 13:34:28 +02:00
script fix: libtheora download 2026-04-11 15:04:03 +02:00
test new libharfbuzz build flag 2023-06-21 20:06:16 +02:00
version ffmpeg update (version 8.1.1) 2026-05-14 13:34:28 +02:00
.gitignore chore: ignore indellij idea files 2025-10-18 22:22:18 +02:00
build.sh feat: new build flag for (L)GPLv3 2026-04-02 20:35:28 +02:00
DEPENDENCY.md feature/vvenc 2025-01-04 15:30:42 +00:00
LICENSE Add LICENSE 2021-12-26 17:30:32 +00:00
README.md docs: fixed some typos 2025-09-29 21:50:25 +02:00
renovate.json ci: 8 new dependency checks 2026-03-08 12:56:38 +01:00

FFmpeg

This script is made to compile FFmpeg with common codecs on Linux and macOS.

Looking for the pre-compiled result?

Check out the build server. Here you can download builds for Linux and macOS.

Branches

The main branch contains the latest stable script used for release builds (e.g. version 8.0). The develop branch contains the latest changes and used for snapshot builds.

Result

This repository builds FFmpeg, FFprobe and FFplay using

To get a full list of all formats and codecs that are supported just execute

./ffmpeg -formats
./ffmpeg -codecs
./ffmpeg -protocols

Requirements

There are just a few dependencies to other tools. Most of the software is compiled or downloaded during script execution. Also most of the tools should be already available on the system by default.

Linux

  • gcc (c and c++ compiler)
  • curl
  • make
  • zip, bunzip2
  • rust / cargo / cargo-c
  • python3 (including pip virtualenv)

macOS

  • Xcode
  • rust / cargo / cargo-c
  • python3 (including pip virtualenv)

Windows (not supported)

For compilation on Windows please use MSYS2. Follow the whole instructions for installation (including step 7).

Execution

All files that are downloaded and generated through this script are placed in the current working directory. The recommendation is to use an empty folder for this and execute the build.sh.

mkdir ffmpeg-compile
cd ffmpeg-compile
../build.sh

You can use the following parameters

  • -FFMPEG_SNAPSHOT=YES for using the latest snapshot of FFmpeg instead of the last release
  • -SKIP_TEST=YES for skipping the tests after compiling
  • -SKIP_BUNDLE=YES for skipping creating the ffmpeg-success.zip file
  • -CPU_LIMIT=num for limit CPU thread usage (default: automatically detected)

If you don't need a codec/library, you can also disable them:

  • libraries
    • -SKIP_LIBKLVANC=YES
    • -SKIP_LIBBLURAY=YES
    • -SKIP_SNAPPY=YES
    • -SKIP_SRT=YES
    • -SKIP_LIBVMAF=YES
    • -SKIP_ZIMG=YES
    • -SKIP_ZVBI=YES
  • video codecs
    • -SKIP_AOM=YES
    • -SKIP_DAV1D=YES
    • -SKIP_OPEN_H264=YES
    • -SKIP_OPEN_JPEG=YES
    • -SKIP_RAV1E=YES
    • -SKIP_SVT_AV1=YES
    • -SKIP_LIBTHEORA=YES
    • -SKIP_VPX=YES
    • -SKIP_VVENC=YES
    • -SKIP_LIBWEBP=YES
    • -SKIP_X264=YES
    • -SKIP_X265=YES
    • -SKIP_X265_MULTIBIT=YES
  • audio codecs
    • -SKIP_LAME=YES
    • -SKIP_OPUS=YES
    • -SKIP_LIBVORBIS=YES

After the execution a new folder called out exists. It contains the compiled FFmpeg binary (in the bin sub-folder). The ffmpeg-success.zip contains also all binary files of FFmpeg, FFprobe and FFplay.

It is required to prepare the Blackmagic Decklink SDK manually, because a automated download is not possible. Download the SDK manually from the Blackmagic Website and extract the compressed file. Then add the following parameters (for the SDK include location):

-DECKLINK_SDK=/path/to/SDK/os/include -SKIP_DECKLINK=NO

Validate Build

Dynamic Linking

You can check dynamically linked libraries using the following command:

# macOS
otool -L out/bin/ffmpeg

# linux
ldd out/bin/ffmpeg

Build failed?

Check the detailed logfiles in the log directory. Each build step has its own file starting with "build-*".

If the build of ffmpeg fails during the configuration phase (e.g. because it doesn't find one codec) check also the log file in source/ffmpeg/ffmpeg-*/ffbuild/config.log.

License

Copyright 2021 Martin Riedl

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.