mirror of
https://github.com/jellyfin/jellyfin-ffmpeg.git
synced 2025-04-18 20:24:05 +03:00
Add dav1d AV1 support for armhf and arm64
This commit is contained in:
parent
22c65922e9
commit
776d5221e7
4
build
4
build
@ -29,11 +29,11 @@ case ${cli_release} in
|
||||
;;
|
||||
'buster')
|
||||
release="debian:buster"
|
||||
gcc_version="7"
|
||||
gcc_version="8"
|
||||
;;
|
||||
'bullseye')
|
||||
release="debian:bullseye"
|
||||
gcc_version="8"
|
||||
gcc_version="9"
|
||||
;;
|
||||
'xenial')
|
||||
release="ubuntu:xenial"
|
||||
|
13
cross-arm64.meson
Normal file
13
cross-arm64.meson
Normal file
@ -0,0 +1,13 @@
|
||||
[binaries]
|
||||
c = '/usr/bin/aarch64-linux-gnu-gcc'
|
||||
cpp = '/usr/bin/aarch64-linux-gnu-g++'
|
||||
ar = '/usr/bin/aarch64-linux-gnu-gcc-ar'
|
||||
strip = '/usr/bin/aarch64-linux-gnu-strip'
|
||||
pkgconfig = 'pkg-config'
|
||||
|
||||
[host_machine]
|
||||
system = 'linux'
|
||||
cpu_family = 'aarch64'
|
||||
cpu = 'aarch64'
|
||||
endian = 'little'
|
||||
|
13
cross-armhf.meson
Normal file
13
cross-armhf.meson
Normal file
@ -0,0 +1,13 @@
|
||||
[binaries]
|
||||
c = '/usr/bin/arm-linux-gnueabihf-gcc'
|
||||
cpp = '/usr/bin/arm-linux-gnueabihf-g++'
|
||||
ar = '/usr/bin/arm-linux-gnueabihf-gcc-ar'
|
||||
strip = '/usr/bin/arm-linux-gnueabihf-strip'
|
||||
pkgconfig = 'pkg-config'
|
||||
|
||||
[host_machine]
|
||||
system = 'linux'
|
||||
cpu_family = 'arm'
|
||||
cpu = 'armv7'
|
||||
endian = 'little'
|
||||
|
2
debian/rules
vendored
2
debian/rules
vendored
@ -34,6 +34,7 @@ CONFIG := --prefix=${TARGET_DIR} \
|
||||
--enable-libopus \
|
||||
--enable-libtheora \
|
||||
--enable-libvorbis \
|
||||
--enable-libdav1d \
|
||||
--enable-libwebp \
|
||||
--enable-libvpx \
|
||||
--enable-libx264 \
|
||||
@ -56,7 +57,6 @@ CONFIG_ARM64 := ${CONFIG_ARM_COMMON} \
|
||||
|
||||
CONFIG_x86 := --arch=amd64 \
|
||||
--enable-libzimg \
|
||||
--enable-libdav1d \
|
||||
--enable-opencl \
|
||||
--enable-vaapi \
|
||||
--enable-amf \
|
||||
|
@ -8,6 +8,47 @@ set -o xtrace
|
||||
ARCHIVE_ADDR=http://archive.ubuntu.com/ubuntu/
|
||||
PORTS_ADDR=http://ports.ubuntu.com/
|
||||
|
||||
# Prepare common extra libs for amd64, armhf and arm64
|
||||
prepare_extra_common() {
|
||||
# Download and install dav1d
|
||||
pushd ${SOURCE_DIR}
|
||||
git clone --depth=1 https://code.videolan.org/videolan/dav1d.git
|
||||
pushd dav1d
|
||||
mkdir build
|
||||
pushd build
|
||||
nasmver="$(nasm -v | cut -d ' ' -f3)"
|
||||
nasmavx512ver="2.14.0"
|
||||
if [ "$(printf '%s\n' "$nasmavx512ver" "$nasmver" | sort -V | head -n1)" = "$nasmavx512ver" ]; then
|
||||
avx512=true
|
||||
else
|
||||
avx512=false
|
||||
fi
|
||||
if [ "${ARCH}" = "amd64" ]; then
|
||||
meson -Denable_asm=true \
|
||||
-Denable_avx512=$avx512 \
|
||||
-Ddefault_library=shared \
|
||||
--prefix=${TARGET_DIR} ..
|
||||
ninja
|
||||
meson install
|
||||
cp ${TARGET_DIR}/lib/x86_64-linux-gnu/pkgconfig/dav1d.pc /usr/lib/pkgconfig
|
||||
cp ${TARGET_DIR}/lib/x86_64-linux-gnu/*dav1d* ${SOURCE_DIR}/dav1d
|
||||
else
|
||||
meson -Denable_asm=true \
|
||||
-Denable_avx512=false \
|
||||
-Ddefault_library=shared \
|
||||
--cross-file=${SOURCE_DIR}/cross-${ARCH}.meson \
|
||||
--prefix=${TARGET_DIR} ..
|
||||
ninja
|
||||
meson install
|
||||
cp ${TARGET_DIR}/lib/pkgconfig/dav1d.pc /usr/lib/pkgconfig
|
||||
cp ${TARGET_DIR}/lib/*dav1d* ${SOURCE_DIR}/dav1d
|
||||
fi
|
||||
echo "dav1d/*dav1d* /usr/lib/jellyfin-ffmpeg/lib" >> ${SOURCE_DIR}/debian/jellyfin-ffmpeg.install
|
||||
popd
|
||||
popd
|
||||
popd
|
||||
}
|
||||
|
||||
# Prepare extra headers, libs and drivers for x86_64-linux-gnu
|
||||
prepare_extra_amd64() {
|
||||
# Download and install zimg for zscale filter
|
||||
@ -21,29 +62,6 @@ prepare_extra_amd64() {
|
||||
popd
|
||||
popd
|
||||
|
||||
# Download and install dav1d
|
||||
pushd ${SOURCE_DIR}
|
||||
git clone --depth=1 https://code.videolan.org/videolan/dav1d.git && \
|
||||
pushd dav1d
|
||||
mkdir build
|
||||
pushd build
|
||||
nasmver="$(nasm -v | cut -d ' ' -f3)"
|
||||
nasmavx512ver="2.14.0"
|
||||
if [ "$(printf '%s\n' "$nasmavx512ver" "$nasmver" | sort -V | head -n1)" = "$nasmavx512ver" ]; then
|
||||
avx512=true
|
||||
else
|
||||
avx512=false
|
||||
fi
|
||||
meson -Denable_asm=true -Denable_avx512=$avx512 -Ddefault_library=shared --prefix=${TARGET_DIR} ..
|
||||
ninja
|
||||
meson install
|
||||
cp ${TARGET_DIR}/lib/x86_64-linux-gnu/pkgconfig/dav1d.pc /usr/lib/pkgconfig/
|
||||
cp ${TARGET_DIR}/lib/x86_64-linux-gnu/*dav1d* ${SOURCE_DIR}/dav1d
|
||||
echo "dav1d/*dav1d* /usr/lib/jellyfin-ffmpeg/lib" >> ${SOURCE_DIR}/debian/jellyfin-ffmpeg.install
|
||||
popd
|
||||
popd
|
||||
popd
|
||||
|
||||
# Download and install the nvidia headers
|
||||
pushd ${SOURCE_DIR}
|
||||
git clone -b n9.0.18.3 --depth=1 https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
|
||||
@ -169,7 +187,7 @@ EOF
|
||||
# Install dependencies
|
||||
pushd cross-gcc-packages-amd64/cross-gcc-${GCC_VER}-armhf
|
||||
ln -fs /usr/share/zoneinfo/America/Toronto /etc/localtime
|
||||
yes | apt-get install -y -o APT::Immediate-Configure=0 gcc-${GCC_VER}-source libstdc++6-armhf-cross binutils-arm-linux-gnueabihf bison flex libtool gdb sharutils netbase libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip libc6-dev:armhf linux-libc-dev:armhf libgcc1:armhf libcurl4-openssl-dev:armhf libfontconfig1-dev:armhf libfreetype6-dev:armhf liblttng-ust0:armhf libstdc++6:armhf
|
||||
yes | apt-get install -y -o APT::Immediate-Configure=0 gcc-${GCC_VER}-source gcc-${GCC_VER}-arm-linux-gnueabihf g++-${GCC_VER}-arm-linux-gnueabihf libstdc++6-armhf-cross binutils-arm-linux-gnueabihf bison flex libtool gdb sharutils netbase libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip libc6-dev:armhf linux-libc-dev:armhf libgcc1:armhf libcurl4-openssl-dev:armhf libfontconfig1-dev:armhf libfreetype6-dev:armhf liblttng-ust0:armhf libstdc++6:armhf
|
||||
popd
|
||||
|
||||
# Fetch RasPi headers to build MMAL and OMX-RPI support
|
||||
@ -211,7 +229,7 @@ EOF
|
||||
# Install dependencies
|
||||
pushd cross-gcc-packages-amd64/cross-gcc-${GCC_VER}-arm64
|
||||
ln -fs /usr/share/zoneinfo/America/Toronto /etc/localtime
|
||||
yes | apt-get install -y -o APT::Immediate-Configure=0 gcc-${GCC_VER}-source libstdc++6-arm64-cross binutils-aarch64-linux-gnu bison flex libtool gdb sharutils netbase libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip libc6-dev:arm64 linux-libc-dev:arm64 libgcc1:arm64 libcurl4-openssl-dev:arm64 libfontconfig1-dev:arm64 libfreetype6-dev:arm64 liblttng-ust0:arm64 libstdc++6:arm64
|
||||
yes | apt-get install -y -o APT::Immediate-Configure=0 gcc-${GCC_VER}-source gcc-${GCC_VER}-aarch64-linux-gnu g++-${GCC_VER}-aarch64-linux-gnu libstdc++6-arm64-cross binutils-aarch64-linux-gnu bison flex libtool gdb sharutils netbase libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip libc6-dev:arm64 linux-libc-dev:arm64 libgcc1:arm64 libcurl4-openssl-dev:arm64 libfontconfig1-dev:arm64 libfreetype6-dev:arm64 liblttng-ust0:arm64 libstdc++6:arm64
|
||||
popd
|
||||
|
||||
# Fetch RasPi headers to build MMAL and OMX-RPI support
|
||||
@ -227,6 +245,7 @@ EOF
|
||||
# Set the architecture-specific options
|
||||
case ${ARCH} in
|
||||
'amd64')
|
||||
prepare_extra_common
|
||||
prepare_extra_amd64
|
||||
CONFIG_SITE=""
|
||||
DEP_ARCH_OPT=""
|
||||
@ -234,14 +253,20 @@ case ${ARCH} in
|
||||
;;
|
||||
'armhf')
|
||||
prepare_crossbuild_env_armhf
|
||||
ln -s /usr/bin/arm-linux-gnueabihf-gcc-6 /usr/bin/arm-linux-gnueabihf-gcc
|
||||
ln -s /usr/bin/arm-linux-gnueabihf-gcc-${GCC_VER} /usr/bin/arm-linux-gnueabihf-gcc
|
||||
ln -s /usr/bin/arm-linux-gnueabihf-gcc-ar-${GCC_VER} /usr/bin/arm-linux-gnueabihf-gcc-ar
|
||||
ln -s /usr/bin/arm-linux-gnueabihf-g++-${GCC_VER} /usr/bin/arm-linux-gnueabihf-g++
|
||||
prepare_extra_common
|
||||
CONFIG_SITE="/etc/dpkg-cross/cross-config.${ARCH}"
|
||||
DEP_ARCH_OPT="--host-arch armhf"
|
||||
BUILD_ARCH_OPT="-aarmhf"
|
||||
;;
|
||||
'arm64')
|
||||
prepare_crossbuild_env_arm64
|
||||
#ln -s /usr/bin/arm-linux-gnueabihf-gcc-6 /usr/bin/arm-linux-gnueabihf-gcc
|
||||
ln -s /usr/bin/aarch64-linux-gnu-gcc-${GCC_VER} /usr/bin/aarch64-linux-gnu-gcc
|
||||
ln -s /usr/bin/aarch64-linux-gnu-gcc-ar-${GCC_VER} /usr/bin/aarch64-linux-gnu-gcc-ar
|
||||
ln -s /usr/bin/aarch64-linux-gnu-g++-${GCC_VER} /usr/bin/aarch64-linux-gnu-g++
|
||||
prepare_extra_common
|
||||
CONFIG_SITE="/etc/dpkg-cross/cross-config.${ARCH}"
|
||||
DEP_ARCH_OPT="--host-arch arm64"
|
||||
BUILD_ARCH_OPT="-aarm64"
|
||||
|
Loading…
x
Reference in New Issue
Block a user