├── .github └── workflows │ └── build.yml ├── CHANGELOG.md ├── LICENSE ├── README.md ├── build-linux.sh ├── build-macos.sh ├── build-windows.sh └── common.sh /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build static ffmpeg 2 | 3 | on: 4 | push: 5 | pull_request: 6 | 7 | jobs: 8 | package-linux: 9 | runs-on: ubuntu-20.04 10 | strategy: 11 | matrix: 12 | arch: 13 | - x86_64 14 | - arm64 15 | env: 16 | ARCH: ${{ matrix.arch }} 17 | steps: 18 | - uses: actions/checkout@v3 19 | - name: Install dependencies 20 | run: | 21 | sudo apt-get update -y && \ 22 | sudo apt-get install -y yasm 23 | - name: Install ARM64 compiler 24 | if: env.ARCH == 'arm64' 25 | run: | 26 | sudo apt-get update -y && \ 27 | sudo apt-get install -y gcc-aarch64-linux-gnu 28 | - name: Build 29 | run: ./build-linux.sh 30 | - name: Archive production artifacts 31 | uses: actions/upload-artifact@v1 32 | with: 33 | name: ffmpeg-linux-${{ env.ARCH }} 34 | path: artifacts/ 35 | 36 | package-windows: 37 | runs-on: ubuntu-20.04 38 | strategy: 39 | matrix: 40 | arch: 41 | - x86_64 42 | env: 43 | ARCH: ${{ matrix.arch }} 44 | steps: 45 | - uses: actions/checkout@v3 46 | - name: Install dependencies 47 | run: | 48 | sudo apt-get update -y && \ 49 | sudo apt-get install -y yasm mingw-w64 50 | - name: Build 51 | run: ./build-windows.sh 52 | - name: Archive production artifacts 53 | uses: actions/upload-artifact@v1 54 | with: 55 | name: ffmpeg-windows-${{ env.ARCH }} 56 | path: artifacts/ 57 | 58 | package-macos: 59 | runs-on: macos-latest 60 | strategy: 61 | matrix: 62 | # https://developer.apple.com/documentation/apple-silicon/building-a-universal-macos-binary#Update-the-Architecture-List-of-Custom-Makefiles 63 | target: 64 | - x86_64-apple-macos10.9 65 | - arm64-apple-macos11 66 | env: 67 | TARGET: ${{ matrix.target }} 68 | steps: 69 | - uses: actions/checkout@v3 70 | - name: Install dependencies 71 | run: brew install yasm 72 | - name: Build 73 | run: ./build-macos.sh 74 | - name: Archive artifacts 75 | uses: actions/upload-artifact@v1 76 | with: 77 | name: ffmpeg-${{ matrix.target }} 78 | path: artifacts/ 79 | 80 | release: 81 | runs-on: ubuntu-latest 82 | needs: 83 | - package-linux 84 | - package-windows 85 | - package-macos 86 | steps: 87 | - uses: actions/download-artifact@v2 88 | with: 89 | path: artifacts/ 90 | - name: Make tarballs 91 | run: | 92 | mkdir artifacts/release/ 93 | cd artifacts/ 94 | for dir in ffmpeg-*/ffmpeg-* 95 | do 96 | name=$(basename $dir) 97 | tar czf release/$name.tar.gz -C $(dirname $dir) $name 98 | done 99 | ls -l release/ 100 | - name: Release 101 | uses: softprops/action-gh-release@v1 102 | if: startsWith(github.ref, 'refs/tags/v') 103 | with: 104 | files: artifacts/release/* 105 | env: 106 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 107 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this project will be documented in this file. 3 | 4 | ## [Unreleased] 5 | 6 | ## [4.2.2-5] - 2020-02-19 7 | ### Changed 8 | - Linux and Windows builds now use the manylinux2010 Docker image defined by the Python community. 9 | 10 | ### Removed 11 | - Removed i686 and armhf builds. 12 | 13 | ## [4.2.2-4] - 2020-02-12 14 | ### Changed 15 | - Enable PIC in static builds 16 | 17 | [Unreleased]: https://github.com/acoustid/ffmpeg-build/compare/v4.2.2-5...HEAD 18 | [4.2.2-5]: https://github.com/acoustid/ffmpeg-build/compare/v4.2.2-4...v4.2.2-5 19 | [4.2.2-4]: https://github.com/acoustid/ffmpeg-build/compare/v4.2.2-3...v4.2.2-4 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Lukas Lalinsky 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Static audio-only FFmpeg builds 2 | =============================== 3 | 4 | This project contains scripts for small static audio-only FFmpeg builds that are used 5 | for Chromaprint packaging. 6 | 7 | Building is done using GitHub Actions. You can find the built binaries on the releases page. 8 | 9 | Supported platforms: 10 | 11 | - Linux 12 | * `x86\_64-linux-gnu` 13 | - Windows 14 | * `x86\_64-w64-mingw32` 15 | - macOS 16 | * `x86_64-apple-macos10.9` (macOS Mavericks and newer on Intel CPU) 17 | * `arm64-apple-macos11` (macOS Big Sur and newer on Apple M1 CPU) 18 | -------------------------------------------------------------------------------- /build-linux.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eu 4 | 5 | cd $(dirname $0) 6 | BASE_DIR=$(pwd) 7 | 8 | source common.sh 9 | 10 | if [ ! -e $FFMPEG_TARBALL ] 11 | then 12 | curl -s -L -O $FFMPEG_TARBALL_URL 13 | fi 14 | 15 | : ${ARCH?} 16 | 17 | OUTPUT_DIR=artifacts/ffmpeg-$FFMPEG_VERSION-audio-$ARCH-linux-gnu 18 | 19 | case $ARCH in 20 | x86_64) 21 | ;; 22 | i686) 23 | FFMPEG_CONFIGURE_FLAGS+=(--cc="gcc -m32") 24 | ;; 25 | arm64) 26 | FFMPEG_CONFIGURE_FLAGS+=( 27 | --enable-cross-compile 28 | --cross-prefix=aarch64-linux-gnu- 29 | --target-os=linux 30 | --arch=aarch64 31 | ) 32 | ;; 33 | arm*) 34 | FFMPEG_CONFIGURE_FLAGS+=( 35 | --enable-cross-compile 36 | --cross-prefix=arm-linux-gnueabihf- 37 | --target-os=linux 38 | --arch=arm 39 | ) 40 | case $ARCH in 41 | armv7-a) 42 | FFMPEG_CONFIGURE_FLAGS+=( 43 | --cpu=armv7-a 44 | ) 45 | ;; 46 | armv8-a) 47 | FFMPEG_CONFIGURE_FLAGS+=( 48 | --cpu=armv8-a 49 | ) 50 | ;; 51 | armhf-rpi2) 52 | FFMPEG_CONFIGURE_FLAGS+=( 53 | --cpu=cortex-a7 54 | --extra-cflags='-fPIC -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4 -mvectorize-with-neon-quad' 55 | ) 56 | ;; 57 | armhf-rpi3) 58 | FFMPEG_CONFIGURE_FLAGS+=( 59 | --cpu=cortex-a53 60 | --extra-cflags='-fPIC -mcpu=cortex-a53 -mfloat-abi=hard -mfpu=neon-fp-armv8 -mvectorize-with-neon-quad' 61 | ) 62 | ;; 63 | esac 64 | ;; 65 | *) 66 | echo "Unknown architecture: $ARCH" 67 | exit 1 68 | ;; 69 | esac 70 | 71 | BUILD_DIR=$(mktemp -d -p $(pwd) build.XXXXXXXX) 72 | trap 'rm -rf $BUILD_DIR' EXIT 73 | 74 | cd $BUILD_DIR 75 | tar --strip-components=1 -xf $BASE_DIR/$FFMPEG_TARBALL 76 | 77 | FFMPEG_CONFIGURE_FLAGS+=(--prefix=$BASE_DIR/$OUTPUT_DIR) 78 | 79 | ./configure "${FFMPEG_CONFIGURE_FLAGS[@]}" || (cat ffbuild/config.log && exit 1) 80 | 81 | make 82 | make install 83 | 84 | chown $(stat -c '%u:%g' $BASE_DIR) -R $BASE_DIR/$OUTPUT_DIR 85 | -------------------------------------------------------------------------------- /build-macos.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eux 4 | 5 | cd $(dirname $0) 6 | BASE_DIR=$(pwd) 7 | 8 | source common.sh 9 | 10 | if [ ! -e $FFMPEG_TARBALL ] 11 | then 12 | curl -s -L -O $FFMPEG_TARBALL_URL 13 | fi 14 | 15 | : ${TARGET?} 16 | 17 | case $TARGET in 18 | x86_64-*) 19 | ARCH="x86_64" 20 | ;; 21 | arm64-*) 22 | ARCH="arm64" 23 | ;; 24 | *) 25 | echo "Unknown target: $TARGET" 26 | exit 1 27 | ;; 28 | esac 29 | 30 | OUTPUT_DIR=artifacts/ffmpeg-$FFMPEG_VERSION-audio-$TARGET 31 | 32 | BUILD_DIR=$BASE_DIR/$(mktemp -d build.XXXXXXXX) 33 | trap 'rm -rf $BUILD_DIR' EXIT 34 | 35 | cd $BUILD_DIR 36 | tar --strip-components=1 -xf $BASE_DIR/$FFMPEG_TARBALL 37 | 38 | FFMPEG_CONFIGURE_FLAGS+=( 39 | --cc=/usr/bin/clang 40 | --prefix=$BASE_DIR/$OUTPUT_DIR 41 | --enable-cross-compile 42 | --target-os=darwin 43 | --arch=$ARCH 44 | --extra-ldflags="-target $TARGET" 45 | --extra-cflags="-target $TARGET" 46 | --enable-runtime-cpudetect 47 | ) 48 | 49 | ./configure "${FFMPEG_CONFIGURE_FLAGS[@]}" || (cat ffbuild/config.log && exit 1) 50 | 51 | perl -pi -e 's{HAVE_MACH_MACH_TIME_H 1}{HAVE_MACH_MACH_TIME_H 0}' config.h 52 | 53 | make V=1 54 | make install 55 | 56 | chown -R $(stat -f '%u:%g' $BASE_DIR) $BASE_DIR/$OUTPUT_DIR 57 | -------------------------------------------------------------------------------- /build-windows.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eu 4 | 5 | cd $(dirname $0) 6 | BASE_DIR=$(pwd) 7 | 8 | source common.sh 9 | 10 | if [ ! -e $FFMPEG_TARBALL ] 11 | then 12 | curl -s -L -O $FFMPEG_TARBALL_URL 13 | fi 14 | 15 | : ${ARCH?} 16 | 17 | OUTPUT_DIR=artifacts/ffmpeg-$FFMPEG_VERSION-audio-$ARCH-w64-mingw32 18 | 19 | BUILD_DIR=$(mktemp -d -p $(pwd) build.XXXXXXXX) 20 | trap 'rm -rf $BUILD_DIR' EXIT 21 | 22 | cd $BUILD_DIR 23 | tar --strip-components=1 -xf $BASE_DIR/$FFMPEG_TARBALL 24 | 25 | FFMPEG_CONFIGURE_FLAGS+=( 26 | --prefix=$BASE_DIR/$OUTPUT_DIR 27 | --extra-cflags='-static -static-libgcc -static-libstdc++' 28 | --target-os=mingw32 29 | --arch=$ARCH 30 | --cross-prefix=$ARCH-w64-mingw32- 31 | ) 32 | 33 | ./configure "${FFMPEG_CONFIGURE_FLAGS[@]}" 34 | make 35 | make install 36 | 37 | chown $(stat -c '%u:%g' $BASE_DIR) -R $BASE_DIR/$OUTPUT_DIR 38 | -------------------------------------------------------------------------------- /common.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | FFMPEG_VERSION=7.0 4 | FFMPEG_TARBALL=ffmpeg-$FFMPEG_VERSION.tar.gz 5 | FFMPEG_TARBALL_URL=http://ffmpeg.org/releases/$FFMPEG_TARBALL 6 | 7 | FFMPEG_CONFIGURE_FLAGS=( 8 | --disable-shared 9 | --enable-static 10 | --enable-pic 11 | 12 | --disable-doc 13 | --disable-debug 14 | --disable-avdevice 15 | --disable-swscale 16 | --disable-programs 17 | --enable-ffmpeg 18 | --enable-ffprobe 19 | --disable-network 20 | --disable-muxers 21 | --disable-demuxers 22 | --disable-zlib 23 | --disable-lzma 24 | --disable-bzlib 25 | --disable-iconv 26 | --disable-libxcb 27 | --disable-bsfs 28 | --disable-filters 29 | --disable-parsers 30 | --disable-indevs 31 | --disable-outdevs 32 | --disable-encoders 33 | --disable-decoders 34 | --disable-hwaccels 35 | --disable-nvenc 36 | --disable-videotoolbox 37 | --disable-audiotoolbox 38 | 39 | --disable-filters 40 | --enable-filter=aformat 41 | --enable-filter=anull 42 | --enable-filter=atrim 43 | --enable-filter=format 44 | --enable-filter=null 45 | --enable-filter=setpts 46 | --enable-filter=trim 47 | 48 | --disable-protocols 49 | --enable-protocol=file 50 | --enable-protocol=pipe 51 | 52 | --enable-demuxer=image2 53 | --enable-demuxer=aac 54 | --enable-demuxer=ac3 55 | --enable-demuxer=aiff 56 | --enable-demuxer=ape 57 | --enable-demuxer=asf 58 | --enable-demuxer=au 59 | --enable-demuxer=avi 60 | --enable-demuxer=flac 61 | --enable-demuxer=flv 62 | --enable-demuxer=matroska 63 | --enable-demuxer=mov 64 | --enable-demuxer=m4v 65 | --enable-demuxer=mp3 66 | --enable-demuxer=mpc 67 | --enable-demuxer=mpc8 68 | --enable-demuxer=ogg 69 | --enable-demuxer=pcm_alaw 70 | --enable-demuxer=pcm_mulaw 71 | --enable-demuxer=pcm_f64be 72 | --enable-demuxer=pcm_f64le 73 | --enable-demuxer=pcm_f32be 74 | --enable-demuxer=pcm_f32le 75 | --enable-demuxer=pcm_s32be 76 | --enable-demuxer=pcm_s32le 77 | --enable-demuxer=pcm_s24be 78 | --enable-demuxer=pcm_s24le 79 | --enable-demuxer=pcm_s16be 80 | --enable-demuxer=pcm_s16le 81 | --enable-demuxer=pcm_s8 82 | --enable-demuxer=pcm_u32be 83 | --enable-demuxer=pcm_u32le 84 | --enable-demuxer=pcm_u24be 85 | --enable-demuxer=pcm_u24le 86 | --enable-demuxer=pcm_u16be 87 | --enable-demuxer=pcm_u16le 88 | --enable-demuxer=pcm_u8 89 | --enable-demuxer=rm 90 | --enable-demuxer=shorten 91 | --enable-demuxer=tak 92 | --enable-demuxer=tta 93 | --enable-demuxer=wav 94 | --enable-demuxer=wv 95 | --enable-demuxer=xwma 96 | --enable-demuxer=dsf 97 | 98 | --enable-decoder=aac 99 | --enable-decoder=aac_latm 100 | --enable-decoder=ac3 101 | --enable-decoder=alac 102 | --enable-decoder=als 103 | --enable-decoder=ape 104 | --enable-decoder=atrac1 105 | --enable-decoder=atrac3 106 | --enable-decoder=eac3 107 | --enable-decoder=flac 108 | --enable-decoder=gsm 109 | --enable-decoder=gsm_ms 110 | --enable-decoder=mp1 111 | --enable-decoder=mp1float 112 | --enable-decoder=mp2 113 | --enable-decoder=mp2float 114 | --enable-decoder=mp3 115 | --enable-decoder=mp3adu 116 | --enable-decoder=mp3adufloat 117 | --enable-decoder=mp3float 118 | --enable-decoder=mp3on4 119 | --enable-decoder=mp3on4float 120 | --enable-decoder=mpc7 121 | --enable-decoder=mpc8 122 | --enable-decoder=opus 123 | --enable-decoder=ra_144 124 | --enable-decoder=ra_288 125 | --enable-decoder=ralf 126 | --enable-decoder=shorten 127 | --enable-decoder=tak 128 | --enable-decoder=tta 129 | --enable-decoder=vorbis 130 | --enable-decoder=wavpack 131 | --enable-decoder=wmalossless 132 | --enable-decoder=wmapro 133 | --enable-decoder=wmav1 134 | --enable-decoder=wmav2 135 | --enable-decoder=wmavoice 136 | 137 | --enable-decoder=pcm_alaw 138 | --enable-decoder=pcm_bluray 139 | --enable-decoder=pcm_dvd 140 | --enable-decoder=pcm_f32be 141 | --enable-decoder=pcm_f32le 142 | --enable-decoder=pcm_f64be 143 | --enable-decoder=pcm_f64le 144 | --enable-decoder=pcm_lxf 145 | --enable-decoder=pcm_mulaw 146 | --enable-decoder=pcm_s8 147 | --enable-decoder=pcm_s8_planar 148 | --enable-decoder=pcm_s16be 149 | --enable-decoder=pcm_s16be_planar 150 | --enable-decoder=pcm_s16le 151 | --enable-decoder=pcm_s16le_planar 152 | --enable-decoder=pcm_s24be 153 | --enable-decoder=pcm_s24daud 154 | --enable-decoder=pcm_s24le 155 | --enable-decoder=pcm_s24le_planar 156 | --enable-decoder=pcm_s32be 157 | --enable-decoder=pcm_s32le 158 | --enable-decoder=pcm_s32le_planar 159 | --enable-decoder=pcm_u8 160 | --enable-decoder=pcm_u16be 161 | --enable-decoder=pcm_u16le 162 | --enable-decoder=pcm_u24be 163 | --enable-decoder=pcm_u24le 164 | --enable-decoder=pcm_u32be 165 | --enable-decoder=pcm_u32le 166 | --enable-decoder=pcm_zork 167 | --enable-decoder=dsd_lsbf 168 | --enable-decoder=dsd_msbf 169 | --enable-decoder=dsd_lsbf_planar 170 | --enable-decoder=dsd_msbf_planar 171 | 172 | --enable-parser=aac 173 | --enable-parser=aac_latm 174 | --enable-parser=ac3 175 | --enable-parser=cook 176 | --enable-parser=dca 177 | --enable-parser=flac 178 | --enable-parser=gsm 179 | --enable-parser=mpegaudio 180 | --enable-parser=tak 181 | --enable-parser=vorbis 182 | ) 183 | --------------------------------------------------------------------------------