diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8ac9e03c..8cd080da 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -103,30 +103,6 @@ jobs: run: | docker run --rm ffmpeg:cuda-ubuntu -buildconf - build-cuda-rocky-docker: - name: build in Rockylinux docker with cuda - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: pull base image - id: cuda_centos_pull - run: | - docker pull nvidia/cuda:11.6.0-devel-centos8 - docker pull rockylinux:8 - - name: run if cuda_centos_pull failed - if: failure() && steps.cuda_centos_pull.outcome == 'failure' - run: | - docker pull nvidia/cuda:11.6.0-devel-centos8 - docker pull rockylinux:8 - - name: build ffmpeg - run: | - docker build -t ffmpeg:cuda-rocky -f cuda-rocky.dockerfile . - - name: test run ffmepg - run: | - docker run --rm ffmpeg:cuda-rocky -buildconf - build-full-static: name: full static build in docker runs-on: ubuntu-22.04 diff --git a/.gitignore b/.gitignore index 4725dcff..06485f58 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ workspace .idea linux .artifacts +build diff --git a/README.md b/README.md index d783b414..4213c7ee 100644 --- a/README.md +++ b/README.md @@ -150,14 +150,9 @@ $ docker build --tag=ffmpeg:default --output type=local,dest=build -f Dockerfile ##### CUDA These builds are always built with the --enable-gpl-and-non-free switch, as CUDA is non-free. See https://ffmpeg.org/legal.html ```bash -export DOCKER_BUILDKIT=1 - -## Set the DIST (`ubuntu` or `rocky`) and VER (ubuntu: `16.04` , `18.04`, `20.04` or rocky: `8`) environment variables to select the preferred Docker base image. -$ export DIST=centos -$ export VER=8 ## Start the build -$ docker build --tag=ffmpeg:cuda-$DIST -f cuda-$DIST.dockerfile --build-arg VER=$VER . +$ docker build --tag=ffmpeg:cuda-$DIST -f cuda-ubunu.dockerfile --build-arg . ``` Build an `export.dockerfile` that copies only what you need from the image you just built as follows. When running, diff --git a/build-ffmpeg b/build-ffmpeg index c9f8ba13..79c33082 100755 --- a/build-ffmpeg +++ b/build-ffmpeg @@ -4,8 +4,8 @@ # LICENSE: https://github.com/markus-perl/ffmpeg-build-script/blob/master/LICENSE PROGNAME=$(basename "$0") -FFMPEG_VERSION=5.1 -SCRIPT_VERSION=1.43 +FFMPEG_VERSION=6.0 +SCRIPT_VERSION=1.44 CWD=$(pwd) PACKAGES="$CWD/packages" WORKSPACE="$CWD/workspace" @@ -387,8 +387,8 @@ if build "libtool" "2.4.7"; then fi if $NONFREE_AND_GPL; then - if build "openssl" "1.1.1s"; then - download "https://www.openssl.org/source/openssl-1.1.1s.tar.gz" + if build "openssl" "1.1.1t"; then + download "https://www.openssl.org/source/openssl-1.1.1t.tar.gz" if $MACOS_M1; then sed -n 's/\(##### GNU Hurd\)/"darwin64-arm64-cc" => { \n inherit_from => [ "darwin-common", asm("aarch64_asm") ],\n CFLAGS => add("-Wall"),\n cflags => add("-arch arm64 "),\n lib_cppflags => add("-DL_ENDIAN"),\n bn_ops => "SIXTY_FOUR_BIT_LONG", \n perlasm_scheme => "macosx", \n}, \n\1/g' Configurations/10-main.conf execute ./Configure --prefix="${WORKSPACE}" no-shared no-asm darwin64-arm64-cc @@ -397,7 +397,7 @@ if $NONFREE_AND_GPL; then fi execute make -j $MJOBS execute make install_sw - build_done "openssl" "1.1.1s" + build_done "openssl" "1.1.1t" fi CONFIGURE_OPTIONS+=("--enable-openssl") else @@ -418,12 +418,12 @@ else fi if [[ ! $ARCH == 'arm64' ]]; then - if build "gnutls" "3.7.8"; then - download "https://www.gnupg.org/ftp/gcrypt/gnutls/v3.7/gnutls-3.7.8.tar.xz" + if build "gnutls" "3.7.9"; then + download "https://www.gnupg.org/ftp/gcrypt/gnutls/v3.7/gnutls-3.7.9.tar.xz" execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static --disable-doc --disable-tools --disable-cxx --disable-tests --disable-gtk-doc-html --disable-libdane --disable-nls --enable-local-libopts --disable-guile --with-included-libtasn1 --with-included-unistring --without-p11-kit CPPFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" execute make -j $MJOBS execute make install - build_done "gnutls" "3.7.8" + build_done "gnutls" "3.7.9" fi # CONFIGURE_OPTIONS+=("--enable-gmp" "--enable-gnutls") fi @@ -454,8 +454,8 @@ if command_exists "python3"; then done fi if command_exists "meson"; then - if build "dav1d" "1.0.0"; then - download "https://code.videolan.org/videolan/dav1d/-/archive/1.0.0/dav1d-1.0.0.tar.gz" + if build "dav1d" "1.1.0"; then + download "https://code.videolan.org/videolan/dav1d/-/archive/1.0.0/dav1d-1.1.0.tar.gz" make_dir build CFLAGSBACKUP=$CFLAGS @@ -471,7 +471,7 @@ if command_exists "python3"; then export CFLAGS=$CFLAGSBACKUP fi - build_done "dav1d" "1.0.0" + build_done "dav1d" "1.1.0" fi CONFIGURE_OPTIONS+=("--enable-libdav1d") fi @@ -493,11 +493,11 @@ if ! $MACOS_M1; then fi if command_exists "cargo"; then - if build "rav1e" "0.6.2"; then + if build "rav1e" "0.6.3"; then execute cargo install --version "0.9.14+cargo-0.66" cargo-c - download "https://github.com/xiph/rav1e/archive/refs/tags/v0.6.2.tar.gz" + download "https://github.com/xiph/rav1e/archive/refs/tags/v0.6.3.tar.gz" execute cargo cinstall --prefix="${WORKSPACE}" --library-type=staticlib --crt-static --release - build_done "rav1e" "0.6.2" + build_done "rav1e" "0.6.3" fi CONFIGURE_OPTIONS+=("--enable-librav1e") fi @@ -567,8 +567,8 @@ EOF CONFIGURE_OPTIONS+=("--enable-libx265") fi -if build "libvpx" "1.12.0"; then - download "https://github.com/webmproject/libvpx/archive/refs/tags/v1.12.0.tar.gz" "libvpx-1.12.0.tar.gz" +if build "libvpx" "1.13.0"; then + download "https://github.com/webmproject/libvpx/archive/refs/tags/v1.13.0.tar.gz" "libvpx-1.13.0.tar.gz" if [[ "$OSTYPE" == "darwin"* ]]; then echo "Applying Darwin patch" @@ -580,7 +580,7 @@ if build "libvpx" "1.12.0"; then execute make -j $MJOBS execute make install - build_done "libvpx" "1.12.0" + build_done "libvpx" "1.13.0" fi CONFIGURE_OPTIONS+=("--enable-libvpx") @@ -837,13 +837,13 @@ fi ## other library ## -if build "libsdl" "2.26.1"; then - download "https://www.libsdl.org/release/SDL2-2.26.1.tar.gz" +if build "libsdl" "2.26.3"; then + download "https://www.libsdl.org/release/SDL2-2.26.3.tar.gz" execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static execute make -j $MJOBS execute make install - build_done "libsdl" "2.26.1" + build_done "libsdl" "2.26.3" fi if $NONFREE_AND_GPL; then @@ -870,11 +870,11 @@ fi if [[ "$OSTYPE" == "linux-gnu" ]]; then if command_exists "nvcc"; then - if build "nv-codec" "11.1.5.0"; then - download "https://github.com/FFmpeg/nv-codec-headers/releases/download/n11.1.5.0/nv-codec-headers-11.1.5.0.tar.gz" + if build "nv-codec" "11.1.5.2"; then + download "https://github.com/FFmpeg/nv-codec-headers/releases/download/n11.1.5.2/nv-codec-headers-11.1.5.2.tar.gz" execute make PREFIX="${WORKSPACE}" - execute make install PREFIX="${WORKSPACE}" - build_done "nv-codec" "11.1.5.0" + execute make PREFIX="${WORKSPACE}/usr" install + build_done "nv-codec" "11.1.5.2" fi CFLAGS+=" -I/usr/local/cuda/include" LDFLAGS+=" -L/usr/local/cuda/lib64" @@ -899,12 +899,12 @@ if [[ "$OSTYPE" == "linux-gnu" ]]; then fi fi - if build "amf" "1.4.28"; then - download 'https://github.com/GPUOpen-LibrariesAndSDKs/AMF/archive/refs/tags/v1.4.28.tar.gz' 'AMF-1.4.28.tar.gz' 'AMF-1.4.28' + if build "amf" "1.4.29"; then + download 'https://github.com/GPUOpen-LibrariesAndSDKs/AMF/archive/refs/tags/v1.4.29.tar.gz' 'AMF-1.4.29.tar.gz' 'AMF-1.4.29' execute rm -rf "${WORKSPACE}/include/AMF" execute mkdir -p "${WORKSPACE}/include/AMF" - execute cp -r "${PACKAGES}"/AMF-1.4.28/AMF-1.4.28/amf/public/include/* "${WORKSPACE}/include/AMF/" - build_done "amf" "1.4.28" + execute cp -r "${PACKAGES}"/AMF-1.4.29/AMF-1.4.29/amf/public/include/* "${WORKSPACE}/include/AMF/" + build_done "amf" "1.4.29" fi CONFIGURE_OPTIONS+=("--enable-amf") fi @@ -929,6 +929,7 @@ download "https://github.com/FFmpeg/FFmpeg/archive/refs/heads/release/$FFMPEG_VE --enable-static \ --enable-small \ --enable-version3 \ + --disable-ffnvcodec \ --extra-cflags="${CFLAGS}" \ --extra-ldexeflags="${LDEXEFLAGS}" \ --extra-ldflags="${LDFLAGS}" \ diff --git a/cuda-rocky.dockerfile b/cuda-rocky.dockerfile deleted file mode 100644 index 99b60e9e..00000000 --- a/cuda-rocky.dockerfile +++ /dev/null @@ -1,49 +0,0 @@ -ARG VER=8 - -FROM nvidia/cuda:11.7.0-devel-rockylinux${VER} AS build - -ENV NVIDIA_VISIBLE_DEVICES all -ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,video - -RUN yum group install -y "Development Tools" \ - && yum install -y curl libva-devel python3 \ - && yum install -y meson ninja-build --enablerepo=powertools \ - && rm -rf /var/cache/yum/* /var/cache/dnf/* \ - && yum clean all \ - && alternatives --set python /usr/bin/python3 - -WORKDIR /app -COPY ./build-ffmpeg /app/build-ffmpeg - -RUN SKIPINSTALL=yes /app/build-ffmpeg --build --enable-gpl-and-non-free - - -FROM rockylinux:${VER} - -ENV NVIDIA_VISIBLE_DEVICES all -ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,video - -# install va-driver -RUN yum install -y libva \ - && rm -rf /var/cache/yum/* \ - && yum clean all - -# Copy libnpp -COPY --from=build /usr/local/cuda-11.7/targets/x86_64-linux/lib/libnppc.so.11 /lib64/libnppc.so.11 -COPY --from=build /usr/local/cuda-11.7/targets/x86_64-linux/lib/libnppig.so.11 /lib64/libnppig.so.11 -COPY --from=build /usr/local/cuda-11.7/targets/x86_64-linux/lib/libnppicc.so.11 /lib64/libnppicc.so.11 -COPY --from=build /usr/local/cuda-11.7/targets/x86_64-linux/lib/libnppidei.so.11 /lib64/libnppidei.so.11 -COPY --from=build /usr/local/cuda-11.7/targets/x86_64-linux/lib/libnppif.so.11 /lib64/libnppif.so.11 - -# Copy ffmpeg -COPY --from=build /app/workspace/bin/ffmpeg /usr/bin/ffmpeg -COPY --from=build /app/workspace/bin/ffprobe /usr/bin/ffprobe -COPY --from=build /app/workspace/bin/ffplay /usr/bin/ffplay - -# Check shared library -RUN ldd /usr/bin/ffmpeg -RUN ldd /usr/bin/ffprobe -RUN ldd /usr/bin/ffplay - -CMD ["--help"] -ENTRYPOINT ["/usr/bin/ffmpeg"] \ No newline at end of file diff --git a/cuda-ubuntu.dockerfile b/cuda-ubuntu.dockerfile index d14f4127..ccd24f44 100644 --- a/cuda-ubuntu.dockerfile +++ b/cuda-ubuntu.dockerfile @@ -1,15 +1,24 @@ ARG VER=22.04 -FROM nvidia/cuda:11.8.0-devel-ubuntu${VER} AS build +FROM ubuntu:${VER} AS build + +ARG CUDAVER=11.8.0-1 ENV DEBIAN_FRONTEND noninteractive ENV NVIDIA_VISIBLE_DEVICES all ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,video RUN apt-get update \ - && apt-get -y --no-install-recommends install build-essential curl ca-certificates libva-dev python3 python-is-python3 ninja-build meson \ - && apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* \ - && update-ca-certificates + && apt-get -y --no-install-recommends install wget ca-certificates \ + && update-ca-certificates \ + && wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb \ + && dpkg -i cuda-keyring_1.0-1_all.deb \ + && apt-get update + +RUN apt-get -y --no-install-recommends install build-essential curl libva-dev python3 python-is-python3 ninja-build meson \ + cuda="${CUDAVER}" \ + && apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* + WORKDIR /app COPY ./build-ffmpeg /app/build-ffmpeg