diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..4595cc3 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,31 @@ +* text eol=crlf +* text eol=lf + +*.zip filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.tar.gz filter=lfs diff=lfs merge=lfs -text +*.jpg filter=lfs diff=lfs merge=lfs -text +*.jpeg filter=lfs diff=lfs merge=lfs -text +*.tiff filter=lfs diff=lfs merge=lfs -text +*.ico filter=lfs diff=lfs merge=lfs -text +*.gif filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +original filter=lfs diff=lfs merge=lfs -text +file filter=lfs diff=lfs merge=lfs -text +folderThumbnail filter=lfs diff=lfs merge=lfs -text +*.woff filter=lfs diff=lfs merge=lfs -text +*.woff2 filter=lfs diff=lfs merge=lfs -text +*.eot filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.mp4 filter=lfs diff=lfs merge=lfs -text +*.flv filter=lfs diff=lfs merge=lfs -text +*.m4v filter=lfs diff=lfs merge=lfs -text +*.avi filter=lfs diff=lfs merge=lfs -text +*.psd filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.3gp filter=lfs diff=lfs merge=lfs -text +*.ogv filter=lfs diff=lfs merge=lfs -text +*.webm filter=lfs diff=lfs merge=lfs -text +*.wdmg filter=lfs diff=lfs merge=lfs -text +*.svg filter=lfs diff=lfs merge=lfs -text +*.sftmp filter=lfs diff=lfs merge=lfs -text diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ba9c605 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,77 @@ +name: build + +on: [push] + +jobs: + build: + if: "!contains(github.event.head_commit.message, 'skip ci')" + runs-on: ubuntu-latest + env: + DOCKER_REGISTRY: docker.io + ORGANISATION_NAME: aemdesign + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + + steps: + - uses: actions/checkout@v2 + - name: set envirnment variables + id: config + run: | + source <(curl -sL https://github.com/aem-design/aemdesign-docker/releases/latest/download/github_get_config.sh) + source <(curl -sL https://github.com/aem-design/aemdesign-docker/releases/latest/download/github_get_version.sh) + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and export to Docker + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/arm64 + load: true + tags: | + ${{ env.IMAGE }}:${{ env.GIT_BRANCH }} + ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }}:${{ env.GIT_BRANCH }} + + + # - name: test docker image + # run: | + # cd test && bash ./run_tests.sh "$IMAGE:$GIT_BRANCH" + + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/arm64 + push: true + tags: | + ${{ env.IMAGE }}:${{ env.GIT_BRANCH }} + ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }}:${{ env.GIT_BRANCH }} + + - name: Update Docker Hub Description + uses: peter-evans/dockerhub-description@v2 + continue-on-error: true + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: peterevans/dockerhub-description + - uses: meeDamian/github-release@1.0 + if: github.ref == 'refs/heads/master' + with: + token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ env.GITHUB_TAG }} + name: ${{ env.GITHUB_TAG }} + body: ${{ env.GIT_RELEASE_NOTES }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b5dd703 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ + +# Ignore IDE and Operating System artifacts +.idea +.classpath +.metadata +.project +.settings +maven-eclipse.xml +*.iml +*.ipr +*.iws +.DS_Store + +target/ +logs/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9ad84bd..0000000 --- a/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -language: java - -if: tag is blank - -services: - - 'docker' - -before_install: - - echo GET CONFIG FROM DOCKERFILE - - export IMAGE_NAME=$(grep imagename= Dockerfile | sed -e 's/.*imagename="\(.*\)".*/\1/') - - export TEST_COMMAND=$(grep test.command= Dockerfile | sed -e 's/.*test.command="\(.*\)".*/\1/') - - export TEST_COMMAND_VERIFY=$(grep test.command.verify= Dockerfile | sed -e 's/.*test.command.verify="\(.*\)".*/\1/') - - export IMAGE_VERSION=$(grep version= Dockerfile | sed -e 's/.*version="\(.*\)".*/\1/') - - export IMAGE="$ORGANISATION_NAME/$IMAGE_NAME" - - echo IMAGE_NAME=$IMAGE_NAME - - echo IMAGE_VERSION=$IMAGE_VERSION - - echo TEST_COMMAND=$TEST_COMMAND - - echo TEST_COMMAND_VERIFY=$TEST_COMMAND_VERIFY - - echo GET CONFIG FROM GIT - - export CURRENT_VERSION=$(git describe --tag --always --long | sed -e 's/\(.*\)-\(.*\)-.*/\1.\2/') - - declare -a CURRENT_VERSION_ARRAY="(${CURRENT_VERSION//./ })"; export SEMVER_MAJOR=${CURRENT_VERSION_ARRAY[0]}; export SEMVER_MINOR=${CURRENT_VERSION_ARRAY[1]}; export SEMVER_PATCH=${CURRENT_VERSION_ARRAY[2]}; export SEMVER_BUILD=${CURRENT_VERSION_ARRAY[-1]} - - export SEMVER_BUILD=$(( ${SEMVER_PATCH} + ${SEMVER_BUILD} )) - - echo SEMVER_MAJOR:${SEMVER_MAJOR} - - echo SEMVER_MINOR:${SEMVER_MINOR} - - echo SEMVER_BUILD:${SEMVER_BUILD} - - export SEMVER=${SEMVER_MAJOR}.${SEMVER_MINOR}.${SEMVER_BUILD} - - echo SEMVER:$SEMVER - - if [[ ${SEMVER_MAJOR} == "" ]]; then travis_terminate 1; fi - - export TRAVIS_TAG=$SEMVER - - echo TRAVIS_TAG:$TRAVIS_TAG - -#build and test -install: - - docker build --pull -t $IMAGE:$IMAGE_VERSION . - - export CONTAINER_COMMAND="docker run $IMAGE:$IMAGE_VERSION $TEST_COMMAND" - - echo CONTAINER_COMMAND=$CONTAINER_COMMAND - - export CONTAINER_OUTPUT=$(eval $CONTAINER_COMMAND) - - echo CONTAINER_OUTPUT=$CONTAINER_OUTPUT - - if [[ ! ${CONTAINER_OUTPUT} =~ ${TEST_COMMAND_VERIFY} ]]; then travis_terminate 1; fi - - docker images - -#test -script: - - echo "LOGIN TO HUB.DOCKER" - - docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD - - echo "PUSH HUB.DOCKER" - - docker push $IMAGE:$IMAGE_VERSION - - if [[ $TRAVIS_BRANCH == "master" ]]; then docker tag $IMAGE:$IMAGE_VERSION $IMAGE:latest && docker push $IMAGE:latest; fi - - echo "UPDATE README IN HUB.DOCKER" - - if [[ $TRAVIS_BRANCH == "master" ]]; then docker run --rm -v $(pwd):/data/ aemdesign/dockerhub-description "$DOCKER_USERNAME" "$DOCKER_PASSWORD" "$IMAGE"; fi - -## Get the project version -before_deploy: - - if [[ $TRAVIS_BRANCH == "master" ]]; then git tag $TRAVIS_TAG; fi - -## Create release in GitHub -deploy: - provider: releases - tag_name: $TRAVIS_TAG - name: $TRAVIS_TAG - target_commitish: $TRAVIS_COMMIT - api_key: $GITHUB_TOKEN - skip_cleanup: true - on: - branch: master diff --git a/Dockerfile b/Dockerfile index 83a43aa..cdff37e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,132 +1,237 @@ -FROM aemdesign/oracle-jdk:jdk8 +FROM aemdesign/oracle-jdk:jdk11-arm as base -MAINTAINER devops +RUN apt-get update -y && \ + apt-get install libgomp1 libxdmcp6 libexpat-dev -y && \ + apt-get autoclean + +FROM base AS build + +WORKDIR /tmp/workdir + +ARG PREFIX=/opt/ffmpeg +ARG MAKEFLAGS="-j2" +ARG PKG_CONFIG_PATH="${PREFIX}/share/pkgconfig:${PREFIX}/lib:${PREFIX}/lib/pkgconfig:${PREFIX}/lib64/pkgconfig" +ARG LD_LIBRARY_PATH="${PREFIX}/lib:${PREFIX}/lib64" + +ENV FFMPEG_VERSION="5.0" \ + AOM_VERSION="v1.0.0" \ + CHROMAPRINT_VERSION="1.5.0" \ + FDKAAC_VERSION="0.1.5" \ + FONTCONFIG_VERSION="2.12.4" \ + FFMPEG_GPGKEY="D67658D8" \ + FREETYPE_VERSION="2.10.4" \ + FREETYPE_SHA256="5eab795ebb23ac77001cfb68b7d4d50b5d6c7469247b0b01b2c953269f658dac" \ + FRIBIDI_VERSION="0.19.7" \ + FRIBIDI_SHA256="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8" \ + KVAZAAR_VERSION="2.0.0" \ + LAME_MAJORVERSION="3.100" \ + LAME_VERSION="3.100" \ + LIBASS_VERSION="0.13.7" \ + LIBASS_SHA256="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7" \ + LIBPTHREAD_STUBS_VERSION="0.4" \ + LIBVIDSTAB_VERSION="1.1.0" \ + LIBVIDSTAB_SHA256="14d2a053e56edad4f397be0cb3ef8eb1ec3150404ce99a426c4eb641861dc0bb" \ + LIBXCB_VERSION="1.14" \ + XCBPROTO_VERSION="1.14.1" \ + OGG_VERSION="1.3.2" \ + OGG_SHA256="e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd41011d73a654692" \ + OPENCOREAMR_VERSION="0.1.5" \ + OPUS_VERSION="1.2" \ + OPUS_SHA256="77db45a87b51578fbc49555ef1b10926179861d854eb2613207dc79d9ec0a9a9" \ + OPENJPEG_VERSION="2.1.2" \ + THEORA_VERSION="1.1.1" \ + THEORA_SHA256="40952956c47811928d1e7922cda3bc1f427eb75680c3c37249c91e949054916b" \ + VORBIS_VERSION="1.3.5" \ + VORBIS_SHA256="6efbcecdd3e5dfbf090341b485da9d176eb250d893e3eb378c428a2db38301ce" \ + VPX_VERSION="1.8.0" \ + WEBP_VERSION="1.0.2" \ + X264_VERSION="20191217-2245-stable" \ + X265_VERSION="3.4" \ + XAU_VERSION="1.0.9" \ + XORG_MACROS_VERSION="1.19.2" \ + XPROTO_VERSION="7.0.31" \ + XVID_VERSION="1.3.5" \ + XVID_SHA256="165ba6a2a447a8375f7b06db5a3c91810181f2898166e7c8137401d7fc894cf0" \ + LIBXML2_VERSION="2.9.12" \ + LIBBLURAY_VERSION="1.1.2" \ + LIBBLURAY_SHA256="a3dd452239b100dc9da0d01b30e1692693e2a332a7d29917bf84bb10ea7c0b42" \ + LIBZMQ_VERSION="4.3.2" \ + LIBZMQ_SHA256="02ecc88466ae38cf2c8d79f09cfd2675ba299a439680b64ade733e26a349edeb" \ + LIBSRT_VERSION="1.4.1" \ + LIBARIBB24_VERSION="1.0.3" \ + LIBARIBB24_SHA256="f61560738926e57f9173510389634d8c06cabedfa857db4b28fb7704707ff128" \ + LIBPNG_VERSION="1.6.9" \ + LIBVMAF_VERSION="2.3.0" \ + PYTHON_VERSION="3.10.2" \ + PYTHON_VERSION_ALT="3.10" \ + SRC="/usr/local" + + +ENV FREETYPE_SHA256SUM="${FREETYPE_SHA256} freetype-${FREETYPE_VERSION}.tar.gz" \ + FRIBIDI_SHA256SUM="${FRIBIDI_SHA256} ${FRIBIDI_VERSION}.tar.gz" \ + LIBASS_SHA256SUM="${LIBASS_SHA256} ${LIBASS_VERSION}.tar.gz" \ + LIBVIDSTAB_SHA256SUM="${LIBVIDSTAB_SHA256} v${LIBVIDSTAB_VERSION}.tar.gz" \ + OGG_SHA256SUM="${OGG_SHA256} libogg-${OGG_VERSION}.tar.gz" \ + OPUS_SHA256SUM="${OPUS_SHA256} opus-${OPUS_VERSION}.tar.gz" \ + THEORA_SHA256SUM="${THEORA_SHA256} libtheora-${THEORA_VERSION}.tar.gz" \ + VORBIS_SHA256SUM="${VORBIS_SHA256} libvorbis-${VORBIS_VERSION}.tar.gz" \ + XVID_SHA256SUM="${XVID_SHA256} xvidcore-${XVID_VERSION}.tar.gz" \ + LIBBLURAY_SHA256SUM="${LIBBLURAY_SHA256} libbluray-${LIBBLURAY_VERSION}.tar.bz2" \ + LIBZMQ_SHA256SUM="${LIBZMQ_SHA256} v${LIBZMQ_VERSION}.tar.gz" \ + LIBARIBB24_SHA256SUM="${LIBARIBB24_SHA256} v${LIBARIBB24_VERSION}.tar.gz" \ + PATH="$PATH:${PREFIX}/bin" -LABEL os="centos 7" \ - container.description="java and ffmpeg" \ - image.source="https://github.com/jrottenberg/ffmpeg/tree/master/docker-images" \ - version="1.0.0" \ - imagename="java-ffmpeg" \ - test.command=" java -version 2>&1 | grep 'java version' | sed -e 's/.*java version "\(.*\)".*/\1/'" \ - test.command.verify="1.8" -ARG PKG_CONFIG_PATH=/opt/ffmpeg/lib/pkgconfig -ARG LD_LIBRARY_PATH=/opt/ffmpeg/lib -ARG PREFIX=/opt/ffmpeg -ARG MAKEFLAGS="-j2" - -ENV FFMPEG_VERSION="4.0" \ - FFMPEG_GPGKEY="D67658D8" \ - FDKAAC_VERSION="0.1.5" \ - FREETYPE_VERSION="2.9.1" \ - FREETYPE_SHA256SUM="ec391504e55498adceb30baceebd147a6e963f636eb617424bcfc47a169898ce" \ - FRIBIDI_VERSION="0.19.7" \ - FRIBIDI_SHA256SUM="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8" \ - FONTCONFIG_VERSION="2.12.4" \ - LAME_MAJORVERSION="3.100" \ - LAME_VERSION="3.100" \ - LIBASS_VERSION="0.13.7" \ - LIBASS_SHA256SUM="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7" \ - OGG_VERSION="1.3.2" \ - OGG_SHA256="e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd41011d73a654692" \ - OPENCOREAMR_VERSION="0.1.5" \ - OPUS_VERSION="1.2" \ - OPUS_SHA256="77db45a87b51578fbc49555ef1b10926179861d854eb2613207dc79d9ec0a9a9" \ - OPENJPEG_VERSION="2.1.2" \ - THEORA_VERSION="1.1.1" \ - THEORA_SHA256="40952956c47811928d1e7922cda3bc1f427eb75680c3c37249c91e949054916b" \ - VORBIS_VERSION="1.3.5" \ - VORBIS_SHA256="6efbcecdd3e5dfbf090341b485da9d176eb250d893e3eb378c428a2db38301ce" \ - VPX_VERSION="1.7.0" \ - X264_VERSION="20170226-2245-stable" \ - X265_VERSION="2.3" \ - XVID_VERSION="1.3.4" \ - XVID_SHA256="4e9fd62728885855bc5007fe1be58df42e5e274497591fec37249e1052ae316f" \ - YASM_VERSION="1.3.0" \ - LIBVIDSTAB_VERSION="1.1.0" \ - LIBVIDSTAB_SHA256SUM="14d2a053e56edad4f397be0cb3ef8eb1ec3150404ce99a426c4eb641861dc0bb" \ - KVAZAAR_VERSION="1.2.0" \ - AOM_VERSION="dd36e78d825fb2034ea0e3c630cd43360f241021" \ - SRC="/usr/local" - -ENV OGG_SHA256SUM="${OGG_SHA256} libogg-${OGG_VERSION}.tar.gz" \ - OPUS_SHA256SUM="${OPUS_SHA256} opus-${OPUS_VERSION}.tar.gz" \ - THEORA_SHA256SUM="${THEORA_SHA256} libtheora-${THEORA_VERSION}.tar.gz" \ - VORBIS_SHA256SUM="${VORBIS_SHA256} libvorbis-${VORBIS_VERSION}.tar.gz" \ - XVID_SHA256SUM="${XVID_SHA256} xvidcore-${XVID_VERSION}.tar.gz" \ - FREETYPE_SHA256SUM="${FREETYPE_SHA256SUM} freetype-${FREETYPE_VERSION}.tar.gz" \ - LIBVIDSTAB_SHA256SUM="${LIBVIDSTAB_SHA256SUM} v${LIBVIDSTAB_VERSION}.tar.gz" \ - LIBASS_SHA256SUM="${LIBASS_SHA256SUM} ${LIBASS_VERSION}.tar.gz" \ - FRIBIDI_SHA256SUM="${FRIBIDI_SHA256SUM} fribidi-${FRIBIDI_VERSION}.tar.gz" - -WORKDIR /tmp/workdir #https://docs.google.com/uc?id=0B3Uxax626E5DOVdJNjc0TW9Mbmc&export=download -COPY msft-fonts.zip ./ +COPY msft-fonts.zip ./ -RUN \ +RUN echo ">>> INSTALL: os packages <<" && \ + buildDeps="autoconf \ + automake \ + bzip2 \ + cmake \ + diffutils \ + libexpat1-dev \ + build-essential \ + gcc \ + git \ + gperf \ + libtool \ + make \ + nasm \ + perl \ + libssl-dev \ + xutils-dev \ + tar \ + diffutils \ + zlib1g-dev \ + libfreetype-dev \ + libunistring-dev \ + pkg-config \ + libxext-dev \ + libxfixes-dev \ + unzip \ + yasm \ + tzdata \ + wget" && \ echo "${SRC}/lib" > /etc/ld.so.conf.d/libc.conf && \ - yum install -y --enablerepo=extras epel-release && \ - yum install -y autoconf automake bzip2 freetype-devel gcc gcc-c++ git libtool make cmake3 nasm pkgconfig expat-devel gperf libgomp \ - zlib-devel libXext-devel libXfixes-devel perl openssl-devel tar yasm which unzip wget && \ - #make cmake3 be default cmake - ln -sf /usr/bin/cmake3 /usr/bin/cmake && \ - ln -sf /usr/bin/cpack3 /usr/bin/cpack && \ - ln -sf /usr/bin/ctest3 /usr/bin/ctest + apt-get update -y && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y ${buildDeps} + +RUN \ + echo ">>> INSTALL: latest python <<" && \ + apt install software-properties-common -y && \ + add-apt-repository ppa:deadsnakes/ppa -y && \ + apt install python3.9 python3-pip -y && \ + update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1 && \ + update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1 && \ + update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 && \ + echo ">>> INSTALL: python libraries <<" && \ + pip3 install --upgrade pip && \ + pip3 install scikit-build meson ninja +FROM build as build-libogg +RUN \ +## libogg https://www.xiph.org/ogg/ + echo ">>> BUILD: ogg <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz && \ + echo ${OGG_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libogg-${OGG_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +FROM build as build-vmaf +RUN \ +## libvmaf https://github.com/Netflix/vmaf + echo ">>> BUILD: vmaf <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + cd libvmaf && \ + meson build --default-library=both --buildtype=release -Denable_tests=false -Denable_docs=false -Dbuilt_in_models=true --prefix=${PREFIX} --libdir=lib && \ + ninja -vC build && \ + ninja -vC build install && \ + mkdir -p ${PREFIX}/share/model/ && \ + cp -r ${DIR}/model/* ${PREFIX}/share/model/ && \ + rm -rf ${DIR} + +FROM build as build-amr RUN \ ## opencore-amr https://sourceforge.net/projects/opencore-amr/ + echo ">>> BUILD: opencore-amr <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ - curl -sL https://sourceforge.mirrorservice.org/o/op/opencore-amr/opencore-amr/opencore-amr-${OPENCOREAMR_VERSION}.tar.gz | \ + curl -sL https://sourceforge.net/projects/opencore-amr/files/opencore-amr/opencore-amr-${OPENCOREAMR_VERSION}.tar.gz/download | \ tar -zx --strip-components=1 && \ ./configure --prefix="${PREFIX}" --enable-shared && \ make && \ make install && \ - rm -rf ${DIR} && \ -#RUN \ + rm -rf ${DIR} + +FROM build as build-x264 +RUN \ ## x264 http://www.videolan.org/developers/x264.html + echo ">>> BUILD: x264 <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ curl -sL https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-${X264_VERSION}.tar.bz2 | \ tar -jx --strip-components=1 && \ ./configure --prefix="${PREFIX}" --enable-shared --enable-pic --disable-cli && \ make && \ make install && \ - rm -rf ${DIR} && \ -#RUN \ + rm -rf ${DIR} + +FROM build as build-x265 +RUN \ ## x265 http://x265.org/ + echo ">>> BUILD: x265 <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ - curl -sL https://download.videolan.org/pub/videolan/x265/x265_${X265_VERSION}.tar.gz | \ + curl -sL https://github.com/videolan/x265/archive/refs/tags/${X265_VERSION}.tar.gz | \ tar -zx && \ - cd x265_${X265_VERSION}/build/linux && \ + cd x265-${X265_VERSION}/build/linux && \ sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\${PREFIX}/" multilib.sh && \ + sed -i "/-DEXTRA_LIB/ s/$/ -DENABLE_SHARED:bool=off/" multilib.sh && \ sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh && \ + sed -i '/^cmake/ s/$/ -DCMAKE_CXX_FLAGS=\"-fPIC\"/' multilib.sh && \ + sed -i '/^cmake/ s/$/ -DCROSS_COMPILE_ARM=ON/' multilib.sh && \ + sed -i '/^cmake/ s/$/ -DENABLE_ASSEMBLY=OFF/' multilib.sh && \ + sed -i '/^cmake/ s/$/ -DCMAKE_SYSTEM_PROCESSOR=aarch64/' multilib.sh && \ + sed -i '/^cd 12bit/ s/$/ \&\& echo MAKE 12bit/' multilib.sh && \ + sed -i '/^cd 10bit/ s/$/ \&\& echo MAKE 10bit/' multilib.sh && \ + sed -i '/^cd 8bit/ s/$/ \&\& echo MAKE 8bit/' multilib.sh && \ + cat multilib.sh && \ + echo `uname` && \ ./multilib.sh && \ make -C 8bit install && \ - rm -rf ${DIR} && \ -#RUN \ -## libogg https://www.xiph.org/ogg/ - DIR=$(mktemp -d) && cd ${DIR} && \ - curl -sLO http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz && \ - echo ${OGG_SHA256SUM} | sha256sum --check && \ - tar -zx --strip-components=1 -f libogg-${OGG_VERSION}.tar.gz && \ - ./configure --prefix="${PREFIX}" --enable-shared && \ - make && \ - make install && \ - rm -rf ${DIR} && \ -#RUN \ + rm -rf ${DIR} + +FROM build as build-opus +RUN \ ## libopus https://www.opus-codec.org/ + echo ">>> BUILD: opus <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ - curl -sLO http://downloads.xiph.org/releases/opus/opus-${OPUS_VERSION}.tar.gz && \ + curl -sLO https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz && \ echo ${OPUS_SHA256SUM} | sha256sum --check && \ tar -zx --strip-components=1 -f opus-${OPUS_VERSION}.tar.gz && \ autoreconf -fiv && \ ./configure --prefix="${PREFIX}" --enable-shared && \ make && \ make install && \ - rm -rf ${DIR} && \ -#RUN \ + rm -rf ${DIR} + +FROM build as build-vorbis +COPY --from=build-libogg ${PREFIX}/ ${PREFIX}/ +RUN \ ## libvorbis https://xiph.org/vorbis/ + echo ">>> BUILD: vorbis <<" && \ + find / -name ogg.pc && \ + echo "^^12" && \ + ls -l ${PREFIX}/ && \ + echo "^^13" && \ + pkg-config --libs "ogg >= 1.3.2" && \ + echo "^^14" && \ DIR=$(mktemp -d) && cd ${DIR} && \ curl -sLO http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz && \ echo ${VORBIS_SHA256SUM} | sha256sum --check && \ @@ -134,49 +239,63 @@ RUN \ ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \ make && \ make install && \ - rm -rf ${DIR} && \ -#RUN \ -## libtheora http://www.theora.org/ - DIR=$(mktemp -d) && cd ${DIR} && \ - curl -sLO http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.gz && \ - echo ${THEORA_SHA256SUM} | sha256sum --check && \ - tar -zx --strip-components=1 -f libtheora-${THEORA_VERSION}.tar.gz && \ - ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \ - make && \ - make install && \ - rm -rf ${DIR} && \ -#RUN \ + rm -rf ${DIR} + +FROM build as build-libvpx +RUN \ ## libvpx https://www.webmproject.org/code/ + echo ">>> BUILD: libvpx <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ curl -sL https://codeload.github.com/webmproject/libvpx/tar.gz/v${VPX_VERSION} | \ tar -zx --strip-components=1 && \ - ./configure --prefix="${PREFIX}" --enable-vp8 --enable-vp9 --enable-pic --enable-shared \ + ./configure --prefix="${PREFIX}" --enable-vp8 --enable-vp9 --enable-vp9-highbitdepth --enable-pic --enable-shared \ --disable-debug --disable-examples --disable-docs --disable-install-bins && \ make && \ make install && \ - rm -rf ${DIR} && \ -#RUN \ + rm -rf ${DIR} + +FROM build as build-libwebp +RUN \ +### libwebp https://developers.google.com/speed/webp/ + echo ">>> BUILD: libwebp <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +FROM build as build-libmp3lame +RUN \ ## libmp3lame http://lame.sourceforge.net/ + echo ">>> BUILD: libmp3lame <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ - curl -sL https://sourceforge.mirrorservice.org/l/la/lame/lame/${LAME_MAJORVERSION}/lame-${LAME_VERSION}.tar.gz | \ + curl -sL https://sourceforge.net/projects/lame/files/lame/${LAME_VERSION}/lame-${LAME_VERSION}.tar.gz/download | \ tar -zx --strip-components=1 && \ ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ make && \ make install && \ - rm -rf ${DIR} && \ -#RUN \ + rm -rf ${DIR} + +FROM build as build-xvid +RUN \ ## xvid https://www.xvid.com/ + echo ">>> BUILD: xvid <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ curl -sLO http://downloads.xvid.org/downloads/xvidcore-${XVID_VERSION}.tar.gz && \ echo ${XVID_SHA256SUM} | sha256sum --check && \ tar -zx -f xvidcore-${XVID_VERSION}.tar.gz && \ cd xvidcore/build/generic && \ - ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --datadir="${DIR}" && \ + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" && \ make && \ make install && \ - rm -rf ${DIR} && \ -#RUN \ + rm -rf ${DIR} + +FROM build as build-fdk-aac +RUN \ ## fdk-aac https://github.com/mstorsjo/fdk-aac + echo ">>> BUILD: fdk-aac <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ curl -sL https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC_VERSION}.tar.gz | \ tar -zx --strip-components=1 && \ @@ -184,160 +303,445 @@ RUN \ ./configure --prefix="${PREFIX}" --enable-shared --datadir="${DIR}" && \ make && \ make install && \ - make distclean && \ - rm -rf ${DIR} && \ -#RUN \ + rm -rf ${DIR} + +FROM build as build-openjpeg +RUN \ ## openjpeg https://github.com/uclouvain/openjpeg + echo ">>> BUILD: openjpeg <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ curl -sL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | \ tar -zx --strip-components=1 && \ - cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DCMAKE_C_FLAGS="-DPNG_ARM_NEON_OPT=0" . && \ make && \ make install && \ - rm -rf ${DIR} && \ -#RUN \ + rm -rf ${DIR} + +FROM build as build-freetype +RUN \ ## freetype https://www.freetype.org/ + echo ">>> BUILD: freetype <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ - curl -sLO http://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \ + curl -sLO https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \ echo ${FREETYPE_SHA256SUM} | sha256sum --check && \ tar -zx --strip-components=1 -f freetype-${FREETYPE_VERSION}.tar.gz && \ ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ make && \ make install && \ - rm -rf ${DIR} && \ -#RUN \ + rm -rf ${DIR} + +FROM build as build-libvstab +RUN \ ## libvstab https://github.com/georgmartius/vid.stab + echo ">>> BUILD: libvstab <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ - curl -sLO https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB_VERSION}.tar.gz &&\ + curl -sLO https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB_VERSION}.tar.gz && \ echo ${LIBVIDSTAB_SHA256SUM} | sha256sum --check && \ tar -zx --strip-components=1 -f v${LIBVIDSTAB_VERSION}.tar.gz && \ - cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DSSE2_FOUND=False . && \ + ls -l && \ make && \ make install && \ - rm -rf ${DIR} && \ -#RUN \ + rm -rf ${DIR} + +FROM build as build-fribidi +RUN \ ## fridibi https://www.fribidi.org/ + echo ">>> BUILD: fribidi <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ - curl -sL -o fribidi-${FRIBIDI_VERSION}.tar.gz https://codeload.github.com/fribidi/fribidi/tar.gz/${FRIBIDI_VERSION} &&\ + curl -sLO https://github.com/fribidi/fribidi/archive/${FRIBIDI_VERSION}.tar.gz && \ echo ${FRIBIDI_SHA256SUM} | sha256sum --check && \ - tar -zx --strip-components=1 -f fribidi-${FRIBIDI_VERSION}.tar.gz && \ - sed -i 's/^SUBDIRS =.*/SUBDIRS=gen.tab charset lib/' Makefile.am && \ - ./bootstrap --no-config && \ - ./configure -prefix="${PREFIX}" --disable-static --enable-shared && \ - make && \ + tar -zx --strip-components=1 -f ${FRIBIDI_VERSION}.tar.gz && \ + sed -i 's/^SUBDIRS =.*/SUBDIRS=gen.tab charset lib bin/' Makefile.am && \ + ./bootstrap --no-config --auto && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make -j1 && \ make install && \ - rm -rf ${DIR} && \ -#RUN \ + rm -rf ${DIR} + +FROM build as build-fontconfig +RUN \ ## fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/ + echo ">>> BUILD: fontconfig <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ - curl -sLO https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.bz2 &&\ + curl -sLO https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \ tar -jx --strip-components=1 -f fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \ - ./configure -prefix="${PREFIX}" --disable-static --enable-shared && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ make && \ make install && \ - rm -rf ${DIR} && \ -#RUN \ + rm -rf ${DIR} + +FROM build as build-libass +COPY --from=build-fribidi ${PREFIX}/ ${PREFIX}/ +COPY --from=build-fontconfig ${PREFIX}/ ${PREFIX}/ +RUN \ ## libass https://github.com/libass/libass + echo ">>> BUILD: libass <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ - curl -sLO https://github.com/libass/libass/archive/${LIBASS_VERSION}.tar.gz &&\ + curl -sLO https://github.com/libass/libass/archive/${LIBASS_VERSION}.tar.gz && \ echo ${LIBASS_SHA256SUM} | sha256sum --check && \ tar -zx --strip-components=1 -f ${LIBASS_VERSION}.tar.gz && \ ./autogen.sh && \ - ./configure -prefix="${PREFIX}" --disable-static --enable-shared && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ make && \ make install && \ - rm -rf ${DIR} && \ -#RUN \ + rm -rf ${DIR} + +FROM build as build-kvazaar +RUN \ ## kvazaar https://github.com/ultravideo/kvazaar + echo ">>> BUILD: kvazaar <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ - curl -sLO https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR_VERSION}.tar.gz &&\ + curl -sLO https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR_VERSION}.tar.gz && \ tar -zx --strip-components=1 -f v${KVAZAAR_VERSION}.tar.gz && \ ./autogen.sh && \ - ./configure -prefix="${PREFIX}" --disable-static --enable-shared && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ make && \ make install && \ - rm -rf ${DIR} && \ -#RUN \ + rm -rf ${DIR} + +FROM build as build-aom +RUN \ ## aomedia https://aomedia.googlesource.com/aom/ - DIR=$(mktemp -d) && cd ${DIR} && \ - curl -sLO https://aomedia.googlesource.com/aom/+archive/${AOM_VERSION}.tar.gz && \ - tar -zx -f ${AOM_VERSION}.tar.gz && \ + echo ">>> BUILD: aomedia <<" && \ + DIR=$(mktemp -d) && \ + git clone --branch "v3.2.0" --depth 1 https://aomedia.googlesource.com/aom ${DIR} && \ + cd ${DIR} && \ rm -rf CMakeCache.txt CMakeFiles && \ mkdir -p ./aom_build && \ cd ./aom_build && \ - cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 -DENABLE_DOCS=0 .. && \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 -DAOM_EXTRA_C_FLAGS="-fPIC" -DENABLE_DOCS=0 -DENABLE_TESTS=0 .. && \ + make && \ + make install && \ + rm -rf ${DIR} + +FROM build as build-xcb-proto +RUN \ + echo ">>> BUILD: xcb-proto <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://xorg.freedesktop.org/archive/individual/proto/xcb-proto-${XCBPROTO_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f xcb-proto-${XCBPROTO_VERSION}.tar.gz && \ + ACLOCAL_PATH="${PREFIX}/share/aclocal" ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +FROM build as build-libxcb +COPY --from=build-xcb-proto ${PREFIX}/ ${PREFIX}/ +RUN \ + echo ">>> BUILD: libxcb <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/libxcb-${LIBXCB_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libxcb-${LIBXCB_VERSION}.tar.gz && \ + ACLOCAL_PATH="${PREFIX}/share/aclocal" ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +FROM build as build-xorg-macro +COPY --from=build-libxcb ${PREFIX}/ ${PREFIX}/ +# RUN \ +# echo ">>> BUILD: xorg-macro <<" && \ +# ls -l ${PREFIX}/ && \ +# exit 1 +COPY --from=build-xcb-proto ${PREFIX}/ ${PREFIX}/ +# RUN \ +# echo ">>> BUILD: xorg-macro <<" && \ +# ls -l ${PREFIX}/ && \ +# exit 1 +RUN \ +## libxcb (and supporting libraries) for screen capture https://xcb.freedesktop.org/ + echo ">>> BUILD: xorg-macro <<" && \ + # ls -l ${PREFIX}/ && \ + # echo "^^11" && \ + # find / -name xcb && \ + # echo "^^12" && \ + # pkg-config --libs "xcb-proto >= 1.14.1" && \ + # echo "^^13" && \ + # exit 1 && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://www.x.org/archive/individual/util/util-macros-${XORG_MACROS_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f util-macros-${XORG_MACROS_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +FROM build as build-xproto +RUN \ + echo ">>> BUILD: xproto <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://www.x.org/archive/individual/proto/xproto-${XPROTO_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f xproto-${XPROTO_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" --build=aarch64-unknown-linux-gnu && \ + make && \ + make install && \ + rm -rf ${DIR} + +FROM build as build-libXau +RUN \ + echo ">>> BUILD: libXau <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://www.x.org/archive/individual/lib/libXau-${XAU_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libXau-${XAU_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +FROM build as build-libpthread +RUN \ + echo ">>> BUILD: libpthread <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +FROM build as build-libxml2 +RUN \ +## libxml2 - for libbluray + echo ">>> BUILD: libxml2 <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sL https://github.com/GNOME/libxml2/archive/refs/tags/v${LIBXML2_VERSION}.tar.gz | \ + tar -xz --strip-components=1 && \ + ./autogen.sh --prefix="${PREFIX}" --with-ftp=no --with-http=no --with-python=no && \ + make && \ + make install && \ + rm -rf ${DIR} + +FROM build as build-libbluray +COPY --from=build-libxml2 ${PREFIX}/ ${PREFIX}/ +COPY --from=build-freetype ${PREFIX}/ ${PREFIX}/ +COPY --from=build-fontconfig ${PREFIX}/ ${PREFIX}/ +RUN \ +## libbluray - Requires libxml, freetype, and fontconfig + echo ">>> BUILD: libbluray <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://download.videolan.org/pub/videolan/libbluray/${LIBBLURAY_VERSION}/libbluray-${LIBBLURAY_VERSION}.tar.bz2 && \ + echo ${LIBBLURAY_SHA256SUM} | sha256sum --check && \ + tar -jx --strip-components=1 -f libbluray-${LIBBLURAY_VERSION}.tar.bz2 && \ + ./configure --prefix="${PREFIX}" --disable-examples --disable-bdjava-jar --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +FROM build as build-libzmq +RUN \ +## libzmq https://github.com/zeromq/libzmq/ + echo ">>> BUILD: libzmq <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://github.com/zeromq/libzmq/archive/v${LIBZMQ_VERSION}.tar.gz && \ + echo ${LIBZMQ_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f v${LIBZMQ_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make check && \ + make install && \ + rm -rf ${DIR} + +FROM build as build-libsrt +RUN \ +## libsrt https://github.com/Haivision/srt + echo ">>> BUILD: libsrt <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://github.com/Haivision/srt/archive/v${LIBSRT_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBSRT_VERSION}.tar.gz && \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} + +FROM build as build-libpng +RUN \ +## libpng + echo ">>> BUILD: libpng <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + git clone https://git.code.sf.net/p/libpng/code ${DIR} -b v${LIBPNG_VERSION} --depth 1 && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make check && \ + make install && \ + rm -rf ${DIR} + +FROM build as build-libaribb24 +RUN \ +## libaribb24 + echo ">>> BUILD: libaribb24 <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://github.com/nkoriyama/aribb24/archive/v${LIBARIBB24_VERSION}.tar.gz && \ + echo ${LIBARIBB24_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f v${LIBARIBB24_VERSION}.tar.gz && \ + autoreconf -fiv && \ + ./configure CFLAGS="-I${PREFIX}/include -fPIC" --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +FROM build as build-theora +COPY --from=build-libogg ${PREFIX}/ ${PREFIX}/ +RUN \ +## libtheora http://www.theora.org/ + echo ">>> BUILD: theora <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.gz && \ + echo ${THEORA_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libtheora-${THEORA_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared --disable-examples --build=aarch64-unknown-linux-gnu && \ make && \ make install && \ - rm -rf ${DIR} && \ -#RUN \ + rm -rf ${DIR} + +FROM build as build-ffmpeg +# copy all plugins from build images +COPY --from=build-vmaf ${PREFIX}/ ${PREFIX}/ +COPY --from=build-amr ${PREFIX}/ ${PREFIX}/ +COPY --from=build-x264 ${PREFIX}/ ${PREFIX}/ +COPY --from=build-x265 ${PREFIX}/ ${PREFIX}/ +COPY --from=build-libogg ${PREFIX}/ ${PREFIX}/ +COPY --from=build-opus ${PREFIX}/ ${PREFIX}/ +COPY --from=build-vorbis ${PREFIX}/ ${PREFIX}/ +COPY --from=build-libvpx ${PREFIX}/ ${PREFIX}/ +COPY --from=build-libwebp ${PREFIX}/ ${PREFIX}/ +COPY --from=build-libmp3lame ${PREFIX}/ ${PREFIX}/ +COPY --from=build-xvid ${PREFIX}/ ${PREFIX}/ +COPY --from=build-fdk-aac ${PREFIX}/ ${PREFIX}/ +COPY --from=build-openjpeg ${PREFIX}/ ${PREFIX}/ +COPY --from=build-freetype ${PREFIX}/ ${PREFIX}/ +COPY --from=build-libvstab ${PREFIX}/ ${PREFIX}/ +COPY --from=build-fribidi ${PREFIX}/ ${PREFIX}/ +COPY --from=build-fontconfig ${PREFIX}/ ${PREFIX}/ +COPY --from=build-libass ${PREFIX}/ ${PREFIX}/ +COPY --from=build-kvazaar ${PREFIX}/ ${PREFIX}/ +COPY --from=build-aom ${PREFIX}/ ${PREFIX}/ +COPY --from=build-xorg-macro ${PREFIX}/ ${PREFIX}/ +COPY --from=build-xproto ${PREFIX}/ ${PREFIX}/ +COPY --from=build-libXau ${PREFIX}/ ${PREFIX}/ +COPY --from=build-libpthread ${PREFIX}/ ${PREFIX}/ +COPY --from=build-xcb-proto ${PREFIX}/ ${PREFIX}/ +COPY --from=build-libxcb ${PREFIX}/ ${PREFIX}/ +COPY --from=build-libxml2 ${PREFIX}/ ${PREFIX}/ +COPY --from=build-libbluray ${PREFIX}/ ${PREFIX}/ +COPY --from=build-libzmq ${PREFIX}/ ${PREFIX}/ +COPY --from=build-libsrt ${PREFIX}/ ${PREFIX}/ +COPY --from=build-libpng ${PREFIX}/ ${PREFIX}/ +COPY --from=build-libaribb24 ${PREFIX}/ ${PREFIX}/ +COPY --from=build-theora ${PREFIX}/ ${PREFIX}/ +RUN \ ## ffmpeg https://ffmpeg.org/ + echo ">>> BUILD: ffmpeg <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ curl -sLO https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ tar -jx --strip-components=1 -f ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + export PKG_CONFIG_PATH="${PREFIX}/lib:${PREFIX}/lib/pkgconfig" && \ ./configure \ + --arch=aarch64 \ + --enable-cross-compile \ --disable-debug \ --disable-doc \ --disable-ffplay \ - --enable-shared \ - --enable-avresample \ - --enable-libopencore-amrnb \ - --enable-libopencore-amrwb \ + --disable-shared \ + --enable-fontconfig \ --enable-gpl \ + --enable-libaom \ + --enable-libaribb24 \ --enable-libass \ - --enable-libfreetype \ - --enable-libvidstab \ + --enable-libbluray \ --enable-libfdk_aac \ + --enable-libfreetype \ + --enable-libkvazaar \ --enable-libmp3lame \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ --enable-libopenjpeg \ --enable-libopus \ + --enable-libsrt \ --enable-libtheora \ + --enable-libvidstab \ --enable-libvorbis \ --enable-libvpx \ + --enable-libvmaf \ + --enable-libwebp \ --enable-libx264 \ --enable-libx265 \ + --enable-libxcb \ --enable-libxvid \ - --enable-x86asm \ - --enable-gpl \ - --enable-libx264 \ + --enable-libzmq \ --enable-nonfree \ --enable-openssl \ - --enable-libfdk_aac \ - --enable-libkvazaar \ - --enable-libaom --extra-libs=-lpthread \ --enable-postproc \ + --enable-shared \ --enable-small \ --enable-version3 \ --enable-zlib \ --extra-cflags="-I${PREFIX}/include" \ + --extra-cxxflags="-I${PREFIX}/include" \ --extra-ldflags="-L${PREFIX}/lib" \ - --extra-libs=-ldl \ + --extra-libs="-lm -lpthread" \ + --ld="g++" \ + --pkg-config-flags="--static" \ --prefix="${PREFIX}" && \ + echo "#disable all tests">./tests/Makefile && \ + make clean && \ make && \ make install && \ + make tools/zmqsend && cp tools/zmqsend ${PREFIX}/bin/ && \ make distclean && \ hash -r && \ cd tools && \ make qt-faststart && \ - cp qt-faststart ${PREFIX}/bin && \ - rm -rf ${DIR} && \ -#RUN \ + cp qt-faststart ${PREFIX}/bin/ && \ + rm -rf ${DIR} + +RUN \ ## setup ffmpeg lib64 libs + echo ">>> SETUP: ffmpeg lib64 libs <<" && \ + mkdir -p /usr/local/lib64/ && \ ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib64/ && \ + for lib in /usr/local/lib64/*.so.*; do ln -s "${lib##*/}" "${lib%%.so.*}".so; done && \ cp ${PREFIX}/bin/* /usr/local/bin/ && \ cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ - LD_LIBRARY_PATH=/usr/local/lib64 ffmpeg -buildconf && \ - ldconfig -v && ffmpeg -buildconf && \ -#RUN \ + LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib ffmpeg -buildconf && \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib64/pkgconfig && \ + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/libsw*.pc; do \ + sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib64/pkgconfig/"${pc##*/}"; \ + done && \ + ldconfig -v && ffmpeg -buildconf + +RUN \ ## setup jre fallback fonts + echo ">>> SETUP: jre fallback fonts <<" && \ mkdir -p /usr/java/default/jre/lib/fonts/fallback && \ ln -s /usr/share/fonts/cjkuni-ukai/ukai.ttc /usr/java/default/jre/lib/fonts/fallback && \ ln -s /usr/share/fonts/cjkuni-uming/uming.ttc /usr/java/default/jre/lib/fonts/fallback && \ cd /tmp/workdir && unzip msft-fonts.zip && cp msft-fonts/* /usr/java/default/jre/lib/fonts/fallback/ && \ - rm -fr /tmp/workdir/msft-fonts /tmp/workdir/msft-fonts.zip && \ -#RUN \ + rm -fr /tmp/workdir/msft-fonts /tmp/workdir/msft-fonts.zip + +RUN \ ## clenaup - yum clean all && rm -rf /var/lib/yum/* + echo ">>> CLEANUP <<" && \ + apt-get autoclean && apt-get autoremove + +# make a clean image +FROM base + +LABEL os="debian 8" \ + java="1.8" \ + container.description="java and ffmpeg" \ + image.source="https://github.com/jrottenberg/ffmpeg/tree/master/docker-images" \ + version="1.0.0" \ + maintainer="devops " \ + imagename="java-ffmpeg" \ + test.command=" java -version 2>&1 | grep 'java version' | sed -e 's/.*java version "\(.*\)".*/\1/'" \ + test.command.verify="1.8" -ENV LD_LIBRARY_PATH=/usr/local/lib64 +ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib -#CMD ["/bin/bash"] +# copy all content from build-ffmpeg +COPY --from=build-ffmpeg /usr/local/ /usr/local/ diff --git a/Dockerfile-debug b/Dockerfile-debug index a06331f..48c2d4b 100644 --- a/Dockerfile-debug +++ b/Dockerfile-debug @@ -1,31 +1,30 @@ -FROM aemdesign/oracle-jdk:latest +FROM aemdesign/oracle-jdk:jdk11-arm as base -MAINTAINER devops +RUN dnf -y install libgomp && \ + dnf clean all; -LABEL container.version="1.0" \ - os.version="centos 7" \ - java.version="oracle 8" \ - container.description="base image for aem" \ - image.source="https://github.com/jrottenberg/ffmpeg/tree/master/docker-images" \ - description="DEBUG VERSION" +FROM base AS build -ARG PKG_CONFIG_PATH=/opt/ffmpeg/lib/pkgconfig -ARG LD_LIBRARY_PATH=/opt/ffmpeg/lib -ARG PREFIX=/opt/ffmpeg -ARG MAKEFLAGS="-j2" +WORKDIR /tmp/workdir -ENV FFMPEG_VERSION="4.0" \ - FFMPEG_GPGKEY="D67658D8" \ +ENV FFMPEG_VERSION="4.3.2" \ + AOM_VERSION="v1.0.0" \ FDKAAC_VERSION="0.1.5" \ + FONTCONFIG_VERSION="2.12.4" \ + FFMPEG_GPGKEY="D67658D8" \ FREETYPE_VERSION="2.9.1" \ - FREETYPE_SHA256SUM="ec391504e55498adceb30baceebd147a6e963f636eb617424bcfc47a169898ce" \ + FREETYPE_SHA256="ec391504e55498adceb30baceebd147a6e963f636eb617424bcfc47a169898ce" \ FRIBIDI_VERSION="0.19.7" \ - FRIBIDI_SHA256SUM="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8" \ - FONTCONFIG_VERSION="2.12.4" \ + FRIBIDI_SHA256="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8" \ + KVAZAAR_VERSION="2.0.0" \ LAME_MAJORVERSION="3.100" \ LAME_VERSION="3.100" \ LIBASS_VERSION="0.13.7" \ - LIBASS_SHA256SUM="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7" \ + LIBASS_SHA256="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7" \ + LIBPTHREAD_STUBS_VERSION=0.4 \ + LIBVIDSTAB_VERSION="1.1.0" \ + LIBVIDSTAB_SHA256="14d2a053e56edad4f397be0cb3ef8eb1ec3150404ce99a426c4eb641861dc0bb" \ + LIBXCB_VERSION=1.13.1 \ OGG_VERSION="1.3.2" \ OGG_SHA256="e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd41011d73a654692" \ OPENCOREAMR_VERSION="0.1.5" \ @@ -36,48 +35,95 @@ ENV FFMPEG_VERSION="4.0" \ THEORA_SHA256="40952956c47811928d1e7922cda3bc1f427eb75680c3c37249c91e949054916b" \ VORBIS_VERSION="1.3.5" \ VORBIS_SHA256="6efbcecdd3e5dfbf090341b485da9d176eb250d893e3eb378c428a2db38301ce" \ - VPX_VERSION="1.7.0" \ + VPX_VERSION="1.8.0" \ + WEBP_VERSION=1.0.2 \ X264_VERSION="20170226-2245-stable" \ - X265_VERSION="2.3" \ - XVID_VERSION="1.3.4" \ - XVID_SHA256="4e9fd62728885855bc5007fe1be58df42e5e274497591fec37249e1052ae316f" \ - YASM_VERSION="1.3.0" \ - LIBVIDSTAB_VERSION="1.1.0" \ - LIBVIDSTAB_SHA256SUM="14d2a053e56edad4f397be0cb3ef8eb1ec3150404ce99a426c4eb641861dc0bb" \ - KVAZAAR_VERSION="1.2.0" \ - AOM_VERSION="master" \ + X265_VERSION="3.1.1" \ + XAU_VERSION=1.0.9 \ + XORG_MACROS_VERSION=1.19.2 \ + XPROTO_VERSION=7.0.31 \ + XVID_VERSION="1.3.5" \ + XVID_SHA256="165ba6a2a447a8375f7b06db5a3c91810181f2898166e7c8137401d7fc894cf0" \ + LIBXML2_VERSION="2.9.10" \ + LIBXML2_SHA256="f07dab13bf42d2b8db80620cce7419b3b87827cc937c8bb20fe13b8571ee9501" \ + LIBBLURAY_VERSION="1.1.2" \ + LIBBLURAY_SHA256="a3dd452239b100dc9da0d01b30e1692693e2a332a7d29917bf84bb10ea7c0b42" \ + LIBZMQ_VERSION="4.3.2" \ + LIBZMQ_SHA256="02ecc88466ae38cf2c8d79f09cfd2675ba299a439680b64ade733e26a349edeb" \ + LIBARIBB24_VERSION="1.0.3" \ + LIBARIBB24_SHA256="f61560738926e57f9173510389634d8c06cabedfa857db4b28fb7704707ff128" \ SRC="/usr/local" -ENV OGG_SHA256SUM="${OGG_SHA256} libogg-${OGG_VERSION}.tar.gz" \ - OPUS_SHA256SUM="${OPUS_SHA256} opus-${OPUS_VERSION}.tar.gz" \ - THEORA_SHA256SUM="${THEORA_SHA256} libtheora-${THEORA_VERSION}.tar.gz" \ - VORBIS_SHA256SUM="${VORBIS_SHA256} libvorbis-${VORBIS_VERSION}.tar.gz" \ - XVID_SHA256SUM="${XVID_SHA256} xvidcore-${XVID_VERSION}.tar.gz" \ - FREETYPE_SHA256SUM="${FREETYPE_SHA256SUM} freetype-${FREETYPE_VERSION}.tar.gz" \ - LIBVIDSTAB_SHA256SUM="${LIBVIDSTAB_SHA256SUM} v${LIBVIDSTAB_VERSION}.tar.gz" \ - LIBASS_SHA256SUM="${LIBASS_SHA256SUM} ${LIBASS_VERSION}.tar.gz" \ - FRIBIDI_SHA256SUM="${FRIBIDI_SHA256SUM} fribidi-${FRIBIDI_VERSION}.tar.gz" +ENV FREETYPE_SHA256SUM="${FREETYPE_SHA256} freetype-${FREETYPE_VERSION}.tar.gz" \ + FRIBIDI_SHA256SUM="${FRIBIDI_SHA256} ${FRIBIDI_VERSION}.tar.gz" \ + LIBASS_SHA256SUM="${LIBASS_SHA256} ${LIBASS_VERSION}.tar.gz" \ + LIBVIDSTAB_SHA256SUM="${LIBVIDSTAB_SHA256} v${LIBVIDSTAB_VERSION}.tar.gz" \ + OGG_SHA256SUM="${OGG_SHA256} libogg-${OGG_VERSION}.tar.gz" \ + OPUS_SHA256SUM="${OPUS_SHA256} opus-${OPUS_VERSION}.tar.gz" \ + THEORA_SHA256SUM="${THEORA_SHA256} libtheora-${THEORA_VERSION}.tar.gz" \ + VORBIS_SHA256SUM="${VORBIS_SHA256} libvorbis-${VORBIS_VERSION}.tar.gz" \ + XVID_SHA256SUM="${XVID_SHA256} xvidcore-${XVID_VERSION}.tar.gz" \ + LIBXML2_SHA256SUM="${LIBXML2_SHA256} libxml2-v${LIBXML2_VERSION}.tar.gz" \ + LIBBLURAY_SHA256SUM="${LIBBLURAY_SHA256} libbluray-${LIBBLURAY_VERSION}.tar.bz2" \ + LIBZMQ_SHA256SUM="${LIBZMQ_SHA256} v${LIBZMQ_VERSION}.tar.gz" \ + LIBARIBB24_SHA256SUM="${LIBARIBB24_SHA256} v${LIBARIBB24_VERSION}.tar.gz" \ + PATH="$PATH:${PREFIX}/bin" -WORKDIR /tmp/workdir +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig" +ARG LD_LIBRARY_PATH=/opt/ffmpeg/lib +ARG PREFIX=/opt/ffmpeg +ARG MAKEFLAGS="-j2" +ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" #https://docs.google.com/uc?id=0B3Uxax626E5DOVdJNjc0TW9Mbmc&export=download COPY msft-fonts.zip ./ -RUN \ +RUN buildDeps="autoconf \ + automake \ + bzip2 \ + cmake \ + diffutils \ + expat-devel \ + gcc \ + gcc-c++ \ + git \ + gperf \ + libtool \ + make \ + nasm \ + perl \ + python3 \ + openssl-devel \ + tar \ + diffutils \ + which \ + zlib-devel \ + freetype-devel \ + cmake3 \ + pkgconfig \ + expat-devel \ + libgomp \ + libXext-devel \ + libXfixes-devel \ + unzip \ + yasm \ + which \ + wget" && \ echo "${SRC}/lib" > /etc/ld.so.conf.d/libc.conf && \ - yum install -y --enablerepo=extras epel-release && \ - yum install -y autoconf automake bzip2 freetype-devel gcc gcc-c++ git libtool make cmake3 nasm pkgconfig expat-devel gperf libgomp \ - zlib-devel libXext-devel libXfixes-devel perl openssl-devel tar yasm which unzip wget && \ - #make cmake3 be default cmake - ln -sf /usr/bin/cmake3 /usr/bin/cmake && \ - ln -sf /usr/bin/cpack3 /usr/bin/cpack && \ - ln -sf /usr/bin/ctest3 /usr/bin/ctest - + dnf update -y && \ + dnf repolist && \ + dnf --enablerepo=extras install -y epel-release dnf-plugins-core && \ + dnf config-manager --set-enabled powertools && \ + dnf --enablerepo=powertools install -y ${buildDeps} && \ + dnf repolist && \ + alternatives --set python /usr/bin/python3 +# SETUP FFMPEG LIBRARIES AND FFMPEG RUN \ ## opencore-amr https://sourceforge.net/projects/opencore-amr/ + echo ">>> BUILD: opencore-amr <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ - curl -sL https://sourceforge.mirrorservice.org/o/op/opencore-amr/opencore-amr/opencore-amr-${OPENCOREAMR_VERSION}.tar.gz | \ + curl -sL https://versaweb.dl.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-${OPENCOREAMR_VERSION}.tar.gz | \ tar -zx --strip-components=1 && \ ./configure --prefix="${PREFIX}" --enable-shared && \ make && \ @@ -85,6 +131,7 @@ RUN \ rm -rf ${DIR} RUN \ ## x264 http://www.videolan.org/developers/x264.html + echo ">>> BUILD: x264 <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ curl -sL https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-${X264_VERSION}.tar.bz2 | \ tar -jx --strip-components=1 && \ @@ -94,6 +141,7 @@ RUN \ rm -rf ${DIR} RUN \ ## x265 http://x265.org/ + echo ">>> BUILD: x265 <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ curl -sL https://download.videolan.org/pub/videolan/x265/x265_${X265_VERSION}.tar.gz | \ tar -zx && \ @@ -105,6 +153,7 @@ RUN \ rm -rf ${DIR} RUN \ ## libogg https://www.xiph.org/ogg/ + echo ">>> BUILD: ogg <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ curl -sLO http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz && \ echo ${OGG_SHA256SUM} | sha256sum --check && \ @@ -115,8 +164,9 @@ RUN \ rm -rf ${DIR} RUN \ ## libopus https://www.opus-codec.org/ + echo ">>> BUILD: opus <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ - curl -sLO http://downloads.xiph.org/releases/opus/opus-${OPUS_VERSION}.tar.gz && \ + curl -sLO https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz && \ echo ${OPUS_SHA256SUM} | sha256sum --check && \ tar -zx --strip-components=1 -f opus-${OPUS_VERSION}.tar.gz && \ autoreconf -fiv && \ @@ -126,6 +176,7 @@ RUN \ rm -rf ${DIR} RUN \ ## libvorbis https://xiph.org/vorbis/ + echo ">>> BUILD: vorbis <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ curl -sLO http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz && \ echo ${VORBIS_SHA256SUM} | sha256sum --check && \ @@ -136,26 +187,39 @@ RUN \ rm -rf ${DIR} RUN \ ## libtheora http://www.theora.org/ + echo ">>> BUILD: theora <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ curl -sLO http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.gz && \ echo ${THEORA_SHA256SUM} | sha256sum --check && \ tar -zx --strip-components=1 -f libtheora-${THEORA_VERSION}.tar.gz && \ - ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \ + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared --disable-examples && \ make && \ make install && \ rm -rf ${DIR} RUN \ ## libvpx https://www.webmproject.org/code/ + echo ">>> BUILD: libvpx <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ curl -sL https://codeload.github.com/webmproject/libvpx/tar.gz/v${VPX_VERSION} | \ tar -zx --strip-components=1 && \ - ./configure --prefix="${PREFIX}" --enable-vp8 --enable-vp9 --enable-pic --enable-shared \ + ./configure --prefix="${PREFIX}" --enable-vp8 --enable-vp9 --enable-vp9-highbitdepth --enable-pic --enable-shared \ --disable-debug --disable-examples --disable-docs --disable-install-bins && \ make && \ make install && \ rm -rf ${DIR} +RUN \ +### libwebp https://developers.google.com/speed/webp/ + echo ">>> BUILD: libwebp <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} RUN \ ## libmp3lame http://lame.sourceforge.net/ + echo ">>> BUILD: libmp3lame <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ curl -sL https://sourceforge.mirrorservice.org/l/la/lame/lame/${LAME_MAJORVERSION}/lame-${LAME_VERSION}.tar.gz | \ tar -zx --strip-components=1 && \ @@ -165,17 +229,19 @@ RUN \ rm -rf ${DIR} RUN \ ## xvid https://www.xvid.com/ + echo ">>> BUILD: xvid <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ curl -sLO http://downloads.xvid.org/downloads/xvidcore-${XVID_VERSION}.tar.gz && \ echo ${XVID_SHA256SUM} | sha256sum --check && \ tar -zx -f xvidcore-${XVID_VERSION}.tar.gz && \ cd xvidcore/build/generic && \ - ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --datadir="${DIR}" && \ + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" && \ make && \ make install && \ rm -rf ${DIR} RUN \ ## fdk-aac https://github.com/mstorsjo/fdk-aac + echo ">>> BUILD: fdk-aac <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ curl -sL https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC_VERSION}.tar.gz | \ tar -zx --strip-components=1 && \ @@ -183,10 +249,10 @@ RUN \ ./configure --prefix="${PREFIX}" --enable-shared --datadir="${DIR}" && \ make && \ make install && \ - make distclean && \ rm -rf ${DIR} RUN \ ## openjpeg https://github.com/uclouvain/openjpeg + echo ">>> BUILD: openjpeg <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ curl -sL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | \ tar -zx --strip-components=1 && \ @@ -196,8 +262,9 @@ RUN \ rm -rf ${DIR} RUN \ ## freetype https://www.freetype.org/ + echo ">>> BUILD: freetype <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ - curl -sLO https://jaist.dl.sourceforge.net/project/freetype/freetype2/${FREETYPE_VERSION}/freetype-${FREETYPE_VERSION}.tar.gz && \ + curl -sLO https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \ echo ${FREETYPE_SHA256SUM} | sha256sum --check && \ tar -zx --strip-components=1 -f freetype-${FREETYPE_VERSION}.tar.gz && \ ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ @@ -206,8 +273,9 @@ RUN \ rm -rf ${DIR} RUN \ ## libvstab https://github.com/georgmartius/vid.stab + echo ">>> BUILD: libvstab <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ - curl -sLO https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB_VERSION}.tar.gz &&\ + curl -sLO https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB_VERSION}.tar.gz && \ echo ${LIBVIDSTAB_SHA256SUM} | sha256sum --check && \ tar -zx --strip-components=1 -f v${LIBVIDSTAB_VERSION}.tar.gz && \ cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ @@ -216,62 +284,204 @@ RUN \ rm -rf ${DIR} RUN \ ## fridibi https://www.fribidi.org/ + echo ">>> BUILD: fribidi <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ - curl -sL -o fribidi-${FRIBIDI_VERSION}.tar.gz https://codeload.github.com/fribidi/fribidi/tar.gz/${FRIBIDI_VERSION} &&\ + curl -sLO https://github.com/fribidi/fribidi/archive/${FRIBIDI_VERSION}.tar.gz && \ echo ${FRIBIDI_SHA256SUM} | sha256sum --check && \ - tar -zx --strip-components=1 -f fribidi-${FRIBIDI_VERSION}.tar.gz && \ - sed -i 's/^SUBDIRS =.*/SUBDIRS=gen.tab charset lib/' Makefile.am && \ - ./bootstrap --no-config && \ - ./configure -prefix="${PREFIX}" --disable-static --enable-shared && \ - make && \ + tar -zx --strip-components=1 -f ${FRIBIDI_VERSION}.tar.gz && \ + sed -i 's/^SUBDIRS =.*/SUBDIRS=gen.tab charset lib bin/' Makefile.am && \ + ./bootstrap --no-config --auto && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make -j1 && \ make install && \ rm -rf ${DIR} RUN \ ## fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/ + echo ">>> BUILD: fontconfig <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ - curl -sLO https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.bz2 &&\ + curl -sLO https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \ tar -jx --strip-components=1 -f fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \ - ./configure -prefix="${PREFIX}" --disable-static --enable-shared && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ make && \ make install && \ rm -rf ${DIR} RUN \ ## libass https://github.com/libass/libass + echo ">>> BUILD: libass <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ - curl -sLO https://github.com/libass/libass/archive/${LIBASS_VERSION}.tar.gz &&\ + curl -sLO https://github.com/libass/libass/archive/${LIBASS_VERSION}.tar.gz && \ echo ${LIBASS_SHA256SUM} | sha256sum --check && \ tar -zx --strip-components=1 -f ${LIBASS_VERSION}.tar.gz && \ ./autogen.sh && \ - ./configure -prefix="${PREFIX}" --disable-static --enable-shared && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ make && \ make install && \ rm -rf ${DIR} RUN \ ## kvazaar https://github.com/ultravideo/kvazaar + echo ">>> BUILD: kvazaar <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ - curl -sLO https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR_VERSION}.tar.gz &&\ + curl -sLO https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR_VERSION}.tar.gz && \ tar -zx --strip-components=1 -f v${KVAZAAR_VERSION}.tar.gz && \ ./autogen.sh && \ - ./configure -prefix="${PREFIX}" --disable-static --enable-shared && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ make && \ make install && \ rm -rf ${DIR} RUN \ ## aomedia https://aomedia.googlesource.com/aom/ - DIR=$(mktemp -d) && cd ${DIR} && \ - curl -sLO https://aomedia.googlesource.com/aom/+archive/${AOM_VERSION}.tar.gz && \ - tar -zx -f ${AOM_VERSION}.tar.gz && \ + echo ">>> BUILD: aomedia <<" && \ + DIR=$(mktemp -d) && \ + git clone --branch ${AOM_VERSION} --depth 1 https://aomedia.googlesource.com/aom ${DIR} && \ + cd ${DIR} && \ rm -rf CMakeCache.txt CMakeFiles && \ mkdir -p ./aom_build && \ cd ./aom_build && \ - cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 -DENABLE_DOCS=0 .. && \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 .. && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## libxcb (and supporting libraries) for screen capture https://xcb.freedesktop.org/ + echo ">>> BUILD: libxcb <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://www.x.org/archive//individual/util/util-macros-${XORG_MACROS_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f util-macros-${XORG_MACROS_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + echo ">>> BUILD: xproto <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://www.x.org/archive/individual/proto/xproto-${XPROTO_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f xproto-${XPROTO_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + echo ">>> BUILD: libXau <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://www.x.org/archive/individual/lib/libXau-${XAU_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libXau-${XAU_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + echo ">>> BUILD: libpthread <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + echo ">>> BUILD: xcb-proto <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/xcb-proto-${XCBPROTO_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f xcb-proto-${XCBPROTO_VERSION}.tar.gz && \ + ACLOCAL_PATH="${PREFIX}/share/aclocal" ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + echo ">>> BUILD: libxcb <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/libxcb-${LIBXCB_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libxcb-${LIBXCB_VERSION}.tar.gz && \ + ACLOCAL_PATH="${PREFIX}/share/aclocal" ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## libxml2 - for libbluray + echo ">>> BUILD: libxml2 <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://gitlab.gnome.org/GNOME/libxml2/-/archive/v${LIBXML2_VERSION}/libxml2-v${LIBXML2_VERSION}.tar.gz && \ + echo ${LIBXML2_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f libxml2-v${LIBXML2_VERSION}.tar.gz && \ + ./autogen.sh --prefix="${PREFIX}" --with-ftp=no --with-http=no --with-python=no && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## libbluray - Requires libxml, freetype, and fontconfig + echo ">>> BUILD: libbluray <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://download.videolan.org/pub/videolan/libbluray/${LIBBLURAY_VERSION}/libbluray-${LIBBLURAY_VERSION}.tar.bz2 && \ + echo ${LIBBLURAY_SHA256SUM} | sha256sum --check && \ + tar -jx --strip-components=1 -f libbluray-${LIBBLURAY_VERSION}.tar.bz2 && \ + ./configure --prefix="${PREFIX}" --disable-examples --disable-bdjava-jar --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## libzmq https://github.com/zeromq/libzmq/ + echo ">>> BUILD: libzmq <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://github.com/zeromq/libzmq/archive/v${LIBZMQ_VERSION}.tar.gz && \ + echo ${LIBZMQ_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f v${LIBZMQ_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make check && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## libsrt https://github.com/Haivision/srt + echo ">>> BUILD: libsrt <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://github.com/Haivision/srt/archive/v${LIBSRT_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBSRT_VERSION}.tar.gz && \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## libpng + echo ">>> BUILD: libpng <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + git clone https://git.code.sf.net/p/libpng/code ${DIR} -b v${LIBPNG_VERSION} --depth 1 && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make check && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## libaribb24 + echo ">>> BUILD: libaribb24 <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://github.com/nkoriyama/aribb24/archive/v${LIBARIBB24_VERSION}.tar.gz && \ + echo ${LIBARIBB24_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f v${LIBARIBB24_VERSION}.tar.gz && \ + autoreconf -fiv && \ + ./configure CFLAGS="-I${PREFIX}/include -fPIC" --prefix="${PREFIX}" && \ make && \ make install && \ rm -rf ${DIR} RUN \ ## ffmpeg https://ffmpeg.org/ + echo ">>> BUILD: ffmpeg <<" && \ DIR=$(mktemp -d) && cd ${DIR} && \ curl -sLO https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ tar -jx --strip-components=1 -f ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ @@ -279,12 +489,15 @@ RUN \ --disable-debug \ --disable-doc \ --disable-ffplay \ + --disable-examples \ + --disable-unit-tests \ --enable-shared \ --enable-avresample \ --enable-libopencore-amrnb \ --enable-libopencore-amrwb \ --enable-gpl \ --enable-libass \ + --enable-fontconfig \ --enable-libfreetype \ --enable-libvidstab \ --enable-libfdk_aac \ @@ -294,6 +507,8 @@ RUN \ --enable-libtheora \ --enable-libvorbis \ --enable-libvpx \ + --enable-libwebp \ + --enable-libxcb \ --enable-libx264 \ --enable-libx265 \ --enable-libxvid \ @@ -303,43 +518,76 @@ RUN \ --enable-nonfree \ --enable-openssl \ --enable-libfdk_aac \ + --enable-libfdk-aac \ --enable-libkvazaar \ --enable-libaom --extra-libs=-lpthread \ --enable-postproc \ --enable-small \ --enable-version3 \ + --enable-libbluray \ + --enable-libzmq \ + --extra-libs=-ldl \ + --prefix="${PREFIX}" \ + --enable-libopenjpeg \ + --enable-libkvazaar \ + --enable-libaom \ + --extra-libs=-lpthread \ + --enable-libsrt \ + --enable-libaribb24 \ --enable-zlib \ --extra-cflags="-I${PREFIX}/include" \ --extra-ldflags="-L${PREFIX}/lib" \ - --extra-libs=-ldl \ - --prefix="${PREFIX}" && \ + echo "#disable all tests">tests/Makefile && \ make && \ make install && \ + make tools/zmqsend && cp tools/zmqsend ${PREFIX}/bin/ && \ make distclean && \ hash -r && \ cd tools && \ make qt-faststart && \ - cp qt-faststart ${PREFIX}/bin && \ + cp qt-faststart ${PREFIX}/bin/ && \ rm -rf ${DIR} RUN \ ## setup ffmpeg lib64 libs + echo ">>> SETUP: ffmpeg lib64 libs <<" && \ ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib64/ && \ + for lib in /usr/local/lib64/*.so.*; do ln -s "${lib##*/}" "${lib%%.so.*}".so; done && \ cp ${PREFIX}/bin/* /usr/local/bin/ && \ cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ LD_LIBRARY_PATH=/usr/local/lib64 ffmpeg -buildconf && \ - ldconfig -v && ffmpeg -buildconf && \ -#RUN \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib64/pkgconfig && \ + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/libsw*.pc; do \ + sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib64/pkgconfig/"${pc##*/}"; \ + done && \ + ldconfig -v && ffmpeg -buildconf + +RUN \ ## setup jre fallback fonts + echo ">>> SETUP: jre fallback fonts <<" && \ mkdir -p /usr/java/default/jre/lib/fonts/fallback && \ ln -s /usr/share/fonts/cjkuni-ukai/ukai.ttc /usr/java/default/jre/lib/fonts/fallback && \ ln -s /usr/share/fonts/cjkuni-uming/uming.ttc /usr/java/default/jre/lib/fonts/fallback && \ cd /tmp/workdir && unzip msft-fonts.zip && cp msft-fonts/* /usr/java/default/jre/lib/fonts/fallback/ && \ - rm -fr /tmp/workdir/msft-fonts /tmp/workdir/msft-fonts.zip && \ -#RUN \ + rm -fr /tmp/workdir/msft-fonts /tmp/workdir/msft-fonts.zip + +RUN \ ## clenaup - yum clean all && rm -rf /var/lib/yum/* + echo ">>> CLEANUP <<" && \ + dnf clean all && rm -rf /var/lib/yum/* + +FROM base + +LABEL os="debain" \ + container.description="java and ffmpeg" \ + image.source="https://github.com/jrottenberg/ffmpeg/tree/master/docker-images" \ + version="1.0.0" \ + maintainer="devops " \ + imagename="java-ffmpeg" \ + test.command=" java -version 2>&1 | grep 'java version' | sed -e 's/.*java version "\(.*\)".*/\1/'" \ + test.command.verify="11." -ENV LD_LIBRARY_PATH=/usr/local/lib64 +ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib -#CMD ["/bin/bash"] +COPY --from=build /usr/local/ /usr/local/ diff --git a/Dockerfile-serial b/Dockerfile-serial new file mode 100644 index 0000000..921c2ef --- /dev/null +++ b/Dockerfile-serial @@ -0,0 +1,646 @@ +FROM aemdesign/oracle-jdk:jdk11-arm as base + +RUN apt-get update -y && \ + apt-get install libgomp1 -y && \ + apt-get autoclean + +FROM base AS build + +WORKDIR /tmp/workdir + +ARG PREFIX=/opt/ffmpeg +ARG MAKEFLAGS="-j2" +ARG PKG_CONFIG_PATH="${PREFIX}/share/pkgconfig:${PREFIX}/lib:${PREFIX}/lib/pkgconfig:${PREFIX}/lib64/pkgconfig" +ARG LD_LIBRARY_PATH="${PREFIX}/lib:${PREFIX}/lib64" + +ENV FFMPEG_VERSION="5.0" \ + AOM_VERSION="v1.0.0" \ + CHROMAPRINT_VERSION="1.5.0" \ + FDKAAC_VERSION="0.1.5" \ + FONTCONFIG_VERSION="2.12.4" \ + FFMPEG_GPGKEY="D67658D8" \ + FREETYPE_VERSION="2.10.4" \ + FREETYPE_SHA256="5eab795ebb23ac77001cfb68b7d4d50b5d6c7469247b0b01b2c953269f658dac" \ + FRIBIDI_VERSION="0.19.7" \ + FRIBIDI_SHA256="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8" \ + KVAZAAR_VERSION="2.0.0" \ + LAME_MAJORVERSION="3.100" \ + LAME_VERSION="3.100" \ + LIBASS_VERSION="0.13.7" \ + LIBASS_SHA256="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7" \ + LIBPTHREAD_STUBS_VERSION="0.4" \ + LIBVIDSTAB_VERSION="1.1.0" \ + LIBVIDSTAB_SHA256="14d2a053e56edad4f397be0cb3ef8eb1ec3150404ce99a426c4eb641861dc0bb" \ + LIBXCB_VERSION="1.14" \ + XCBPROTO_VERSION="1.14.1" \ + OGG_VERSION="1.3.2" \ + OGG_SHA256="e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd41011d73a654692" \ + OPENCOREAMR_VERSION="0.1.5" \ + OPUS_VERSION="1.2" \ + OPUS_SHA256="77db45a87b51578fbc49555ef1b10926179861d854eb2613207dc79d9ec0a9a9" \ + OPENJPEG_VERSION="2.1.2" \ + THEORA_VERSION="1.1.1" \ + THEORA_SHA256="40952956c47811928d1e7922cda3bc1f427eb75680c3c37249c91e949054916b" \ + VORBIS_VERSION="1.3.5" \ + VORBIS_SHA256="6efbcecdd3e5dfbf090341b485da9d176eb250d893e3eb378c428a2db38301ce" \ + VPX_VERSION="1.8.0" \ + WEBP_VERSION="1.0.2" \ + X264_VERSION="20191217-2245-stable" \ + X265_VERSION="3.4" \ + XAU_VERSION="1.0.9" \ + XORG_MACROS_VERSION="1.19.2" \ + XPROTO_VERSION="7.0.31" \ + XVID_VERSION="1.3.5" \ + XVID_SHA256="165ba6a2a447a8375f7b06db5a3c91810181f2898166e7c8137401d7fc894cf0" \ + LIBXML2_VERSION="2.9.12" \ + LIBBLURAY_VERSION="1.1.2" \ + LIBBLURAY_SHA256="a3dd452239b100dc9da0d01b30e1692693e2a332a7d29917bf84bb10ea7c0b42" \ + LIBZMQ_VERSION="4.3.2" \ + LIBZMQ_SHA256="02ecc88466ae38cf2c8d79f09cfd2675ba299a439680b64ade733e26a349edeb" \ + LIBSRT_VERSION="1.4.1" \ + LIBARIBB24_VERSION="1.0.3" \ + LIBARIBB24_SHA256="f61560738926e57f9173510389634d8c06cabedfa857db4b28fb7704707ff128" \ + LIBPNG_VERSION="1.6.9" \ + LIBVMAF_VERSION="2.3.0" \ + PYTHON_VERSION="3.10.2" \ + PYTHON_VERSION_ALT="3.10" \ + SRC="/usr/local" + + +ENV FREETYPE_SHA256SUM="${FREETYPE_SHA256} freetype-${FREETYPE_VERSION}.tar.gz" \ + FRIBIDI_SHA256SUM="${FRIBIDI_SHA256} ${FRIBIDI_VERSION}.tar.gz" \ + LIBASS_SHA256SUM="${LIBASS_SHA256} ${LIBASS_VERSION}.tar.gz" \ + LIBVIDSTAB_SHA256SUM="${LIBVIDSTAB_SHA256} v${LIBVIDSTAB_VERSION}.tar.gz" \ + OGG_SHA256SUM="${OGG_SHA256} libogg-${OGG_VERSION}.tar.gz" \ + OPUS_SHA256SUM="${OPUS_SHA256} opus-${OPUS_VERSION}.tar.gz" \ + THEORA_SHA256SUM="${THEORA_SHA256} libtheora-${THEORA_VERSION}.tar.gz" \ + VORBIS_SHA256SUM="${VORBIS_SHA256} libvorbis-${VORBIS_VERSION}.tar.gz" \ + XVID_SHA256SUM="${XVID_SHA256} xvidcore-${XVID_VERSION}.tar.gz" \ + LIBBLURAY_SHA256SUM="${LIBBLURAY_SHA256} libbluray-${LIBBLURAY_VERSION}.tar.bz2" \ + LIBZMQ_SHA256SUM="${LIBZMQ_SHA256} v${LIBZMQ_VERSION}.tar.gz" \ + LIBARIBB24_SHA256SUM="${LIBARIBB24_SHA256} v${LIBARIBB24_VERSION}.tar.gz" \ + PATH="$PATH:${PREFIX}/bin" + + + +#https://docs.google.com/uc?id=0B3Uxax626E5DOVdJNjc0TW9Mbmc&export=download +COPY msft-fonts.zip ./ + +RUN echo ">>> INSTALL: os packages <<" && \ + buildDeps="autoconf \ + automake \ + bzip2 \ + cmake \ + diffutils \ + libexpat1-dev \ + build-essential \ + gcc \ + git \ + gperf \ + libtool \ + make \ + nasm \ + perl \ + libssl-dev \ + tar \ + diffutils \ + zlib1g-dev \ + libfreetype-dev \ + libunistring-dev \ + pkg-config \ + libxext-dev \ + libxfixes-dev \ + unzip \ + yasm \ + tzdata \ + wget" && \ + echo "${SRC}/lib" > /etc/ld.so.conf.d/libc.conf && \ + apt-get update -y && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y ${buildDeps} + +RUN \ + echo ">>> INSTALL: latest python <<" && \ + apt install software-properties-common -y && \ + add-apt-repository ppa:deadsnakes/ppa -y && \ + apt install python3.9 python3-pip -y && \ + update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1 && \ + update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1 && \ + update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 && \ + echo ">>> INSTALL: python libraries <<" && \ + pip3 install --upgrade pip && \ + pip3 install scikit-build meson ninja + +RUN \ +## libvmaf https://github.com/Netflix/vmaf + echo ">>> BUILD: vmaf <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + cd libvmaf && \ + meson build --default-library=both --buildtype=release -Denable_tests=false -Denable_docs=false -Dbuilt_in_models=true --prefix=${PREFIX} --libdir=lib && \ + ninja -vC build && \ + ninja -vC build install && \ + mkdir -p ${PREFIX}/share/model/ && \ + cp -r ${DIR}/model/* ${PREFIX}/share/model/ && \ + rm -rf ${DIR} + +RUN \ +## opencore-amr https://sourceforge.net/projects/opencore-amr/ + echo ">>> BUILD: opencore-amr <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sL https://sourceforge.net/projects/opencore-amr/files/opencore-amr/opencore-amr-${OPENCOREAMR_VERSION}.tar.gz/download | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## x264 http://www.videolan.org/developers/x264.html + echo ">>> BUILD: x264 <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sL https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-${X264_VERSION}.tar.bz2 | \ + tar -jx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared --enable-pic --disable-cli && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## x265 http://x265.org/ + echo ">>> BUILD: x265 <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sL https://github.com/videolan/x265/archive/refs/tags/${X265_VERSION}.tar.gz | \ + tar -zx && \ + cd x265-${X265_VERSION}/build/linux && \ + sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\${PREFIX}/" multilib.sh && \ + sed -i "/-DEXTRA_LIB/ s/$/ -DENABLE_SHARED:bool=off/" multilib.sh && \ + sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh && \ + sed -i '/^cmake/ s/$/ -DCMAKE_CXX_FLAGS=\"-fPIC\"/' multilib.sh && \ + sed -i '/^cmake/ s/$/ -DCROSS_COMPILE_ARM=ON/' multilib.sh && \ + sed -i '/^cmake/ s/$/ -DENABLE_ASSEMBLY=OFF/' multilib.sh && \ + sed -i '/^cmake/ s/$/ -DCMAKE_SYSTEM_PROCESSOR=aarch64/' multilib.sh && \ + sed -i '/^cd 12bit/ s/$/ \&\& echo MAKE 12bit/' multilib.sh && \ + sed -i '/^cd 10bit/ s/$/ \&\& echo MAKE 10bit/' multilib.sh && \ + sed -i '/^cd 8bit/ s/$/ \&\& echo MAKE 8bit/' multilib.sh && \ + cat multilib.sh && \ + echo `uname` && \ + ./multilib.sh && \ + make -C 8bit install && \ + rm -rf ${DIR} + +RUN \ +## libogg https://www.xiph.org/ogg/ + echo ">>> BUILD: ogg <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz && \ + echo ${OGG_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libogg-${OGG_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## libopus https://www.opus-codec.org/ + echo ">>> BUILD: opus <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz && \ + echo ${OPUS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f opus-${OPUS_VERSION}.tar.gz && \ + autoreconf -fiv && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## libvorbis https://xiph.org/vorbis/ + echo ">>> BUILD: vorbis <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz && \ + echo ${VORBIS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libvorbis-${VORBIS_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## libvpx https://www.webmproject.org/code/ + echo ">>> BUILD: libvpx <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sL https://codeload.github.com/webmproject/libvpx/tar.gz/v${VPX_VERSION} | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-vp8 --enable-vp9 --enable-vp9-highbitdepth --enable-pic --enable-shared \ + --disable-debug --disable-examples --disable-docs --disable-install-bins && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +### libwebp https://developers.google.com/speed/webp/ + echo ">>> BUILD: libwebp <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## libmp3lame http://lame.sourceforge.net/ + echo ">>> BUILD: libmp3lame <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sL https://sourceforge.net/projects/lame/files/lame/${LAME_VERSION}/lame-${LAME_VERSION}.tar.gz/download | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## xvid https://www.xvid.com/ + echo ">>> BUILD: xvid <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO http://downloads.xvid.org/downloads/xvidcore-${XVID_VERSION}.tar.gz && \ + echo ${XVID_SHA256SUM} | sha256sum --check && \ + tar -zx -f xvidcore-${XVID_VERSION}.tar.gz && \ + cd xvidcore/build/generic && \ + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## fdk-aac https://github.com/mstorsjo/fdk-aac + echo ">>> BUILD: fdk-aac <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sL https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + autoreconf -fiv && \ + ./configure --prefix="${PREFIX}" --enable-shared --datadir="${DIR}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## openjpeg https://github.com/uclouvain/openjpeg + echo ">>> BUILD: openjpeg <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DCMAKE_C_FLAGS="-DPNG_ARM_NEON_OPT=0" . && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## freetype https://www.freetype.org/ + echo ">>> BUILD: freetype <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \ + echo ${FREETYPE_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f freetype-${FREETYPE_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## libvstab https://github.com/georgmartius/vid.stab + echo ">>> BUILD: libvstab <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB_VERSION}.tar.gz && \ + echo ${LIBVIDSTAB_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f v${LIBVIDSTAB_VERSION}.tar.gz && \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DSSE2_FOUND=False . && \ + ls -l && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## fridibi https://www.fribidi.org/ + echo ">>> BUILD: fribidi <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://github.com/fribidi/fribidi/archive/${FRIBIDI_VERSION}.tar.gz && \ + echo ${FRIBIDI_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f ${FRIBIDI_VERSION}.tar.gz && \ + sed -i 's/^SUBDIRS =.*/SUBDIRS=gen.tab charset lib bin/' Makefile.am && \ + ./bootstrap --no-config --auto && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make -j1 && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/ + echo ">>> BUILD: fontconfig <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \ + tar -jx --strip-components=1 -f fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## libass https://github.com/libass/libass + echo ">>> BUILD: libass <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://github.com/libass/libass/archive/${LIBASS_VERSION}.tar.gz && \ + echo ${LIBASS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f ${LIBASS_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## kvazaar https://github.com/ultravideo/kvazaar + echo ">>> BUILD: kvazaar <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f v${KVAZAAR_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## aomedia https://aomedia.googlesource.com/aom/ + echo ">>> BUILD: aomedia <<" && \ + DIR=$(mktemp -d) && \ + git clone --branch "v3.2.0" --depth 1 https://aomedia.googlesource.com/aom ${DIR} && \ + cd ${DIR} && \ + rm -rf CMakeCache.txt CMakeFiles && \ + mkdir -p ./aom_build && \ + cd ./aom_build && \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 -DAOM_EXTRA_C_FLAGS="-fPIC" -DENABLE_DOCS=0 -DENABLE_TESTS=0 .. && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## libxcb (and supporting libraries) for screen capture https://xcb.freedesktop.org/ + echo ">>> BUILD: libxcb <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://www.x.org/archive//individual/util/util-macros-${XORG_MACROS_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f util-macros-${XORG_MACROS_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + echo ">>> BUILD: xproto <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://www.x.org/archive/individual/proto/xproto-${XPROTO_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f xproto-${XPROTO_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" --build=aarch64-unknown-linux-gnu && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + echo ">>> BUILD: libXau <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://www.x.org/archive/individual/lib/libXau-${XAU_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libXau-${XAU_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + echo ">>> BUILD: libpthread <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + echo ">>> BUILD: xcb-proto <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://xorg.freedesktop.org/archive/individual/proto/xcb-proto-${XCBPROTO_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f xcb-proto-${XCBPROTO_VERSION}.tar.gz && \ + ACLOCAL_PATH="${PREFIX}/share/aclocal" ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + echo ">>> BUILD: libxcb <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/libxcb-${LIBXCB_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libxcb-${LIBXCB_VERSION}.tar.gz && \ + ACLOCAL_PATH="${PREFIX}/share/aclocal" ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## libxml2 - for libbluray + echo ">>> BUILD: libxml2 <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sL https://github.com/GNOME/libxml2/archive/refs/tags/v${LIBXML2_VERSION}.tar.gz | \ + tar -xz --strip-components=1 && \ + ./autogen.sh --prefix="${PREFIX}" --with-ftp=no --with-http=no --with-python=no && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## libbluray - Requires libxml, freetype, and fontconfig + echo ">>> BUILD: libbluray <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://download.videolan.org/pub/videolan/libbluray/${LIBBLURAY_VERSION}/libbluray-${LIBBLURAY_VERSION}.tar.bz2 && \ + echo ${LIBBLURAY_SHA256SUM} | sha256sum --check && \ + tar -jx --strip-components=1 -f libbluray-${LIBBLURAY_VERSION}.tar.bz2 && \ + ./configure --prefix="${PREFIX}" --disable-examples --disable-bdjava-jar --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## libzmq https://github.com/zeromq/libzmq/ + echo ">>> BUILD: libzmq <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://github.com/zeromq/libzmq/archive/v${LIBZMQ_VERSION}.tar.gz && \ + echo ${LIBZMQ_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f v${LIBZMQ_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make check && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## libsrt https://github.com/Haivision/srt + echo ">>> BUILD: libsrt <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://github.com/Haivision/srt/archive/v${LIBSRT_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBSRT_VERSION}.tar.gz && \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## libpng + echo ">>> BUILD: libpng <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + git clone https://git.code.sf.net/p/libpng/code ${DIR} -b v${LIBPNG_VERSION} --depth 1 && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make check && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## libaribb24 + echo ">>> BUILD: libaribb24 <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://github.com/nkoriyama/aribb24/archive/v${LIBARIBB24_VERSION}.tar.gz && \ + echo ${LIBARIBB24_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f v${LIBARIBB24_VERSION}.tar.gz && \ + autoreconf -fiv && \ + ./configure CFLAGS="-I${PREFIX}/include -fPIC" --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## libtheora http://www.theora.org/ + echo ">>> BUILD: theora <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.gz && \ + echo ${THEORA_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libtheora-${THEORA_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared --disable-examples --build=aarch64-unknown-linux-gnu && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ +## ffmpeg https://ffmpeg.org/ + echo ">>> BUILD: ffmpeg <<" && \ + DIR=$(mktemp -d) && cd ${DIR} && \ + curl -sLO https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + tar -jx --strip-components=1 -f ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + export PKG_CONFIG_PATH="${PREFIX}/lib:${PREFIX}/lib/pkgconfig" && \ + ./configure \ + --arch=aarch64 \ + --enable-cross-compile \ + --disable-debug \ + --disable-doc \ + --disable-ffplay \ + --disable-shared \ + --enable-fontconfig \ + --enable-gpl \ + --enable-libaom \ + --enable-libaribb24 \ + --enable-libass \ + --enable-libbluray \ + --enable-libfdk_aac \ + --enable-libfreetype \ + --enable-libkvazaar \ + --enable-libmp3lame \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ + --enable-libopenjpeg \ + --enable-libopus \ + --enable-libsrt \ + --enable-libtheora \ + --enable-libvidstab \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libvmaf \ + --enable-libwebp \ + --enable-libx264 \ + --enable-libx265 \ + --enable-libxcb \ + --enable-libxvid \ + --enable-libzmq \ + --enable-nonfree \ + --enable-openssl \ + --enable-postproc \ + --enable-shared \ + --enable-small \ + --enable-version3 \ + --enable-zlib \ + --extra-cflags="-I${PREFIX}/include" \ + --extra-cxxflags="-I${PREFIX}/include" \ + --extra-ldflags="-L${PREFIX}/lib" \ + --extra-libs="-lm -lpthread" \ + --ld="g++" \ + --pkg-config-flags="--static" \ + --prefix="${PREFIX}" && \ + echo "#disable all tests">./tests/Makefile && \ + make clean && \ + make && \ + make install && \ + make tools/zmqsend && cp tools/zmqsend ${PREFIX}/bin/ && \ + make distclean && \ + hash -r && \ + cd tools && \ + make qt-faststart && \ + cp qt-faststart ${PREFIX}/bin/ && \ + rm -rf ${DIR} + +RUN \ +## setup ffmpeg lib64 libs + echo ">>> SETUP: ffmpeg lib64 libs <<" && \ + mkdir -p /usr/local/lib64/ && \ + ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib64/ && \ + for lib in /usr/local/lib64/*.so.*; do ln -s "${lib##*/}" "${lib%%.so.*}".so; done && \ + cp ${PREFIX}/bin/* /usr/local/bin/ && \ + cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ + LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib ffmpeg -buildconf && \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib64/pkgconfig && \ + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/libsw*.pc; do \ + sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib64/pkgconfig/"${pc##*/}"; \ + done && \ + ldconfig -v && ffmpeg -buildconf + +RUN \ +## setup jre fallback fonts + echo ">>> SETUP: jre fallback fonts <<" && \ + mkdir -p /usr/java/default/jre/lib/fonts/fallback && \ + ln -s /usr/share/fonts/cjkuni-ukai/ukai.ttc /usr/java/default/jre/lib/fonts/fallback && \ + ln -s /usr/share/fonts/cjkuni-uming/uming.ttc /usr/java/default/jre/lib/fonts/fallback && \ + cd /tmp/workdir && unzip msft-fonts.zip && cp msft-fonts/* /usr/java/default/jre/lib/fonts/fallback/ && \ + rm -fr /tmp/workdir/msft-fonts /tmp/workdir/msft-fonts.zip + +RUN \ +## clenaup + echo ">>> CLEANUP <<" && \ + apt-get autoclean && apt-get autoremove + + + +FROM base +ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH} + +LABEL os="debian 8" \ + java="1.8" \ + container.description="java and ffmpeg" \ + image.source="https://github.com/jrottenberg/ffmpeg/tree/master/docker-images" \ + version="1.0.0" \ + maintainer="devops " \ + imagename="java-ffmpeg" \ + test.command=" java -version 2>&1 | grep 'java version' | sed -e 's/.*java version "\(.*\)".*/\1/'" \ + test.command.verify="1.8" + +COPY --from=build /usr/local/ /usr/local/ diff --git a/Dockerfile-source b/Dockerfile-source new file mode 100644 index 0000000..6890790 --- /dev/null +++ b/Dockerfile-source @@ -0,0 +1,600 @@ +# ffmpeg - http://ffmpeg.org/download.html +# +# From https://trac.ffmpeg.org/wiki/CompilationGuide/Centos +# +# https://hub.docker.com/r/jrottenberg/ffmpeg/ +# +# +FROM centos:8 AS base + +RUN dnf -y install libgomp && \ + dnf clean all; + + +FROM base AS build + +WORKDIR /tmp/workdir + +ENV FFMPEG_VERSION=5.0 \ + AOM_VERSION=v1.0.0 \ + CHROMAPRINT_VERSION=1.5.0 \ + FDKAAC_VERSION=0.1.5 \ + FONTCONFIG_VERSION=2.12.4 \ + FREETYPE_VERSION=2.10.4 \ + FRIBIDI_VERSION=0.19.7 \ + KVAZAAR_VERSION=2.0.0 \ + LAME_VERSION=3.100 \ + LIBASS_VERSION=0.13.7 \ + LIBPTHREAD_STUBS_VERSION=0.4 \ + LIBVIDSTAB_VERSION=1.1.0 \ + LIBXCB_VERSION=1.13.1 \ + XCBPROTO_VERSION=1.13 \ + OGG_VERSION=1.3.2 \ + OPENCOREAMR_VERSION=0.1.5 \ + OPUS_VERSION=1.2 \ + OPENJPEG_VERSION=2.1.2 \ + THEORA_VERSION=1.1.1 \ + VORBIS_VERSION=1.3.5 \ + VPX_VERSION=1.8.0 \ + WEBP_VERSION=1.0.2 \ + X264_VERSION=20170226-2245-stable \ + X265_VERSION=3.4 \ + XAU_VERSION=1.0.9 \ + XORG_MACROS_VERSION=1.19.2 \ + XPROTO_VERSION=7.0.31 \ + XVID_VERSION=1.3.4 \ + LIBXML2_VERSION=2.9.12 \ + LIBBLURAY_VERSION=1.1.2 \ + LIBZMQ_VERSION=4.3.2 \ + LIBSRT_VERSION=1.4.1 \ + LIBARIBB24_VERSION=1.0.3 \ + LIBPNG_VERSION=1.6.9 \ + LIBVMAF_VERSION=2.1.1 \ + SRC=/usr/local + +ARG FREETYPE_SHA256SUM="5eab795ebb23ac77001cfb68b7d4d50b5d6c7469247b0b01b2c953269f658dac freetype-2.10.4.tar.gz" +ARG FRIBIDI_SHA256SUM="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8 0.19.7.tar.gz" +ARG LIBASS_SHA256SUM="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7 0.13.7.tar.gz" +ARG LIBVIDSTAB_SHA256SUM="14d2a053e56edad4f397be0cb3ef8eb1ec3150404ce99a426c4eb641861dc0bb v1.1.0.tar.gz" +ARG OGG_SHA256SUM="e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd41011d73a654692 libogg-1.3.2.tar.gz" +ARG OPUS_SHA256SUM="77db45a87b51578fbc49555ef1b10926179861d854eb2613207dc79d9ec0a9a9 opus-1.2.tar.gz" +ARG THEORA_SHA256SUM="40952956c47811928d1e7922cda3bc1f427eb75680c3c37249c91e949054916b libtheora-1.1.1.tar.gz" +ARG VORBIS_SHA256SUM="6efbcecdd3e5dfbf090341b485da9d176eb250d893e3eb378c428a2db38301ce libvorbis-1.3.5.tar.gz" +ARG XVID_SHA256SUM="4e9fd62728885855bc5007fe1be58df42e5e274497591fec37249e1052ae316f xvidcore-1.3.4.tar.gz" +ARG LIBBLURAY_SHA256SUM="a3dd452239b100dc9da0d01b30e1692693e2a332a7d29917bf84bb10ea7c0b42 libbluray-1.1.2.tar.bz2" +ARG LIBZMQ_SHA256SUM="02ecc88466ae38cf2c8d79f09cfd2675ba299a439680b64ade733e26a349edeb v4.3.2.tar.gz" +ARG LIBARIBB24_SHA256SUM="f61560738926e57f9173510389634d8c06cabedfa857db4b28fb7704707ff128 v1.0.3.tar.gz" +ARG LIBVMAF_SHA256SUM="e7fc00ae1322a7eccfcf6d4f1cdf9c67eec8058709887c8c6c3795c617326f77 v2.1.1.tar.gz" + + +ARG LD_LIBRARY_PATH=/opt/ffmpeg/lib +ARG MAKEFLAGS="-j2" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig" +ARG PREFIX=/opt/ffmpeg +ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" + + +RUN buildDeps="autoconf \ + automake \ + bzip2 \ + cmake \ + diffutils \ + expat-devel \ + gcc \ + gcc-c++ \ + git \ + gperf \ + libtool \ + make \ + nasm \ + perl \ + python3 \ + openssl-devel \ + tar \ + yasm \ + which \ + zlib-devel" && \ + echo "${SRC}/lib" > /etc/ld.so.conf.d/libc.conf && \ + dnf --enablerepo=extras install -y epel-release && \ + dnf update -y && \ + dnf -y install dnf-plugins-core && \ + yum config-manager --set-enabled powertools && \ + dnf install -y ${buildDeps} && \ + alternatives --set python /usr/bin/python3 +## libvmaf https://github.com/Netflix/vmaf +RUN \ + if which meson || false; then \ + echo "Building VMAF." && \ + DIR=/tmp/vmaf && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + cd /tmp/vmaf/libvmaf && \ + meson build --buildtype release --prefix=${PREFIX} && \ + ninja -vC build && \ + ninja -vC build install && \ + mkdir -p ${PREFIX}/share/model/ && \ + cp -r /tmp/vmaf/model/* ${PREFIX}/share/model/ && \ + rm -rf ${DIR}; \ + else \ + echo "VMAF skipped."; \ + fi + +## opencore-amr https://sourceforge.net/projects/opencore-amr/ +RUN \ + DIR=/tmp/opencore-amr && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://sourceforge.net/projects/opencore-amr/files/opencore-amr/opencore-amr-${OPENCOREAMR_VERSION}.tar.gz/download | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## x264 http://www.videolan.org/developers/x264.html +RUN \ + DIR=/tmp/x264 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-${X264_VERSION}.tar.bz2 | \ + tar -jx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared --enable-pic --disable-cli && \ + make && \ + make install && \ + rm -rf ${DIR} +### x265 http://x265.org/ +RUN \ + DIR=/tmp/x265 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/videolan/x265/archive/refs/tags/${X265_VERSION}.tar.gz | \ + tar -zx && \ + cd x265-${X265_VERSION}/build/linux && \ + sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\${PREFIX}/" multilib.sh && \ + sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh && \ + ./multilib.sh && \ + make -C 8bit install && \ + rm -rf ${DIR} +### libogg https://www.xiph.org/ogg/ +RUN \ + DIR=/tmp/ogg && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz && \ + echo ${OGG_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libogg-${OGG_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libopus https://www.opus-codec.org/ +RUN \ + DIR=/tmp/opus && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz && \ + echo ${OPUS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f opus-${OPUS_VERSION}.tar.gz && \ + autoreconf -fiv && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libvorbis https://xiph.org/vorbis/ +RUN \ + DIR=/tmp/vorbis && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz && \ + echo ${VORBIS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libvorbis-${VORBIS_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libtheora http://www.theora.org/ +RUN \ + DIR=/tmp/theora && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.gz && \ + echo ${THEORA_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libtheora-${THEORA_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libvpx https://www.webmproject.org/code/ +RUN \ + DIR=/tmp/vpx && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://codeload.github.com/webmproject/libvpx/tar.gz/v${VPX_VERSION} | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-vp8 --enable-vp9 --enable-vp9-highbitdepth --enable-pic --enable-shared \ + --disable-debug --disable-examples --disable-docs --disable-install-bins && \ + make && \ + make install && \ + rm -rf ${DIR} +### libwebp https://developers.google.com/speed/webp/ +RUN \ + DIR=/tmp/vebp && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libmp3lame http://lame.sourceforge.net/ +RUN \ + DIR=/tmp/lame && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://sourceforge.net/projects/lame/files/lame/${LAME_VERSION}/lame-${LAME_VERSION}.tar.gz/download | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ + make && \ + make install && \ + rm -rf ${DIR} +### xvid https://www.xvid.com/ +RUN \ + DIR=/tmp/xvid && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xvid.org/downloads/xvidcore-${XVID_VERSION}.tar.gz && \ + echo ${XVID_SHA256SUM} | sha256sum --check && \ + tar -zx -f xvidcore-${XVID_VERSION}.tar.gz && \ + cd xvidcore/build/generic && \ + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" && \ + make && \ + make install && \ + rm -rf ${DIR} +### fdk-aac https://github.com/mstorsjo/fdk-aac +RUN \ + DIR=/tmp/fdk-aac && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + autoreconf -fiv && \ + ./configure --prefix="${PREFIX}" --enable-shared --datadir="${DIR}" && \ + make && \ + make install && \ + rm -rf ${DIR} +## openjpeg https://github.com/uclouvain/openjpeg +RUN \ + DIR=/tmp/openjpeg && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} +## freetype https://www.freetype.org/ +RUN \ + DIR=/tmp/freetype && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \ + echo ${FREETYPE_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f freetype-${FREETYPE_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## libvstab https://github.com/georgmartius/vid.stab +RUN \ + DIR=/tmp/vid.stab && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB_VERSION}.tar.gz && \ + echo ${LIBVIDSTAB_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f v${LIBVIDSTAB_VERSION}.tar.gz && \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} +## fridibi https://www.fribidi.org/ +RUN \ + DIR=/tmp/fribidi && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/fribidi/fribidi/archive/${FRIBIDI_VERSION}.tar.gz && \ + echo ${FRIBIDI_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f ${FRIBIDI_VERSION}.tar.gz && \ + sed -i 's/^SUBDIRS =.*/SUBDIRS=gen.tab charset lib bin/' Makefile.am && \ + ./bootstrap --no-config --auto && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make -j1 && \ + make install && \ + rm -rf ${DIR} +## fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/ +RUN \ + DIR=/tmp/fontconfig && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \ + tar -jx --strip-components=1 -f fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## libass https://github.com/libass/libass +RUN \ + DIR=/tmp/libass && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/libass/libass/archive/${LIBASS_VERSION}.tar.gz && \ + echo ${LIBASS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f ${LIBASS_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## kvazaar https://github.com/ultravideo/kvazaar +RUN \ + DIR=/tmp/kvazaar && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f v${KVAZAAR_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/aom && \ + git clone --branch ${AOM_VERSION} --depth 1 https://aomedia.googlesource.com/aom ${DIR} ; \ + cd ${DIR} ; \ + rm -rf CMakeCache.txt CMakeFiles ; \ + mkdir -p ./aom_build ; \ + cd ./aom_build ; \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ..; \ + make ; \ + make install ; \ + rm -rf ${DIR} + +## libxcb (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +RUN \ + DIR=/tmp/xorg-macros && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.x.org/archive//individual/util/util-macros-${XORG_MACROS_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f util-macros-${XORG_MACROS_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/xproto && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.x.org/archive/individual/proto/xproto-${XPROTO_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f xproto-${XPROTO_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libXau && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.x.org/archive/individual/lib/libXau-${XAU_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libXau-${XAU_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libpthread-stubs && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libxcb-proto && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/xcb-proto-${XCBPROTO_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f xcb-proto-${XCBPROTO_VERSION}.tar.gz && \ + ACLOCAL_PATH="${PREFIX}/share/aclocal" ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libxcb && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/libxcb-${LIBXCB_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libxcb-${LIBXCB_VERSION}.tar.gz && \ + ACLOCAL_PATH="${PREFIX}/share/aclocal" ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libxml2 - for libbluray +RUN \ + DIR=/tmp/libxml2 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/GNOME/libxml2/archive/refs/tags/v${LIBXML2_VERSION}.tar.gz | \ + tar -xz --strip-components=1 && \ + ./autogen.sh --prefix="${PREFIX}" --with-ftp=no --with-http=no --with-python=no && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libbluray - Requires libxml, freetype, and fontconfig +RUN \ + DIR=/tmp/libbluray && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://download.videolan.org/pub/videolan/libbluray/${LIBBLURAY_VERSION}/libbluray-${LIBBLURAY_VERSION}.tar.bz2 && \ + echo ${LIBBLURAY_SHA256SUM} | sha256sum --check && \ + tar -jx --strip-components=1 -f libbluray-${LIBBLURAY_VERSION}.tar.bz2 && \ + ./configure --prefix="${PREFIX}" --disable-examples --disable-bdjava-jar --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libzmq https://github.com/zeromq/libzmq/ +RUN \ + DIR=/tmp/libzmq && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/zeromq/libzmq/archive/v${LIBZMQ_VERSION}.tar.gz && \ + echo ${LIBZMQ_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f v${LIBZMQ_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make check && \ + make install && \ + rm -rf ${DIR} + +## libsrt https://github.com/Haivision/srt +RUN \ + DIR=/tmp/srt && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Haivision/srt/archive/v${LIBSRT_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBSRT_VERSION}.tar.gz && \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libpng +RUN \ + DIR=/tmp/png && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + git clone https://git.code.sf.net/p/libpng/code ${DIR} -b v${LIBPNG_VERSION} --depth 1 && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make check && \ + make install && \ + rm -rf ${DIR} + +## libaribb24 +RUN \ + DIR=/tmp/b24 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/nkoriyama/aribb24/archive/v${LIBARIBB24_VERSION}.tar.gz && \ + echo ${LIBARIBB24_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f v${LIBARIBB24_VERSION}.tar.gz && \ + autoreconf -fiv && \ + ./configure CFLAGS="-I${PREFIX}/include -fPIC" --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +## Download ffmpeg https://ffmpeg.org/ +RUN \ + DIR=/tmp/ffmpeg && mkdir -p ${DIR} && cd ${DIR} && \ + curl -sLO https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + tar -jx --strip-components=1 -f ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ + make ; make install + + + + + +## Build ffmpeg https://ffmpeg.org/ +RUN \ + DIR=/tmp/ffmpeg && cd ${DIR} && \ + ./configure \ + --disable-debug \ + --disable-doc \ + --disable-ffplay \ + --enable-fontconfig \ + --enable-gpl \ + --enable-libaom \ + --enable-libaribb24 \ + --enable-libass \ + --enable-libbluray \ + --enable-libfdk_aac \ + --enable-libfreetype \ + --enable-libkvazaar \ + --enable-libmp3lame \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ + --enable-libopenjpeg \ + --enable-libopus \ + --enable-libsrt \ + --enable-libtheora \ + --enable-libvidstab \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libwebp \ + --enable-libx264 \ + --enable-libx265 \ + --enable-libxcb \ + --enable-libxvid \ + --enable-libzmq \ + --enable-nonfree \ + --enable-openssl \ + --enable-postproc \ + --enable-shared \ + --enable-small \ + --enable-version3 \ + --extra-cflags="-I${PREFIX}/include" \ + --extra-ldflags="-L${PREFIX}/lib" \ + --extra-libs=-ldl \ + --extra-libs=-lpthread \ + --prefix="${PREFIX}" && \ + make clean && \ + make && \ + make install && \ + make tools/zmqsend && cp tools/zmqsend ${PREFIX}/bin/ && \ + make distclean && \ + hash -r && \ + cd tools && \ + make qt-faststart && cp qt-faststart ${PREFIX}/bin/ + +RUN \ + ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib64/ && \ + for lib in /usr/local/lib64/*.so.*; do ln -s "${lib##*/}" "${lib%%.so.*}".so; done && \ + cp ${PREFIX}/bin/* /usr/local/bin/ && \ + cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ + LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib ffmpeg -buildconf && \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib64/pkgconfig && \ + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/libsw*.pc; do \ + sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib64/pkgconfig/"${pc##*/}"; \ + done + +FROM base +LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ + org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg + +ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib + +CMD ["--help"] +ENTRYPOINT ["ffmpeg"] + +COPY --from=build /usr/local/ /usr/local/ + +# Let's make sure the app built correctly +# Convenient to verify on https://hub.docker.com/r/jrottenberg/ffmpeg/builds/ console output diff --git a/README.md b/README.md index bcb7e0c..4ef68dc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -## CentOS 7 with Java and FFMPEG +## Debian with Java 8 and FFMPEG -[![build_status](https://travis-ci.org/aem-design/java-ffmpeg.svg?branch=master)](https://travis-ci.org/aem-design/java-ffmpeg) +[![build](https://github.com/aem-design/docker-java-ffmpeg/actions/workflows/build.yml/badge.svg?branch=jdk11)](https://github.com/aem-design/docker-java-ffmpeg/actions/workflows/build.yml) [![github license](https://img.shields.io/github/license/aem-design/java-ffmpeg)](https://github.com/aem-design/java-ffmpeg) [![github issues](https://img.shields.io/github/issues/aem-design/java-ffmpeg)](https://github.com/aem-design/java-ffmpeg) [![github last commit](https://img.shields.io/github/last-commit/aem-design/java-ffmpeg)](https://github.com/aem-design/java-ffmpeg) @@ -11,6 +11,15 @@ This is docker image based on [aemdesign/oracle-jdk](https://hub.docker.com/r/aemdesign/oracle-jdk/) with AEM base libs + +## Self Hosted runner + +To build and deploy this repo you will need to add a self-hosted runner. + +``` +docker run -d --restart always --name github-runner-aemdesign -e RUNNER_NAME_PREFIX="ghraemd" -e ACCESS_TOKEN="" -e RUNNER_WORKDIR="/tmp/github-runner-aemdesign" -e RUNNER_GROUP="self-hosted" -e RUNNER_SCOPE="org" -e ORG_NAME="aem-design" -e LABELS="aemdesign,github-runner" -v /var/run/docker.sock:/var/run/docker.sock -v ${PWD}:/tmp/github-runner-your-repo myoung34/github-runner:latest +``` + ### Included Packages Following is the list of packages included diff --git a/build-serial.ps1 b/build-serial.ps1 new file mode 100644 index 0000000..6fd4446 --- /dev/null +++ b/build-serial.ps1 @@ -0,0 +1,22 @@ +Param( + [string]$LOG_PATH = "${PWD}\logs", + [string]$LOG_PEFIX = "docker-serial", + [string]$LOG_SUFFIX = ".log", + [string]$TAG = "jdk11-arm-serial", + [string]$FILE = "Dockerfile-serial", + [string]$FUNCTIONS_URI = "https://github.com/aem-design/aemdesign-docker/releases/latest/download/functions.ps1", + [string]$COMMAND = "docker buildx build --platform linux/arm64 . -f .\${FILE} -t ${TAG}" +) + +$SKIP_CONFIG = $true +$PARENT_PROJECT_PATH = "." + +. ([Scriptblock]::Create((([System.Text.Encoding]::ASCII).getString((Invoke-WebRequest -Uri "${FUNCTIONS_URI}").Content)))) + +printSectionBanner "Building Image" +printSectionLine "$COMMAND" "warn" + +Invoke-Expression -Command "$COMMAND" | Tee-Object -Append -FilePath "${LOG_FILE}" + + + diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 0000000..82ce131 --- /dev/null +++ b/build.ps1 @@ -0,0 +1,22 @@ +Param( + [string]$LOG_PATH = "${PWD}\logs", + [string]$LOG_PEFIX = "docker", + [string]$LOG_SUFFIX = ".log", + [string]$TAG = "jdk11-arm", + [string]$FILE = "Dockerfile", + [string]$FUNCTIONS_URI = "https://github.com/aem-design/aemdesign-docker/releases/latest/download/functions.ps1", + [string]$COMMAND = "docker buildx build --platform linux/arm64 . -f .\${FILE} -t ${TAG}" +) + +$SKIP_CONFIG = $true +$PARENT_PROJECT_PATH = "." + +. ([Scriptblock]::Create((([System.Text.Encoding]::ASCII).getString((Invoke-WebRequest -Uri "${FUNCTIONS_URI}").Content)))) + +printSectionBanner "Building Image" +printSectionLine "$COMMAND" "warn" + +Invoke-Expression -Command "$COMMAND" | Tee-Object -Append -FilePath "${LOG_FILE}" + + + diff --git a/debug.ps1 b/debug.ps1 new file mode 100644 index 0000000..1ec08c7 --- /dev/null +++ b/debug.ps1 @@ -0,0 +1,21 @@ +Param( + [string]$LOG_PATH = "${PWD}\logs", + [string]$LOG_PEFIX = "docker", + [string]$LOG_SUFFIX = ".log", + [string]$TAG = "jdk11-arm", + [string]$FILE = "Dockerfile-debug", + [string]$FUNCTIONS_URI = "https://github.com/aem-design/aemdesign-docker/releases/latest/download/functions.ps1", + [string]$COMMAND = "docker buildx build --platform linux/arm64 . -f .\${FILE} -t ${TAG}" +) + +$SKIP_CONFIG = $true +$PARENT_PROJECT_PATH = "." + +. ([Scriptblock]::Create((([System.Text.Encoding]::ASCII).getString((Invoke-WebRequest -Uri "${FUNCTIONS_URI}").Content)))) + +printSectionBanner "Loading Debug Image" +printSectionLine "$COMMAND" "warn" + +$IMAGENAME=Select-String -path $FILE '.*imagename="(.*)".*' -AllMatches | Foreach-Object {$_.Matches} | Foreach-Object {$_.Groups[1].Value} + +docker run -it --rm -v ${PWD}:/build/source:rw aemdesign/java-buildpack bash --login diff --git a/docker-compose.yml b/docker-compose.yml index 11c337a..ed0ecff 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ aem-base: labels: ffmpeg.version: "2.8.3" ffmpeg.plugins: "yasm x264 x265 libogg libopus libvorbis libtheora libvpx libmp3lame faac xvid fdk-aac ffmpeg" - os.version: "centos 7" + os.version: "debian 7" java.version: "oracle 8" container.description: "aem instance, will run as author unless specified otherwise" container_name: "java-ffmpeg" diff --git a/test/run_tests.sh b/test/run_tests.sh new file mode 100644 index 0000000..a65320c --- /dev/null +++ b/test/run_tests.sh @@ -0,0 +1,133 @@ +#!/bin/bash +# +# The 'run' performs a simple test that verifies that STI image. +# The main focus is that the image prints out the base-usage properly. +# +# IMAGE_NAME specifies a name of the candidate image used for testing. +# The image has to be available before this script is executed. +# +IMAGE_NAME=${1:-aemdesign/java-ffmpeg:jdk11-arm} +FLAG_DEBUG=${2:-true} +IP=$(which ip) +if [[ -z $IP ]]; then + LOCAL_IP="localhost" +else + LOCAL_IP=$($IP route | awk '/default/ { print $3 }') +fi + + + +#debug(message,type[error,info,warning],newlinesiffix) +function debug { + + local DEFAULT_COLOR_WARN="\033[0;31;93m" #light yellow + local DEFAULT_COLOR_ERROR="\033[0;31;91m" #light red + local DEFAULT_COLOR_INFO="\033[0;31;94m" #light blue + local DEFAULT_COLOR_DEFAULT="\033[0;31;92m" #light green + local DEFAULT_COLOR_RESET="\033[0m" #light green + + COLOR_WARN="${COLOR_WARN:-$DEFAULT_COLOR_WARN}" #light yellow + COLOR_ERROR="${COLOR_ERROR:-$DEFAULT_COLOR_ERROR}" #light red + COLOR_INFO="${COLOR_INFO:-$DEFAULT_COLOR_INFO}" #light blue + COLOR_DEFAULT="${COLOR_DEFAULT:-$DEFAULT_COLOR_DEFAULT}" #light green + COLOR_RESET="${COLOR_RESET:-$DEFAULT_COLOR_RESET}" #light green + + LABEL_WARN="${LABEL_WARN:-*WARN*}" + LABEL_ERROR="${LABEL_ERROR:-*ERROR*}" + LABEL_INFO="${LABEL_INFO:-*INFO*}" + LABEL_DEFAULT="${LABEL_DEFAULT:-}" + + + COLOR_START="$COLOR_DEFAULT" + COLOR_END="$COLOR_RESET" + + local TEXT="${1:-}" + local TYPE="${2:-}" + local LABEL_TEXT="" + local TEXT_SUFFUX="" + local NEWLINESUFFUX=$3 + + if [ ! "$NEWLINESUFFUX" == "" ]; then + TEXT_SUFFUX="$NEWLINESUFFUX" + fi + + case $TYPE in + ("error") COLOR_START="$COLOR_ERROR" LABEL_TEXT="$LABEL_ERROR " COLOR_END="$COLOR_END";; + ("info") COLOR_START="$COLOR_INFO" LABEL_TEXT="$LABEL_INFO ";; + ("warn") COLOR_START="$COLOR_WARN" LABEL_TEXT="$LABEL_WARN ";; + esac + + + if [ "$FLAG_DEBUG" == "true" ]; then + + local LABEL="" + if [ "$FLAG_DEBUG_LABEL" == "true" ]; then + LABEL=${LABEL_TEXT:-} + fi + + TEXT="${TEXT//#d:/$COLOR_DEFAULT}" + TEXT="${TEXT//#w:/$COLOR_WARN}" + TEXT="${TEXT//#e:/$COLOR_ERROR}" + TEXT="${TEXT//#i:/$COLOR_INFO}" + TEXT="${TEXT//#r:/$COLOR_INFO}" + + echo -e "$COLOR_START$LABEL$TEXT$TEXT_SUFFUX$COLOR_END" +# printf "$COLOR_START%s%s$COLOR_END$TEXT_SUFFUX" "$LABEL" "$TEXT" + fi +} + + +printTitle() { + echo -n ${1:-Test} +} +printLine() { + echo ${1:-Test} +} +printResult() { + debug "${1:-fail}" "${1:-fail}" +} +printDebug() { + debug "$(printf '*%.0s' {1..100})" "error" + echo ${1:-Test Failed} + echo "${2:-No Output}" + debug "$(printf '*%.0s' {1..100})" "error" +} + +test_usage_java() { + printLine "Testing java" + CHECK="11" + + printLine "Starting Container" + + OUTPUT=$(docker run --rm ${IMAGE_NAME} java --version) + + if [[ "$OUTPUT" != *"$CHECK"* ]]; then + printResult "error" + printDebug "Image '${IMAGE_NAME}' test FAILED could not find ${CHECK} in output" "${OUTPUT}" + exit 1 + else + printResult "success" + fi +} + +test_usage_ffmpeg() { + printLine "Testing ffmpeg" + CHECK="$(cat ../Dockerfile | grep -m1 FFMPEG_VERSION | sed -e 's/.*FFMPEG_VERSION="\(.*\)".*/\1/g')" + + printLine "Starting Container" + + OUTPUT=$(docker run --rm ${IMAGE_NAME} ffmpeg -version) + + if [[ "$OUTPUT" != *"$CHECK"* ]]; then + printResult "error" + printDebug "Image '${IMAGE_NAME}' test FAILED could not find ${CHECK} in output" "${OUTPUT}" + exit 1 + else + printResult "success" + fi +} + +test_usage_java + +test_usage_ffmpeg +