Skip to content

Commit 0a0a88f

Browse files
committed
- add AMF
- Update nasm, cmake,nv-codec
1 parent 797a306 commit 0a0a88f

File tree

4 files changed

+48
-35
lines changed

4 files changed

+48
-35
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM ubuntu:20.04 AS build
22

33
RUN apt-get update \
4-
&& apt-get -y --no-install-recommends install build-essential curl ca-certificates libz-dev \
4+
&& apt-get -y --no-install-recommends install build-essential curl ca-certificates \
55
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* \
66
&& update-ca-certificates
77

build-ffmpeg

Lines changed: 45 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ if build "yasm"; then
236236
fi
237237

238238
if build "nasm"; then
239-
download "https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.gz"
239+
download "https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.xz"
240240
execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static
241241
execute make -j $MJOBS
242242
execute make install
@@ -251,12 +251,27 @@ if build "pkg-config"; then
251251
build_done "pkg-config"
252252
fi
253253

254+
if build "zlib"; then
255+
download "https://www.zlib.net/zlib-1.2.11.tar.gz"
256+
execute ./configure --static --prefix="${WORKSPACE}"
257+
execute make -j $MJOBS
258+
execute make install
259+
build_done "zlib"
260+
fi
261+
262+
if build "openssl"; then
263+
download "https://www.openssl.org/source/openssl-1.1.1h.tar.gz"
264+
execute ./config --prefix="${WORKSPACE}" --openssldir="${WORKSPACE}" --with-zlib-include="${WORKSPACE}"/include/ --with-zlib-lib="${WORKSPACE}"/lib no-shared zlib
265+
execute make -j $MJOBS
266+
execute make install
267+
268+
build_done "openssl"
269+
fi
270+
CONFIGURE_OPTIONS+=("--enable-openssl")
271+
254272
if build "cmake"; then
255-
download "https://cmake.org/files/v3.15/cmake-3.15.4.tar.gz"
256-
rm Modules/FindJava.cmake
257-
perl -p -i -e "s/get_filename_component.JNIPATH/#get_filename_component(JNIPATH/g" Tests/CMakeLists.txt
258-
perl -p -i -e "s/get_filename_component.JNIPATH/#get_filename_component(JNIPATH/g" Tests/CMakeLists.txt
259-
execute ./configure --prefix="${WORKSPACE}"
273+
download "https://cmake.org/files/v3.18/cmake-3.18.4.tar.gz"
274+
execute ./configure --prefix="${WORKSPACE}" --system-zlib
260275
execute make -j $MJOBS
261276
execute make install
262277
build_done "cmake"
@@ -286,11 +301,15 @@ CONFIGURE_OPTIONS+=("--enable-libx264")
286301

287302
if build "x265"; then
288303
download "https://github.com/videolan/x265/archive/Release_3.5.tar.gz" "x265-3.5.tar.gz"
289-
cd source || exit
290-
execute cmake -DCMAKE_INSTALL_PREFIX:PATH="${WORKSPACE}" -DENABLE_SHARED:bool=off -DSTATIC_LINK_CRT:BOOL=ON -DENABLE_CLI:BOOL=OFF .
304+
cd build/linux || exit
305+
execute cmake -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DENABLE_SHARED=off -DSTATIC_LINK_CRT=ON ../../source
291306
execute make -j $MJOBS
292307
execute make install
293-
sed -i.backup 's/-lgcc_s/-lgcc_eh/g' "$WORKSPACE/lib/pkgconfig/x265.pc" #The -i.backup is intended and required on MacOS: https://stackoverflow.com/questions/5694228/sed-in-place-flag-that-works-both-on-mac-bsd-and-linux
308+
309+
if [ -n $LDEXEFLAGS ]; then
310+
sed -i.backup 's/-lgcc_s/-lgcc_eh/g' "${WORKSPACE}/lib/pkgconfig/x265.pc" # The -i.backup is intended and required on MacOS: https://stackoverflow.com/questions/5694228/sed-in-place-flag-that-works-both-on-mac-bsd-and-linux
311+
fi
312+
294313
build_done "x265"
295314
fi
296315
CONFIGURE_OPTIONS+=("--enable-libx265")
@@ -435,60 +454,54 @@ CONFIGURE_OPTIONS+=("--enable-libfdk-aac")
435454
## other library
436455
##
437456

