Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 52 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
permissions:
contents: read
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
Expand All @@ -57,6 +58,8 @@ jobs:
- FFMPEG
# name: ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}
name: # each entry must have a matching block in the "include" section below
- Alpine-aarch64
- Alpine-x86_64
- Darwin-arm64
- Darwin-x86_64
- FreeBSD-aarch64
Expand All @@ -67,6 +70,20 @@ jobs:
- Windows-AMD64
- Windows-ARM64
include:
- name: Alpine-aarch64
os: ubuntu-24.04-arm
arch: aarch64
build_ffmpeg_cuda_llvm: 'OFF'
generator: "Unix Makefiles"
shell: sh
container: alpine:3.22
- name: Alpine-x86_64
os: ubuntu-latest
arch: x86_64
build_ffmpeg_cuda_llvm: 'OFF'
generator: "Unix Makefiles"
shell: sh
container: alpine:3.22
- name: Darwin-arm64
os: macos-14
arch: aarch64
Expand Down Expand Up @@ -126,14 +143,44 @@ jobs:
run:
shell: ${{ matrix.shell }}
steps:
- name: Fix arm64 Alpine container
if: runner.arch == 'ARM64' && startsWith(matrix.name, 'Alpine')
uses: laverdet/alpine-arm64@7f0f72ee2f71eb2324e5888e8b6e42b1b53e6160 # v1.0.0

# must be before checkout so that git is available in the container
- name: Setup Dependencies Alpine
if: startsWith(matrix.name, 'Alpine')
run: |
set -eux
apk add --no-cache \
autoconf \
automake \
bash \
build-base \
cmake \
git \
libdrm-dev \
libtool \
libx11-dev \
libxcb-dev \
libxext-dev \
libxfixes-dev \
libxrandr-dev \
linux-headers \
mesa-dev \
nasm \
numactl-dev \
pkgconf \
wayland-dev

- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive

- name: Prepare Dependencies Linux
id: cross_compile
if: runner.os == 'Linux' && !startsWith(matrix.shell, 'freebsd')
if: runner.os == 'Linux' && !startsWith(matrix.shell, 'freebsd') && !startsWith(matrix.name, 'Alpine')
run: |
echo "::group::distro detection"
# detect dist name like bionic, focal, etc
Expand Down Expand Up @@ -309,7 +356,7 @@ jobs:
echo "::endgroup::"

- name: Setup Dependencies Linux
if: runner.os == 'Linux' && !startsWith(matrix.shell, 'freebsd')
if: runner.os == 'Linux' && !startsWith(matrix.shell, 'freebsd') && !startsWith(matrix.name, 'Alpine')
run: |
echo "::group::apt update"
sudo apt-get update
Expand Down Expand Up @@ -520,6 +567,8 @@ jobs:
set -e
cd "$GITHUB_WORKSPACE"

build_ffmpeg_cuda_llvm="${{ matrix.build_ffmpeg_cuda_llvm || 'ON' }}"

if [ "${{ startsWith(matrix.shell, 'freebsd') }}" = true ]; then
export CC=$(which clang${{ env.FREEBSD_CLANG_VERSION }})
export CXX=$(which clang++${{ env.FREEBSD_CLANG_VERSION }})
Expand All @@ -542,6 +591,7 @@ jobs:
-G "${{ matrix.generator }}" \
-DBUILD_ALL=OFF \
-DBUILD_${{ matrix.build }}=ON \
-DBUILD_FFMPEG_CUDA_LLVM=${build_ffmpeg_cuda_llvm} \
-DCMAKE_TOOLCHAIN_FILE=${{ env.CMAKE_TOOLCHAIN_FILE }} \
-DCMAKE_INSTALL_PREFIX="${{ env.ROOT_PATH }}/build/dist" \
-DPARALLEL_BUILDS=${{ steps.processor_count.outputs.PROCESSOR_COUNT || 1 }}
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ option(BUILD_FFMPEG_CBS_PATCHES "Apply FFmpeg CBS patches" ON)
option(BUILD_FFMPEG_MF "Build FFmpeg Media Foundation" ON)
option(BUILD_FFMPEG_MF_PATCHES "Apply FFmpeg Media Foundation patches" ON)
option(BUILD_FFMPEG_NV_CODEC_HEADERS "Build FFmpeg NV Codec Headers" ON)
option(BUILD_FFMPEG_CUDA_LLVM "Build FFmpeg with cuda_llvm support when NV codec headers are enabled" ON)
option(BUILD_FFMPEG_NV_CODEC_HEADERS_PATCHES "Apply FFmpeg NV Codec Headers patches" ON)
option(BUILD_FFMPEG_SVT_AV1 "Build FFmpeg SVT-AV1" ON)
option(BUILD_FFMPEG_SVT_AV1_PATCHES "Apply FFmpeg SVT-AV1 patches" ON)
Expand Down
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ pkg install -y \

#### Linux

##### Debian/Ubuntu

```bash
sudo apt install -y \
autoconf \
Expand Down Expand Up @@ -113,6 +115,31 @@ sudo apt install -y \
zlib1g-dev
```

#### Alpine

```bash
apk add --no-cache \
autoconf \
automake \
bash \
build-base \
cmake \
git \
libdrm-dev \
libtool \
libx11-dev \
libxcb-dev \
libxext-dev \
libxfixes-dev \
libxrandr-dev \
linux-headers \
mesa-dev \
nasm \
numactl-dev \
pkgconf \
wayland-dev
```

#### macOS

```bash
Expand Down
2 changes: 1 addition & 1 deletion cmake/ffmpeg/ffmpeg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ if(BUILD_FFMPEG_NV_CODEC_HEADERS)
--enable-ffnvcodec
--enable-nvenc
)
if(UNIX AND NOT APPLE AND NOT FREEBSD)
if(UNIX AND NOT APPLE AND NOT FREEBSD AND BUILD_FFMPEG_CUDA_LLVM)
list(APPEND FFMPEG_EXTRA_CONFIGURE
--enable-cuda_llvm
)
Expand Down
Loading