Skip to content
Merged
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
5e62871
macOS arm64 attempt x264
brad-richardson Dec 12, 2022
47f110a
Darwin host
brad-richardson Dec 12, 2022
70cc494
CC for ffmpeg
brad-richardson Dec 12, 2022
85f7c9e
Cflags, specify cpu
brad-richardson Dec 19, 2022
cfcd7b7
Attempt x265, fix ffmpeg
brad-richardson Dec 19, 2022
bfe2300
Cmake osx architectures, cmake flags
brad-richardson Dec 19, 2022
f40870e
Fix ffmpeg
brad-richardson Dec 19, 2022
6e87008
Cleanup x265
brad-richardson Dec 19, 2022
9ae850b
cflags mcpu
brad-richardson Dec 19, 2022
51db584
Actually run x265
brad-richardson Dec 19, 2022
92925ab
aarch64 cmake processor
brad-richardson Dec 19, 2022
7be3cf0
Re-enable x265 on ffmpeg
brad-richardson Dec 19, 2022
e121034
Undo dependency split
brad-richardson Dec 19, 2022
4adf3d5
Back to automake
brad-richardson Dec 19, 2022
b48d8dd
Fix if indents
brad-richardson Dec 19, 2022
abe426a
Move c flags to configure params
brad-richardson Dec 19, 2022
9749359
Try without mcpu flag
brad-richardson Dec 19, 2022
6318bb0
Compiler target flags
brad-richardson Dec 19, 2022
5754166
Unix makefile, explicit cmake system processor
brad-richardson Dec 19, 2022
24f580a
arm64 cmake osx arch
brad-richardson Dec 19, 2022
c39939b
Disable assembly
brad-richardson Dec 19, 2022
036dbd9
Match moonlight compile arch args
brad-richardson Dec 19, 2022
52d016f
Group log cleanup
brad-richardson Dec 19, 2022
c2df6b8
Unquote clang
brad-richardson Dec 19, 2022
2d579a6
Inline target/arch, change group
brad-richardson Dec 19, 2022
e508bf0
Match ffmpeg-kit cflags
brad-richardson Dec 19, 2022
e82f75a
ffmpeg cxx flags
brad-richardson Dec 19, 2022
fff8079
clang++
brad-richardson Dec 19, 2022
9bba04f
clang++ again, cleanup, echo commands
brad-richardson Dec 20, 2022
acda5ce
Use env to configure flags
brad-richardson Dec 20, 2022
72183fb
Remove quotes
brad-richardson Dec 20, 2022
b9ab0f0
More explicit flags
brad-richardson Dec 20, 2022
22ce8e0
Gas preprocessor
brad-richardson Dec 20, 2022
e6485b7
Disable neon test
brad-richardson Dec 20, 2022
87076c6
Explicit ar/as
brad-richardson Dec 20, 2022
5bd3774
Remove as, unused while skipping neon
brad-richardson Dec 20, 2022
e13d23d
Remove cross prefix again
brad-richardson Dec 20, 2022
b2ebeb5
Re-enable neon, add preprocessor to x264
brad-richardson Dec 20, 2022
088ed38
Armv8 cpu
brad-richardson Dec 20, 2022
9a78f52
Armv8 cpu with arch
brad-richardson Dec 20, 2022
cd52510
Shared cflags, cleanup
brad-richardson Dec 20, 2022
00ddd48
Fix matrix check, cleanup
brad-richardson Dec 20, 2022
bfaacdc
Expand cflags before export
brad-richardson Dec 20, 2022
954a29e
Quotes around cflags
brad-richardson Dec 20, 2022
07fb93b
Reverts to fix ffmpeg
brad-richardson Dec 20, 2022
cd62595
One more time
brad-richardson Dec 20, 2022
8cde93d
Update build-ffmpeg.yml
brad-richardson Dec 20, 2022
aa3204d
Update build-ffmpeg.yml
brad-richardson Dec 20, 2022
3aa78c8
Update build-ffmpeg.yml
brad-richardson Dec 20, 2022
74fd2e4
Cleanup
brad-richardson Dec 20, 2022
9e395af
Fix indentation
brad-richardson Dec 20, 2022
55adfcf
Heredoc initial space
brad-richardson Dec 20, 2022
124df1b
Unindent closing heredoc delimiter
brad-richardson Dec 20, 2022
6c6084e
Remove linebreak at end of heredoc
brad-richardson Dec 20, 2022
eee49ec
Remove linebreak from remaining heredocs
brad-richardson Dec 20, 2022
b3187a0
Fix indent
brad-richardson Dec 20, 2022
57ea6a0
Unindent closing delimiter
brad-richardson Dec 20, 2022
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
145 changes: 97 additions & 48 deletions .github/workflows/build-ffmpeg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ jobs:
ffmpeg_extras: >-
--enable-encoder=h264_videotoolbox,hevc_videotoolbox
--enable-videotoolbox
- os_type: macos
os: macos-12
arch: aarch64
shell: bash
cmake_generator: Unix Makefiles # should be `Xcode` but that fails
host: arm64-apple-macosx
ffmpeg_extras: >-
--enable-encoder=h264_videotoolbox,hevc_videotoolbox
--enable-videotoolbox
- os_type: windows
os: windows-2022
arch: x86_64
Expand Down Expand Up @@ -97,7 +106,7 @@ jobs:
- name: Setup Dependencies Unix
if: ${{ matrix.os_type != 'windows' }}
run: |
echo "::group::${{ matrix.os_type }} dependencies"
echo "::group::dependencies prep"
if [[ ${{ matrix.os }} == "ubuntu-18.04" ]]; then
dist="bionic"
elif [[ ${{ matrix.os }} == "ubuntu-20.04" ]]; then
Expand All @@ -112,32 +121,34 @@ jobs:
fi

