Skip to content

Commit

Permalink
Merge pull request #43 from RazeLighter777/jellyfin
Browse files Browse the repository at this point in the history
Add AV1 decoding support with dav1d
  • Loading branch information
joshuaboniface authored Jul 18, 2020
2 parents 78cf502 + 7a673fc commit be92c28
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ ENV CFLAGS="-I${TARGET_DIR}/include $CFLAGS"

# Prepare Debian build environment
RUN apt-get update \
&& yes | apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv equivs git cmake pkg-config subversion dh-autoreconf libdrm-dev libpciaccess-dev
&& yes | apt-get install -y apt-transport-https ninja-build debhelper gnupg wget devscripts mmv equivs git nasm cmake pkg-config subversion dh-autoreconf libdrm-dev libpciaccess-dev python3-pip

#Install meson
RUN pip3 install meson
# Link to docker-build script
RUN ln -sf ${SOURCE_DIR}/docker-build.sh /docker-build.sh

Expand Down
4 changes: 4 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ CONFIG_x86 := --arch=amd64 \
--enable-nvenc \
--enable-nvdec \
--enable-vaapi \
--enable-libdav1d
# --enable-libmfx # uncomment for non-free QSV

HOST_ARCH := $(shell arch)
Expand All @@ -85,6 +86,9 @@ override_dh_gencontrol:
override_dh_auto_configure:
./configure $(CONFIG)

override_dh_shlibdeps:
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info

override_dh_auto_clean:
dh_auto_clean || true

Expand Down
24 changes: 24 additions & 0 deletions docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,30 @@ prepare_hwa_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 setup AMD AMF headers
# https://www.ffmpeg.org/general.html#AMD-AMF_002fVCE
svn checkout https://github.com/GPUOpen-LibrariesAndSDKs/AMF/trunk/amf/public/include
Expand Down
18 changes: 18 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,32 @@ RUN buildDeps="autoconf \
libtool \
make \
nasm \
ninja-build \
perl \
pkg-config \
python \
python3-setuptools \
python3-pip \
libgnutls28-dev \
yasm \
libva-dev \
zlib1g-dev" && \
apt-get -yqq update && \
apt-get install -yq --no-install-recommends ${buildDeps}
## dav1d https://code.videolan.org/videolan/dav1d
RUN \
pip3 install meson && \
DIR=/tmp/dav1d && \
mkdir -p ${DIR} && \
cd ${DIR} && \
git clone --depth=1 https://code.videolan.org/videolan/dav1d.git && \
cd dav1d && \
mkdir build && \
cd build && \
meson -Denable_asm=true -Denable_avx512=false -Ddefault_library=shared --prefix=${PREFIX} .. && \
ninja && \
meson install

## opencore-amr https://sourceforge.net/projects/opencore-amr/
RUN \
DIR=/tmp/opencore-amr && \
Expand Down Expand Up @@ -373,6 +390,7 @@ RUN \
--enable-postproc \
--enable-version3 \
--enable-rpath \
--enable-libdav1d \
--extra-cflags="-I${PREFIX}/include" \
--extra-ldflags="-L${PREFIX}/lib" \
--extra-libs=-ldl \
Expand Down

0 comments on commit be92c28

Please sign in to comment.