438-
if build "zlib"; then
439-
download "https://www.zlib.net/zlib-1.2.11.tar.gz"
440-
execute ./configure --static --prefix="${WORKSPACE}"
441-
execute make -j $MJOBS
442-
execute make install
443-
build_done "zlib"
444-
fi
445-
446-
if build "openssl"; then
447-
download "https://www.openssl.org/source/openssl-1.1.1h.tar.gz"
448-
execute ./config --prefix="${WORKSPACE}" --openssldir="${WORKSPACE}" --with-zlib-include="${WORKSPACE}"/include/ --with-zlib-lib="${WORKSPACE}"/lib no-shared zlib
449-
execute make -j $MJOBS
450-
execute make install
451-
452-
build_done "openssl"
453-
fi
454-
CONFIGURE_OPTIONS+=("--enable-openssl")
455-
456457
if build "srt"; then
457458
download "https://github.com/Haivision/srt/archive/v1.4.1.tar.gz" "srt-1.4.1.tar.gz"
458459
export OPENSSL_ROOT_DIR="${WORKSPACE}"
459460
export OPENSSL_LIB_DIR="${WORKSPACE}"/lib
460461
export OPENSSL_INCLUDE_DIR="${WORKSPACE}"/include/
461462
execute cmake . -DCMAKE_INSTALL_PREFIX:PATH="${WORKSPACE}" -DENABLE_SHARED=OFF -DENABLE_STATIC=ON -DENABLE_APPS=OFF -DUSE_STATIC_LIBSTDCXX=ON
462463
execute make install
463-
sed -i.backup 's/-lgcc_s/-lgcc_eh/g' "$WORKSPACE/lib/pkgconfig/srt.pc" #The -i.backup is intended and required on MacOS: https://stackoverflow.com/questions/5694228/sed-in-place-flag-that-works-both-on-mac-bsd-and-linux
464+
465+
if [ -n $LDEXEFLAGS ]; then
466+
sed -i.backup 's/-lgcc_s/-lgcc_eh/g' "$WORKSPACE/lib/pkgconfig/srt.pc" # The -i.backup is intended and required on MacOS: https://stackoverflow.com/questions/5694228/sed-in-place-flag-that-works-both-on-mac-bsd-and-linux
467+
fi
464468

465469
build_done "srt"
466470
fi
467471
CONFIGURE_OPTIONS+=("--enable-libsrt")
468472

473+
469474
##
470475
## HWaccel library
471476
##
472477

473478
if command -v nvcc > /dev/null ; then
474479
if build "nv-codec"; then
475-
download "https://github.com/FFmpeg/nv-codec-headers/releases/download/n10.0.26.0/nv-codec-headers-10.0.26.0.tar.gz"
476-
sed -i.backup "s#PREFIX = /usr/local#PREFIX = ${WORKSPACE}#g" Makefile #The -i.backup is intended and required on MacOS: https://stackoverflow.com/questions/5694228/sed-in-place-flag-that-works-both-on-mac-bsd-and-linux
477-
execute make install
480+
download "https://github.com/FFmpeg/nv-codec-headers/releases/download/n11.0.10.0/nv-codec-headers-11.0.10.0.tar.gz"
481+
execute make PREFIX="${WORKSPACE}"
482+
execute make install PREFIX="${WORKSPACE}"
478483
build_done "nv-codec"
479484
fi
480485
CFLAGS+=" -I/usr/local/cuda/include"
481486
LDFLAGS+=" -L/usr/local/cuda/lib64"
482487
CONFIGURE_OPTIONS+=("--enable-cuda-nvcc" "--enable-cuvid" "--enable-nvenc" "--enable-cuda-llvm")
483488

484489
if [ -z $LDEXEFLAGS ]; then
485-
CONFIGURE_OPTIONS+=("--enable-libnpp") # Only libnpp cannot be static link.
490+
CONFIGURE_OPTIONS+=("--enable-libnpp") # Only libnpp cannot be statically linked.
486491
fi
487492

488493
# https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/
489494
CONFIGURE_OPTIONS+=("--nvccflags=-gencode arch=compute_52,code=sm_52")
490495
fi
491496

497+
if build "amf"; then
498+
download "https://github.com/GPUOpen-LibrariesAndSDKs/AMF/archive/1.4.16.1.tar.gz" "amf-1.4.16.1.tar.gz"
499+
execute mkdir -p ${WORKSPACE}/include/AMF
500+
execute cp -r amf/public/include/* ${WORKSPACE}/include/AMF/
501+
build_done "amf"
502+
fi
503+
CONFIGURE_OPTIONS+=("--enable-amf")
504+
492505

493506
##
494507
## FFmpeg

cuda-ubuntu.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM nvidia/cuda:11.1-devel-ubuntu20.04 AS build
33
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility,video
44

55
RUN apt-get update \
6-
&& apt-get -y --no-install-recommends install build-essential curl ca-certificates libz-dev \
6+
&& apt-get -y --no-install-recommends install build-essential curl ca-certificates \
77
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* \
88
&& update-ca-certificates
99

full-static.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM nvidia/cuda:11.1-devel-ubuntu20.04 AS build
33
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility,video
44

55
RUN apt-get update \
6-
&& apt-get -y --no-install-recommends install build-essential curl ca-certificates libz-dev \
6+
&& apt-get -y --no-install-recommends install build-essential curl ca-certificates \
77
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* \
88
&& update-ca-certificates
99

0 commit comments

Comments
 (0)