mirror="http://ports.ubuntu.com/ubuntu-ports"
extra_sources=$(cat <<VAREOF
deb [arch=$package_arch] $mirror $dist main restricted
deb [arch=$package_arch] $mirror $dist-updates main restricted
deb [arch=$package_arch] $mirror $dist universe
deb [arch=$package_arch] $mirror $dist-updates universe
deb [arch=$package_arch] $mirror $dist multiverse
deb [arch=$package_arch] $mirror $dist-updates multiverse
deb [arch=$package_arch] $mirror $dist-backports main restricted universe multiverse
deb [arch=$package_arch] $mirror $dist-security main restricted
deb [arch=$package_arch] $mirror $dist-security universe
deb [arch=$package_arch] $mirror $dist-security multiverse
extra_sources=$(cat <<- VAREOF
deb [arch=$package_arch] $mirror $dist main restricted
deb [arch=$package_arch] $mirror $dist-updates main restricted
deb [arch=$package_arch] $mirror $dist universe
deb [arch=$package_arch] $mirror $dist-updates universe
deb [arch=$package_arch] $mirror $dist multiverse
deb [arch=$package_arch] $mirror $dist-updates multiverse
deb [arch=$package_arch] $mirror $dist-backports main restricted universe multiverse
deb [arch=$package_arch] $mirror $dist-security main restricted
deb [arch=$package_arch] $mirror $dist-security universe
deb [arch=$package_arch] $mirror $dist-security multiverse
VAREOF
)
echo "::endgroup::"

if [[ $package_arch != "amd64" ]]; then
# fix original sources
sudo sed -i -e "s#deb http#deb [arch=amd64] http#g" /etc/apt/sources.list
if [[ ${{ matrix.os_type }} == "linux" ]]; then
echo "::group::linux dependencies"
if [[ $package_arch != "amd64" ]]; then
# fix original sources
sudo sed -i -e "s#deb http#deb [arch=amd64] http#g" /etc/apt/sources.list

sudo dpkg --add-architecture $package_arch
sudo dpkg --add-architecture $package_arch

echo "$extra_sources" | sudo tee -a /etc/apt/sources.list
echo "----"
sudo cat /etc/apt/sources.list
fi
echo "$extra_sources" | sudo tee -a /etc/apt/sources.list
echo "----"
sudo cat /etc/apt/sources.list
fi

if [[ ${{ matrix.os_type }} == "linux" ]]; then
sudo apt-get update -qq && sudo apt-get -y install \
autoconf \
automake \
Expand Down Expand Up @@ -166,7 +177,16 @@ jobs:
wget \
yasm \
zlib1g-dev

if [[ ${{ matrix.arch }} == "aarch64" ]]; then
sudo apt-get -y install \
binutils-${{ matrix.host }} \
g++-${{ matrix.host }} \
gcc-${{ matrix.host }}
fi
echo "::endgroup::"
elif [[ ${{ matrix.os_type }} == "macos" ]]; then
echo "::group::macos dependencies"
brew install \
automake \
fdk-aac \
Expand All @@ -185,15 +205,6 @@ jobs:
wget \
yasm \
xvid
fi
echo "::endgroup::"

if [[ ${{ matrix.os_type }} == "linux" && ${{ matrix.arch }} == "aarch64" ]]; then
echo "::group::${{ matrix.os_type }}-${{ matrix.arch }} dependencies"
sudo apt-get -y install \
binutils-${{ matrix.host }} \
g++-${{ matrix.host }} \
gcc-${{ matrix.host }}
echo "::endgroup::"
fi

Expand Down Expand Up @@ -234,7 +245,11 @@ jobs:
id: cross
if: ${{ matrix.arch == 'aarch64' }}
run: |
echo "CCPREFIX=/usr/bin/${{ matrix.host }}-" >> $GITHUB_OUTPUT
if [[ ${{ matrix.os_type }} == 'linux' ]]; then
echo "CCPREFIX=/usr/bin/${{ matrix.host }}-" >> $GITHUB_OUTPUT
else
echo "CFLAGS=-arch arm64 -target ${{ matrix.host }} -march=armv8-a -mcpu=generic" >> $GITHUB_OUTPUT
fi

- name: amf
if: ${{ matrix.os_type != 'macos' }}
Expand All @@ -254,13 +269,20 @@ jobs:
echo "::endgroup::"

echo "::group::configure extra flags for cross compilation"
extra_configure=$(cat <<VAREOF
--host=${{ matrix.arch }}-${{ matrix.os_type }}
--cross-prefix=${CCPREFIX}
extra_configure=""
if [[ ${{ matrix.os_type }} == "linux" && ${{ matrix.arch }} == "aarch64" ]]; then
extra_configure=$(cat <<- VAREOF
--host=${{ matrix.arch }}-${{ matrix.os_type }}
--cross-prefix=${CCPREFIX}
VAREOF
)
elif [[ ${{ matrix.os_type }} == "macos" && ${{ matrix.arch }} == "aarch64" ]]; then
export CC="clang"
export CFLAGS="${{ steps.cross.outputs.CFLAGS }}"
extra_configure=$(cat <<- VAREOF
--host=${{ matrix.arch }}-darwin
VAREOF
)
if [[ ${{ matrix.arch }} != "aarch64" ]]; then
extra_configure=""
fi
echo "$extra_configure"
echo "::endgroup::"
Expand Down Expand Up @@ -291,11 +313,25 @@ jobs:
working-directory: ffmpeg_sources/x265_git
run: |
echo "::group::configure extra flags for cross compilation"
extra_configure="-DCMAKE_TOOLCHAIN_FILE=build/${{ matrix.arch }}-${{ matrix.os_type }}/crosscompile.cmake"

if [[ ${{ matrix.arch }} != "aarch64" ]]; then
# not currently supported in `aarch64`
extra_configure="-DENABLE_HDR10_PLUS=1"
# not currently supported in `aarch64`
extra_configure="-DENABLE_HDR10_PLUS=1"
if [[ ${{ matrix.os_type }} == "linux" && ${{ matrix.arch }} == "aarch64" ]]; then
extra_configure="-DCMAKE_TOOLCHAIN_FILE=build/${{ matrix.arch }}-${{ matrix.os_type }}/crosscompile.cmake"
elif [[ ${{ matrix.os_type }} == "macos" && ${{ matrix.arch }} == "aarch64" ]]; then
export CFLAGS="${{ steps.cross.outputs.CFLAGS }}"
export CXXFLAGS="-std=c++11 ${CFLAGS}"
extra_configure=$(cat <<- VAREOF
-DCROSS_COMPILE_ARM64=ON
-DENABLE_ASSEMBLY=0
-DCMAKE_SYSTEM_PROCESSOR=arm64
-DCMAKE_OSX_ARCHITECTURES=arm64
-DCMAKE_C_COMPILER=clang
-DCMAKE_C_COMPILER_TARGET=${{ matrix.host }}
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_CXX_COMPILER_TARGET=${{ matrix.host }}
VAREOF
)
fi
echo "$extra_configure"
echo "::endgroup::"
Expand Down Expand Up @@ -342,23 +378,36 @@ jobs:
env:
nvenc_path: ${{ steps.nvenc.outputs.nvenc_path }}
root_path: ${{ steps.root.outputs.root_path }}
CCPREFIX: ${{ steps.cross.outputs.CCPREFIX }}
working-directory: ffmpeg_sources/ffmpeg
run: |
echo "::group::configure options"
./configure --help || true # this command has a non zero exit status, but we should continue anyway
echo "::endgroup::"

echo "::group::configure extra flags for cross compilation"
extra_configure=$(cat <<VAREOF
--arch=${{ matrix.arch }}
--cross-prefix=${CCPREFIX}
--enable-cross-compile
--target-os=${{ matrix.os_type }}
extra_configure=""
if [[ ${{ matrix.os_type }} == "linux" && ${{ matrix.arch }} == "aarch64" ]]; then
CCPREFIX=${{ steps.cross.outputs.CCPREFIX }}
extra_configure=$(cat <<- VAREOF
--arch=${{ matrix.arch }}
--cross-prefix=${CCPREFIX}
--enable-cross-compile
--target-os=${{ matrix.os_type }}
VAREOF
)
elif [[ ${{ matrix.os_type }} == "macos" && ${{ matrix.arch }} == "aarch64" ]]; then
export CFLAGS="${{ steps.cross.outputs.CFLAGS }}"
export CXXFLAGS="-std=c++11 ${CFLAGS}"
export LDFLAGS="-arch arm64 -march=armv8-a+crc+crypto -target ${{ matrix.host }} -lc++"
extra_configure=$(cat <<- VAREOF
--arch=${{ matrix.arch }}
--cc=clang
--cxx=clang++
--target-os=darwin
--enable-cross-compile
--disable-neon
VAREOF
)
if [[ ${{ matrix.arch }} != "aarch64" ]]; then
extra_configure=""
fi
echo "$extra_configure"
echo "::endgroup::"
Expand Down