Skip to content

Commit

Permalink
Build fixes and enable Tonemap related filters
Browse files Browse the repository at this point in the history
  • Loading branch information
nyanmisaka committed Jul 15, 2020
1 parent 0fe9935 commit a8514f3
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 114 deletions.
6 changes: 5 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@ Build-Depends:
libx265-dev,
# --enable-libzvbi
libzvbi-dev,
# --enable-cuda-llvm
clang [!armhf !arm64],
# --enable-opencl
ocl-icd-opencl-dev [!armhf !arm64],
# --enable-omx
libomxil-bellagio-dev,
# libomxil-bellagio-dev
# omx headers are fully included in raspberrypi/firmware.
# libomxil-bellagio-dev is missing some functions required in ffmpeg 4.3+.
# Drop this package when building ffmpeg 4.3+.
Expand Down
100 changes: 0 additions & 100 deletions debian/patches/0002-Update-AMF-files-to-support-Linux.patch

This file was deleted.

1 change: 0 additions & 1 deletion debian/patches/series
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
0001_fix-segment-muxer.patch
0002-Update-AMF-files-to-support-Linux.patch
8 changes: 7 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,16 @@ CONFIG_ARM64 := ${CONFIG_ARM_COMMON} \
--cross-prefix=/usr/bin/aarch64-linux-gnu- \

CONFIG_x86 := --arch=amd64 \
--enable-libzimg \
--enable-opencl \
--enable-vaapi \
--enable-amf \
--enable-cuda \
--enable-cuda-llvm \
--enable-cuvid \
--enable-nvenc \
--enable-nvdec \
--enable-vaapi \
--enable-ffnvcodec \
# --enable-libmfx # uncomment for non-free QSV

HOST_ARCH := $(shell arch)
Expand Down
42 changes: 31 additions & 11 deletions docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,22 @@ set -o xtrace
ARCHIVE_ADDR=http://archive.ubuntu.com/ubuntu/
PORTS_ADDR=http://ports.ubuntu.com/

# Prepare HWA headers, libs and drivers for x86_64-linux-gnu
prepare_hwa_amd64() {
# Prepare extra headers, libs and drivers for x86_64-linux-gnu
prepare_extra_amd64() {
# Download and install zimg for zscale filter
pushd ${SOURCE_DIR}
git clone --depth=1 https://github.com/sekrit-twc/zimg
pushd zimg
./autogen.sh
./configure --prefix=${TARGET_DIR}
make -j $(nproc) && make install && make install DESTDIR=${SOURCE_DIR}/zimg
echo "zimg${TARGET_DIR}/lib/libzimg.so* usr/lib/jellyfin-ffmpeg/lib" >> ${SOURCE_DIR}/debian/jellyfin-ffmpeg.install
popd
popd

# Download and install the nvidia headers
pushd ${SOURCE_DIR}
git clone --depth=1 https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
git clone -b n9.0.18.3 --depth=1 https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
pushd nv-codec-headers
make
make install
Expand All @@ -29,7 +40,7 @@ prepare_hwa_amd64() {

# Download and install libva
pushd ${SOURCE_DIR}
git clone -b v2.6-branch --depth=1 https://github.com/intel/libva
git clone -b v2.7-branch --depth=1 https://github.com/intel/libva
pushd libva
sed -i 's|getenv("LIBVA_DRIVERS_PATH")|"/usr/lib/jellyfin-ffmpeg/lib/dri:/usr/lib/x86_64-linux-gnu/dri:/usr/lib/dri:/usr/local/lib/dri"|g' va/va.c
sed -i 's|getenv("LIBVA_DRIVER_NAME")|NULL|g' va/va.c
Expand Down Expand Up @@ -140,13 +151,13 @@ EOF
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
popd

# Fetch RasPi headers to build MMAL support
# Fetch RasPi headers to build MMAL and OMX-RPI support
pushd ${SOURCE_DIR}
git clone --depth=1 https://github.com/raspberrypi/firmware mmalheaders
git clone --depth=1 https://github.com/raspberrypi/userland piuserland
cp -a mmalheaders/opt/vc/include/* /usr/include/
cp -a mmalheaders/opt/vc/lib/* /usr/lib/
cp -a piuserland/interface/* /usr/include/
svn checkout https://github.com/raspberrypi/firmware/trunk/opt/vc/include rpi/include
svn checkout https://github.com/raspberrypi/firmware/trunk/opt/vc/lib rpi/lib
cp -a rpi/include/* /usr/include
cp -a rpi/include/IL/* /usr/include
cp -a rpi/lib/* /usr/lib
popd
}
prepare_crossbuild_env_arm64() {
Expand Down Expand Up @@ -181,12 +192,21 @@ EOF
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
popd

# Fetch RasPi headers to build MMAL and OMX-RPI support
pushd ${SOURCE_DIR}
svn checkout https://github.com/raspberrypi/firmware/trunk/opt/vc/include rpi/include
svn checkout https://github.com/raspberrypi/firmware/trunk/opt/vc/lib rpi/lib
cp -a rpi/include/* /usr/include
cp -a rpi/include/IL/* /usr/include
cp -a rpi/lib/* /usr/lib
popd
}

# Set the architecture-specific options
case ${ARCH} in
'amd64')
prepare_hwa_amd64
prepare_extra_amd64
CONFIG_SITE=""
DEP_ARCH_OPT=""
BUILD_ARCH_OPT=""
Expand Down

0 comments on commit a8514f3

Please sign in to comment.