format docker, fix version, fix browser

This commit is contained in:
jb-alvarado 2023-03-27 17:02:51 +02:00
parent dd6ae18368
commit 3b10ef543f
6 changed files with 559 additions and 544 deletions

View File

@ -1,8 +1,8 @@
FROM almalinux:9.1 AS base FROM almalinux:9 AS base
ENV container docker ENV container docker
RUN dnf -y install libgomp && \ RUN dnf -y install libgomp && \
dnf clean all; dnf clean all;
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \ RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \
systemd-tmpfiles-setup.service ] || rm -f $i; done); \ systemd-tmpfiles-setup.service ] || rm -f $i; done); \
@ -16,9 +16,9 @@ rm -f /lib/systemd/system/anaconda.target.wants/*;
FROM base FROM base
ARG FFPLAYOUT_VERSION=0.17.1 ARG FFPLAYOUT_VERSION=0.17.0-beta7
ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib
@ -35,10 +35,10 @@ RUN dnf install -y epel-release && \
RUN \ RUN \
dnf update -y \ dnf update -y \
&& dnf install -y wget dejavu-sans-fonts sudo \ && dnf install -y wget dejavu-sans-fonts sudo \
&& wget -q -O /tmp/ffplayout_${FFPLAYOUT_VERSION}.x86_64.rpm "https://github.com/ffplayout/ffplayout/releases/download/v${VERSION}/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm" \ && wget -q -O /tmp/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm "https://github.com/ffplayout/ffplayout/releases/download/v${FFPLAYOUT_VERSION}/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm" \
&& yum install -y /tmp/ffplayout_${FFPLAYOUT_VERSION}.x86_64.rpm \ && dnf install -y /tmp/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm \
&& dnf clean all \ && dnf clean all \
&& rm /tmp/ffplayout-${FFPLAYOUT_VERSION}.x86_64.rpm \ && rm /tmp/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm \
&& mkdir -p /home/ffpu && chown -R ffpu: /home/ffpu \ && mkdir -p /home/ffpu && chown -R ffpu: /home/ffpu \
&& systemctl enable ffplayout \ && systemctl enable ffplayout \
&& systemctl enable ffpapi \ && systemctl enable ffpapi \
@ -48,4 +48,4 @@ EXPOSE 8787
VOLUME [ "/sys/fs/cgroup" ] VOLUME [ "/sys/fs/cgroup" ]
CMD ["/usr/sbin/init"] CMD ["/usr/sbin/init"]

View File

@ -1,26 +1,26 @@
FROM centos:7 AS base FROM centos:7 AS base
ENV container docker ENV container docker
RUN yum -y install libgomp && \ RUN yum -y install libgomp && \
yum clean all; yum clean all
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \ RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \
systemd-tmpfiles-setup.service ] || rm -f $i; done); \ systemd-tmpfiles-setup.service ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*;\ rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /etc/systemd/system/*.wants/*;\ rm -f /etc/systemd/system/*.wants/*;\
rm -f /lib/systemd/system/local-fs.target.wants/*; \ rm -f /lib/systemd/system/local-fs.target.wants/*; \
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
rm -f /lib/systemd/system/basic.target.wants/*;\ rm -f /lib/systemd/system/basic.target.wants/*;\
rm -f /lib/systemd/system/anaconda.target.wants/*; rm -f /lib/systemd/system/anaconda.target.wants/*;
FROM base AS build FROM base AS build
WORKDIR /tmp/workdir WORKDIR /tmp/workdir
ENV FFMPEG_VERSION=5.1.2 \ ENV FFMPEG_VERSION=5.1.2 \
AOM_VERSION=v1.0.0 \ AOM_VERSION=v1.0.0 \
LIBASS_VERSION=0.13.7 \ LIBASS_VERSION=0.13.7 \
FREETYPE_VERSION=2.10.4 \ FREETYPE_VERSION=2.10.4 \
@ -28,74 +28,74 @@ ENV FFMPEG_VERSION=5.1.2 \
FONTCONFIG_VERSION=2.12.4 \ FONTCONFIG_VERSION=2.12.4 \
SRC=/usr/local SRC=/usr/local
ARG LIBASS_SHA256SUM="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7 0.13.7.tar.gz" ARG LIBASS_SHA256SUM="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7 0.13.7.tar.gz"
ARG FREETYPE_SHA256SUM="5eab795ebb23ac77001cfb68b7d4d50b5d6c7469247b0b01b2c953269f658dac freetype-2.10.4.tar.gz" ARG FREETYPE_SHA256SUM="5eab795ebb23ac77001cfb68b7d4d50b5d6c7469247b0b01b2c953269f658dac freetype-2.10.4.tar.gz"
ARG FRIBIDI_SHA256SUM="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8 0.19.7.tar.gz" ARG FRIBIDI_SHA256SUM="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8 0.19.7.tar.gz"
ARG LD_LIBRARY_PATH=/opt/ffmpeg/lib ARG LD_LIBRARY_PATH=/opt/ffmpeg/lib
ARG MAKEFLAGS="-j2" ARG MAKEFLAGS="-j2"
ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig" ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig"
ARG PREFIX=/opt/ffmpeg ARG PREFIX=/opt/ffmpeg
ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64"
RUN buildDeps="autoconf \ RUN buildDeps="autoconf \
automake \ automake \
bzip2 \ bzip2 \
cmake3 \ cmake3 \
diffutils \ diffutils \
expat-devel \ expat-devel \
file \ file \
gcc \ gcc \
gcc-c++ \ gcc-c++ \
git \ git \
gperf \ gperf \
libtool \ libtool \
make \ make \
perl \ perl \
python3 \ python3 \
openssl-devel \ openssl-devel \
tar \ tar \
yasm \ yasm \
which \ which \
zlib-devel" && \ zlib-devel" && \
echo "${SRC}/lib" > /etc/ld.so.conf.d/libc.conf && \ echo "${SRC}/lib" > /etc/ld.so.conf.d/libc.conf && \
yum --enablerepo=extras install -y epel-release && \ yum --enablerepo=extras install -y epel-release && \
yum --enablerepo=epel install -y ${buildDeps} && \ yum --enablerepo=epel install -y ${buildDeps} && \
alternatives --install /usr/bin/cmake cmake /usr/bin/cmake3 0 && \ alternatives --install /usr/bin/cmake cmake /usr/bin/cmake3 0 && \
# Install the tools required to build nasm 2.14.02 \ # Install the tools required to build nasm 2.14.02 \
nasmDeps="asciidoc \ nasmDeps="asciidoc \
perl-Font-TTF \ perl-Font-TTF \
perl-Sort-Versions \ perl-Sort-Versions \
xmlto" && \ xmlto" && \
yum --enablerepo=epel install -y ${nasmDeps} && \ yum --enablerepo=epel install -y ${nasmDeps} && \
# Compile and install nasm 2.14.02 \ # Compile and install nasm 2.14.02 \
DIR=/tmp/nasm && \ DIR=/tmp/nasm && \
mkdir -p ${DIR} && \ mkdir -p ${DIR} && \
curl -LSs https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.gz | \ curl -LSs https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.gz | \
tar xzC ${DIR} --strip-components=1 && \ tar xzC ${DIR} --strip-components=1 && \
pushd ${DIR} && \ pushd ${DIR} && \
./configure --host=x86_64-redhat-linux-gnu \ ./configure --host=x86_64-redhat-linux-gnu \
--build=x86_64-redhat-linux-gnu \ --build=x86_64-redhat-linux-gnu \
--prefix=/usr/local \ --prefix=/usr/local \
--exec-prefix=/usr/local \ --exec-prefix=/usr/local \
--bindir=/usr/local/bin \ --bindir=/usr/local/bin \
--sbindir=/usr/local/sbin \ --sbindir=/usr/local/sbin \
--sysconfdir=/usr/local/etc \ --sysconfdir=/usr/local/etc \
--datadir=/usr/local/share \ --datadir=/usr/local/share \
--includedir=/usr/local/include \ --includedir=/usr/local/include \
--libdir=/usr/local/lib \ --libdir=/usr/local/lib \
--libexecdir=/usr/local/libexec \ --libexecdir=/usr/local/libexec \
--enable-sections && \ --enable-sections && \
make all && \ make all && \
make install && \ make install && \
make install_rdf && \ make install_rdf && \
popd && rm -rf ${DIR} && \ popd && rm -rf ${DIR} && \
alternatives --install /usr/bin/nasm nasm /usr/local/bin/nasm 0 && \ alternatives --install /usr/bin/nasm nasm /usr/local/bin/nasm 0 && \
# Now that we have a modern nasm build and available, we can undo the last \ # Now that we have a modern nasm build and available, we can undo the last \
# yum transaction as none of those packages are required for the rest of the build \ # yum transaction as none of those packages are required for the rest of the build \
yum history undo $(yum history info | grep 'Transaction ID' | awk -F: '{print$2}' | tr -d ' ') -y && \ yum history undo $(yum history info | grep 'Transaction ID' | awk -F: '{print$2}' | tr -d ' ') -y && \
yum autoremove -y yum autoremove -y
RUN yum -y install \ RUN yum -y install \
@ -113,131 +113,131 @@ RUN yum -y install \
## fridibi https://www.fribidi.org/ ## fridibi https://www.fribidi.org/
RUN \ RUN \
DIR=/tmp/fribidi && \ DIR=/tmp/fribidi && \
mkdir -p ${DIR} && \ mkdir -p ${DIR} && \
cd ${DIR} && \ cd ${DIR} && \
curl -sLO https://github.com/fribidi/fribidi/archive/${FRIBIDI_VERSION}.tar.gz && \ curl -sLO https://github.com/fribidi/fribidi/archive/${FRIBIDI_VERSION}.tar.gz && \
echo ${FRIBIDI_SHA256SUM} | sha256sum --check && \ echo ${FRIBIDI_SHA256SUM} | sha256sum --check && \
tar -zx --strip-components=1 -f ${FRIBIDI_VERSION}.tar.gz && \ tar -zx --strip-components=1 -f ${FRIBIDI_VERSION}.tar.gz && \
sed -i 's/^SUBDIRS =.*/SUBDIRS=gen.tab charset lib bin/' Makefile.am && \ sed -i 's/^SUBDIRS =.*/SUBDIRS=gen.tab charset lib bin/' Makefile.am && \
./bootstrap --no-config --auto && \ ./bootstrap --no-config --auto && \
./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \
make -j1 && \ make -j1 && \
make install && \ make install && \
rm -rf ${DIR} rm -rf ${DIR}
## freetype https://www.freetype.org/ ## freetype https://www.freetype.org/
RUN \ RUN \
DIR=/tmp/freetype && \ DIR=/tmp/freetype && \
mkdir -p ${DIR} && \ mkdir -p ${DIR} && \
cd ${DIR} && \ cd ${DIR} && \
curl -sLO https://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 && \ echo ${FREETYPE_SHA256SUM} | sha256sum --check && \
tar -zx --strip-components=1 -f freetype-${FREETYPE_VERSION}.tar.gz && \ tar -zx --strip-components=1 -f freetype-${FREETYPE_VERSION}.tar.gz && \
./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \
make -j $(nproc | awk '{print $1 / 2}') && \ make -j $(nproc | awk '{print $1 / 2}') && \
make install && \ make install && \
rm -rf ${DIR} rm -rf ${DIR}
## fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/ ## fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/
RUN \ RUN \
DIR=/tmp/fontconfig && \ DIR=/tmp/fontconfig && \
mkdir -p ${DIR} && \ mkdir -p ${DIR} && \
cd ${DIR} && \ 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 && \ 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 -j $(nproc | awk '{print $1 / 2}') && \ make -j $(nproc | awk '{print $1 / 2}') && \
make install && \ make install && \
rm -rf ${DIR} rm -rf ${DIR}
## libass https://github.com/libass/libass ## libass https://github.com/libass/libass
RUN \ RUN \
DIR=/tmp/libass && \ DIR=/tmp/libass && \
mkdir -p ${DIR} && \ mkdir -p ${DIR} && \
cd ${DIR} && \ 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 && \ echo ${LIBASS_SHA256SUM} | sha256sum --check && \
tar -zx --strip-components=1 -f ${LIBASS_VERSION}.tar.gz && \ tar -zx --strip-components=1 -f ${LIBASS_VERSION}.tar.gz && \
./autogen.sh && \ ./autogen.sh && \
./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \
make -j $(nproc | awk '{print $1 / 2}') && \ make -j $(nproc | awk '{print $1 / 2}') && \
make install && \ make install && \
rm -rf ${DIR} rm -rf ${DIR}
RUN \ RUN \
DIR=/tmp/aom && \ DIR=/tmp/aom && \
git clone --branch ${AOM_VERSION} --depth 1 https://aomedia.googlesource.com/aom ${DIR} ; \ git clone --branch ${AOM_VERSION} --depth 1 https://aomedia.googlesource.com/aom ${DIR} ; \
cd ${DIR} ; \ cd ${DIR} ; \
rm -rf CMakeCache.txt CMakeFiles ; \ rm -rf CMakeCache.txt CMakeFiles ; \
mkdir -p ./aom_build ; \ mkdir -p ./aom_build ; \
cd ./aom_build ; \ cd ./aom_build ; \
cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ..; \ cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ..; \
make ; \ make ; \
make install ; \ make install ; \
rm -rf ${DIR} rm -rf ${DIR}
## Download ffmpeg https://ffmpeg.org/ ## Download ffmpeg https://ffmpeg.org/
RUN \ RUN \
DIR=/tmp/ffmpeg && mkdir -p ${DIR} && cd ${DIR} && \ DIR=/tmp/ffmpeg && mkdir -p ${DIR} && cd ${DIR} && \
curl -sLO https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ curl -sLO https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \
tar -jx --strip-components=1 -f 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 && \ ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \
make ; make install make ; make install
## Build ffmpeg https://ffmpeg.org/ ## Build ffmpeg https://ffmpeg.org/
RUN \ RUN \
DIR=/tmp/ffmpeg && cd ${DIR} && \ DIR=/tmp/ffmpeg && cd ${DIR} && \
./configure \ ./configure \
--disable-debug \ --disable-debug \
--disable-doc \ --disable-doc \
--disable-ffplay \ --disable-ffplay \
--enable-gpl \ --enable-gpl \
--enable-libaom \ --enable-libaom \
--enable-libass \ --enable-libass \
--enable-libfreetype \ --enable-libfreetype \
--enable-libmp3lame \ --enable-libmp3lame \
--enable-libopenjpeg \ --enable-libopenjpeg \
--enable-libopus \ --enable-libopus \
--enable-libsrt \ --enable-libsrt \
--enable-libvorbis \ --enable-libvorbis \
--enable-libvpx \ --enable-libvpx \
--enable-libwebp \ --enable-libwebp \
--enable-libx264 \ --enable-libx264 \
--enable-libx265 \ --enable-libx265 \
--enable-libzmq \ --enable-libzmq \
--enable-nonfree \ --enable-nonfree \
--enable-fontconfig \ --enable-fontconfig \
--enable-postproc \ --enable-postproc \
--enable-shared \ --enable-shared \
--enable-version3 \ --enable-version3 \
--extra-cflags="-I${PREFIX}/include" \ --extra-cflags="-I${PREFIX}/include" \
--extra-ldflags="-L${PREFIX}/lib" \ --extra-ldflags="-L${PREFIX}/lib" \
--extra-libs=-ldl \ --extra-libs=-ldl \
--extra-libs=-lpthread \ --extra-libs=-lpthread \
--prefix="${PREFIX}" && \ --prefix="${PREFIX}" && \
make clean && \ make clean && \
make -j $(nproc | awk '{print $1 / 2}') && \ make -j $(nproc | awk '{print $1 / 2}') && \
make install && \ make install && \
make tools/zmqsend && cp tools/zmqsend ${PREFIX}/bin/ && \ make tools/zmqsend && cp tools/zmqsend ${PREFIX}/bin/ && \
make distclean && \ make distclean && \
hash -r && \ hash -r && \
cd tools && \ cd tools && \
make qt-faststart && cp qt-faststart ${PREFIX}/bin/ make qt-faststart && cp qt-faststart ${PREFIX}/bin/
RUN \ RUN \
ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /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 && \ for lib in /usr/local/lib64/*.so.*; do ln -s "${lib##*/}" "${lib%%.so.*}".so; done && \
cp ${PREFIX}/bin/* /usr/local/bin/ && \ cp ${PREFIX}/bin/* /usr/local/bin/ && \
cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \
LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib ffmpeg -buildconf && \ 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 && \ cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \
mkdir -p /usr/local/lib64/pkgconfig && \ 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 \ 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##*/}"; \ sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib64/pkgconfig/"${pc##*/}"; \
done done
FROM base FROM base
ARG FFPLAYOUT_VERSION=0.17.1 ARG FFPLAYOUT_VERSION=0.17.0-beta7
ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib
@ -248,10 +248,10 @@ ADD ./overide.conf /etc/systemd/system/ffplayout.service.d/overide.conf
RUN \ RUN \
yum update -y \ yum update -y \
&& yum install -y wget dejavu-sans-fonts sudo \ && yum install -y wget dejavu-sans-fonts sudo \
&& wget -q -O /tmp/ffplayout_${FFPLAYOUT_VERSION}.x86_64.rpm "https://github.com/ffplayout/ffplayout/releases/download/v${VERSION}/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm" \ && wget -q -O /tmp/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm "https://github.com/ffplayout/ffplayout/releases/download/v${FFPLAYOUT_VERSION}/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm" \
&& yum install -y /tmp/ffplayout_${FFPLAYOUT_VERSION}.x86_64.rpm \ && yum install -y /tmp/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm \
&& yum clean all \ && yum clean all \
&& rm /tmp/ffplayout-${FFPLAYOUT_VERSION}.x86_64.rpm \ && rm /tmp/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm \
&& mkdir -p /home/ffpu && chown -R ffpu: /home/ffpu \ && mkdir -p /home/ffpu && chown -R ffpu: /home/ffpu \
&& systemctl enable ffplayout \ && systemctl enable ffplayout \
&& systemctl enable ffpapi \ && systemctl enable ffpapi \
@ -261,4 +261,4 @@ EXPOSE 8787
VOLUME [ "/sys/fs/cgroup" ] VOLUME [ "/sys/fs/cgroup" ]
CMD ["/usr/sbin/init"] CMD ["/usr/sbin/init"]

View File

@ -3,13 +3,13 @@
## Base Image ## Base Image
Use of [centos image](https://hub.docker.com/_/centos) as base image as it offer the possibility to use systemd. Use of [centos image](https://hub.docker.com/_/centos) as base image as it offer the possibility to use systemd.
In order to run systemd in a container it has to run in privileged mode and bind to the `cgroup` of the host. In order to run systemd in a container it has to run in privileged mode and bind to the `cgroup` of the host.
## Image ## Image
In addition to the base image, there is the compilation of ffmpeg and all lib from source based on https://github.com/jrottenberg/ffmpeg. In addition to the base image, there is the compilation of ffmpeg and all lib from source based on https://github.com/jrottenberg/ffmpeg.
We can't use directly the image from `jrottenberg/ffmpeg` as it compile ffmpeg with the flag `--enable-small` that remove some part of the json from the ffprobe command. We can't use directly the image from `jrottenberg/ffmpeg` as it compile ffmpeg with the flag `--enable-small` that remove some part of the json from the ffprobe command.
There is also a conf file to override the ffplayout.service as the libs for ffmpeg are not in the defauft place which is copied to `/etc/systemd/system/ffplayout.service.d/overide.conf`. There is also a conf file to override the ffplayout.service as the libs for ffmpeg are not in the defauft place which is copied to `/etc/systemd/system/ffplayout.service.d/overide.conf`.
The image is build with a default user/pass `admin/admin`. The image is build with a default user/pass `admin/admin`.
@ -19,7 +19,7 @@ You can take a look à the [Dockerfile](Dockerfile)
### /!\ as ffmpeg is compiled with `--enable-nonfree` don't push it to a public registry nor distribute the image /!\ ### /!\ as ffmpeg is compiled with `--enable-nonfree` don't push it to a public registry nor distribute the image /!\
## Storage ## Storage
There are some folders/files that are important for ffplayout to work well such as : There are some folders/files that are important for ffplayout to work well such as :
- /usr/share/ffplayout/db => where all the data for the `ffpapi` are stored (user/pass etc) - /usr/share/ffplayout/db => where all the data for the `ffpapi` are stored (user/pass etc)
- /var/lib/ffplayout/tv-media => where the media are stored by default (configurable) - /var/lib/ffplayout/tv-media => where the media are stored by default (configurable)
@ -30,16 +30,16 @@ It may be useful to create/link volume for those folders/files.
## Docker ## Docker
How to build the image How to build the image
`docker build -t ffplayout-image .` `docker build -t ffplayout-image .`
`docker build -f fromSource.Dockerfile -t ffplayout-image:from-source .` `docker build -f fromSource.Dockerfile -t ffplayout-image:from-source .`
`docker build -f Almalinux.Dockerfile -t ffplayout-image:almalinux .` `docker build -f Almalinux.Dockerfile -t ffplayout-image:almalinux .`
example of command to start the container: example of command to start the container:
`docker run -ti -v /sys/fs/cgroup:/sys/fs/cgroup:ro --cap-add SYS_ADMIN -p 8787:8787 ffplayout-image` `docker run -ti -v /sys/fs/cgroup:/sys/fs/cgroup:ro --cap-add SYS_ADMIN -p 8787:8787 ffplayout-image`
Note from centos docker hub page Note from centos docker hub page
` `
There have been reports that if you're using an Ubuntu host, you will need to add -v /tmp/$(mktemp -d):/run in addition to the cgroups mount. There have been reports that if you're using an Ubuntu host, you will need to add -v /tmp/$(mktemp -d):/run in addition to the cgroups mount.
` `
@ -110,7 +110,7 @@ spec:
### Use with traefik ### Use with traefik
If you are using traefik here is a sample config If you are using traefik here is a sample config
``` ```
--- ---
kind: Service kind: Service
@ -162,4 +162,4 @@ spec:
port: 8787 port: 8787
tls: tls:
certResolver: yourCert certResolver: yourCert
``` ```

View File

@ -1,8 +1,8 @@
FROM centos:7 AS base FROM centos:7 AS base
ENV container docker ENV container docker
RUN yum -y install libgomp && \ RUN yum -y install libgomp && \
yum clean all; yum clean all;
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \ RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \
systemd-tmpfiles-setup.service ] || rm -f $i; done); \ systemd-tmpfiles-setup.service ] || rm -f $i; done); \
@ -15,12 +15,12 @@ rm -f /lib/systemd/system/basic.target.wants/*;\
rm -f /lib/systemd/system/anaconda.target.wants/*; rm -f /lib/systemd/system/anaconda.target.wants/*;
FROM base AS build FROM base AS build
WORKDIR /tmp/workdir WORKDIR /tmp/workdir
ENV FFMPEG_VERSION=5.1.2 \ ENV FFMPEG_VERSION=5.1.2 \
AOM_VERSION=v1.0.0 \ AOM_VERSION=v1.0.0 \
FDKAAC_VERSION=0.1.5 \ FDKAAC_VERSION=0.1.5 \
FONTCONFIG_VERSION=2.12.4 \ FONTCONFIG_VERSION=2.12.4 \
@ -43,385 +43,400 @@ ENV FFMPEG_VERSION=5.1.2 \
LIBPNG_VERSION=1.6.9 \ LIBPNG_VERSION=1.6.9 \
SRC=/usr/local SRC=/usr/local
ARG FREETYPE_SHA256SUM="5eab795ebb23ac77001cfb68b7d4d50b5d6c7469247b0b01b2c953269f658dac freetype-2.10.4.tar.gz" ARG FREETYPE_SHA256SUM="5eab795ebb23ac77001cfb68b7d4d50b5d6c7469247b0b01b2c953269f658dac freetype-2.10.4.tar.gz"
ARG FRIBIDI_SHA256SUM="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8 0.19.7.tar.gz" ARG FRIBIDI_SHA256SUM="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8 0.19.7.tar.gz"
ARG LIBASS_SHA256SUM="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7 0.13.7.tar.gz" ARG LIBASS_SHA256SUM="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7 0.13.7.tar.gz"
ARG OGG_SHA256SUM="e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd41011d73a654692 libogg-1.3.2.tar.gz" ARG OGG_SHA256SUM="e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd41011d73a654692 libogg-1.3.2.tar.gz"
ARG OPUS_SHA256SUM="77db45a87b51578fbc49555ef1b10926179861d854eb2613207dc79d9ec0a9a9 opus-1.2.tar.gz" ARG OPUS_SHA256SUM="77db45a87b51578fbc49555ef1b10926179861d854eb2613207dc79d9ec0a9a9 opus-1.2.tar.gz"
ARG VORBIS_SHA256SUM="6efbcecdd3e5dfbf090341b485da9d176eb250d893e3eb378c428a2db38301ce libvorbis-1.3.5.tar.gz" ARG VORBIS_SHA256SUM="6efbcecdd3e5dfbf090341b485da9d176eb250d893e3eb378c428a2db38301ce libvorbis-1.3.5.tar.gz"
ARG LIBZMQ_SHA256SUM="02ecc88466ae38cf2c8d79f09cfd2675ba299a439680b64ade733e26a349edeb v4.3.2.tar.gz" ARG LIBZMQ_SHA256SUM="02ecc88466ae38cf2c8d79f09cfd2675ba299a439680b64ade733e26a349edeb v4.3.2.tar.gz"
ARG LD_LIBRARY_PATH=/opt/ffmpeg/lib ARG LD_LIBRARY_PATH=/opt/ffmpeg/lib
ARG MAKEFLAGS="-j2" ARG MAKEFLAGS="-j2"
ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig" ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig"
ARG PREFIX=/opt/ffmpeg ARG PREFIX=/opt/ffmpeg
ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64"
RUN buildDeps="autoconf \ RUN buildDeps="autoconf \
automake \ automake \
bzip2 \ bzip2 \
cmake3 \ cmake3 \
diffutils \ diffutils \
expat-devel \ expat-devel \
file \ file \
gcc \ gcc \
gcc-c++ \ gcc-c++ \
git \ git \
gperf \ gperf \
libtool \ libtool \
make \ make \
perl \ perl \
python3 \ python3 \
openssl-devel \ openssl-devel \
tar \ tar \
yasm \ yasm \
which \ which \
zlib-devel" && \ zlib-devel" && \
echo "${SRC}/lib" > /etc/ld.so.conf.d/libc.conf && \ echo "${SRC}/lib" > /etc/ld.so.conf.d/libc.conf && \
yum --enablerepo=extras install -y epel-release && \ yum --enablerepo=extras install -y epel-release && \
yum --enablerepo=epel install -y ${buildDeps} && \ yum --enablerepo=epel install -y ${buildDeps} && \
alternatives --install /usr/bin/cmake cmake /usr/bin/cmake3 0 && \ alternatives --install /usr/bin/cmake cmake /usr/bin/cmake3 0 && \
# Install the tools required to build nasm 2.14.02 \ # Install the tools required to build nasm 2.14.02 \
nasmDeps="asciidoc \ nasmDeps="asciidoc \
perl-Font-TTF \ perl-Font-TTF \
perl-Sort-Versions \ perl-Sort-Versions \
xmlto" && \ xmlto" && \
yum --enablerepo=epel install -y ${nasmDeps} && \ yum --enablerepo=epel install -y ${nasmDeps} && \
# Compile and install nasm 2.14.02 \ # Compile and install nasm 2.14.02 \
DIR=/tmp/nasm && \ DIR=/tmp/nasm && \
mkdir -p ${DIR} && \ mkdir -p ${DIR} && \
curl -LSs https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.gz | \ curl -LSs https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.gz | \
tar xzC ${DIR} --strip-components=1 && \ tar xzC ${DIR} --strip-components=1 && \
pushd ${DIR} && \ pushd ${DIR} && \
./configure --host=x86_64-redhat-linux-gnu \ ./configure --host=x86_64-redhat-linux-gnu \
--build=x86_64-redhat-linux-gnu \ --build=x86_64-redhat-linux-gnu \
--prefix=/usr/local \ --prefix=/usr/local \
--exec-prefix=/usr/local \ --exec-prefix=/usr/local \
--bindir=/usr/local/bin \ --bindir=/usr/local/bin \
--sbindir=/usr/local/sbin \ --sbindir=/usr/local/sbin \
--sysconfdir=/usr/local/etc \ --sysconfdir=/usr/local/etc \
--datadir=/usr/local/share \ --datadir=/usr/local/share \
--includedir=/usr/local/include \ --includedir=/usr/local/include \
--libdir=/usr/local/lib \ --libdir=/usr/local/lib \
--libexecdir=/usr/local/libexec \ --libexecdir=/usr/local/libexec \
--enable-sections && \ --enable-sections && \
make all && \ make all && \
make install && \ make install && \
make install_rdf && \ make install_rdf && \
popd && rm -rf ${DIR} && \ popd && rm -rf ${DIR} && \
alternatives --install /usr/bin/nasm nasm /usr/local/bin/nasm 0 && \ alternatives --install /usr/bin/nasm nasm /usr/local/bin/nasm 0 && \
# Now that we have a modern nasm build and available, we can undo the last \ # Now that we have a modern nasm build and available, we can undo the last \
# yum transaction as none of those packages are required for the rest of the build \ # yum transaction as none of those packages are required for the rest of the build \
yum history undo $(yum history info | grep 'Transaction ID' | awk -F: '{print$2}' | tr -d ' ') -y && \ yum history undo $(yum history info | grep 'Transaction ID' | awk -F: '{print$2}' | tr -d ' ') -y && \
yum autoremove -y yum autoremove -y
## x264 http://www.videolan.org/developers/x264.html ## x264 http://www.videolan.org/developers/x264.html
RUN \ RUN \
DIR=/tmp/x264 && \ DIR=/tmp/x264 && \
mkdir -p ${DIR} && \ mkdir -p ${DIR} && \
cd ${DIR} && \ cd ${DIR} && \
curl -sL https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-${X264_VERSION}.tar.bz2 | \ curl -sL https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-${X264_VERSION}.tar.bz2 | \
tar -jx --strip-components=1 && \ tar -jx --strip-components=1 && \
./configure --prefix="${PREFIX}" --enable-shared --enable-pic --disable-cli && \ ./configure --prefix="${PREFIX}" --enable-shared --enable-pic --disable-cli && \
make -j $(nproc | awk '{print $1 / 2}') && \ make -j $(nproc | awk '{print $1 / 2}') && \
make install && \ make install && \
rm -rf ${DIR} rm -rf ${DIR}
### x265 http://x265.org/ ### x265 http://x265.org/
RUN \ RUN \
DIR=/tmp/x265 && \ DIR=/tmp/x265 && \
mkdir -p ${DIR} && \ mkdir -p ${DIR} && \
cd ${DIR} && \ cd ${DIR} && \
curl -sL https://github.com/videolan/x265/archive/refs/tags/${X265_VERSION}.tar.gz | \ curl -sL https://github.com/videolan/x265/archive/refs/tags/${X265_VERSION}.tar.gz | \
tar -zx && \ 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/$/ -DCMAKE_INSTALL_PREFIX=\${PREFIX}/" multilib.sh && \
sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh && \ sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh && \
./multilib.sh && \ ./multilib.sh && \
make -C 8bit install && \ make -C 8bit install && \
rm -rf ${DIR} rm -rf ${DIR}
### libogg https://www.xiph.org/ogg/ ### libogg https://www.xiph.org/ogg/
RUN \ RUN \
DIR=/tmp/ogg && \ DIR=/tmp/ogg && \
mkdir -p ${DIR} && \ mkdir -p ${DIR} && \
cd ${DIR} && \ cd ${DIR} && \
curl -sLO http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz && \ curl -sLO http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz && \
echo ${OGG_SHA256SUM} | sha256sum --check && \ echo ${OGG_SHA256SUM} | sha256sum --check && \
tar -zx --strip-components=1 -f libogg-${OGG_VERSION}.tar.gz && \ tar -zx --strip-components=1 -f libogg-${OGG_VERSION}.tar.gz && \
./configure --prefix="${PREFIX}" --enable-shared && \ ./configure --prefix="${PREFIX}" --enable-shared && \
make -j $(nproc | awk '{print $1 / 2}') && \ make -j $(nproc | awk '{print $1 / 2}') && \
make install && \ make install && \
rm -rf ${DIR} rm -rf ${DIR}
### libopus https://www.opus-codec.org/ ### libopus https://www.opus-codec.org/
RUN \ RUN \
DIR=/tmp/opus && \ DIR=/tmp/opus && \
mkdir -p ${DIR} && \ mkdir -p ${DIR} && \
cd ${DIR} && \ cd ${DIR} && \
curl -sLO https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz && \ curl -sLO https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz && \
echo ${OPUS_SHA256SUM} | sha256sum --check && \ echo ${OPUS_SHA256SUM} | sha256sum --check && \
tar -zx --strip-components=1 -f opus-${OPUS_VERSION}.tar.gz && \ tar -zx --strip-components=1 -f opus-${OPUS_VERSION}.tar.gz && \
autoreconf -fiv && \ autoreconf -fiv && \
./configure --prefix="${PREFIX}" --enable-shared && \ ./configure --prefix="${PREFIX}" --enable-shared && \
make -j $(nproc | awk '{print $1 / 2}') && \ make -j $(nproc | awk '{print $1 / 2}') && \
make install && \ make install && \
rm -rf ${DIR} rm -rf ${DIR}
### libvorbis https://xiph.org/vorbis/ ### libvorbis https://xiph.org/vorbis/
RUN \ RUN \
DIR=/tmp/vorbis && \ DIR=/tmp/vorbis && \
mkdir -p ${DIR} && \ mkdir -p ${DIR} && \
cd ${DIR} && \ cd ${DIR} && \
curl -sLO http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz && \ curl -sLO http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz && \
echo ${VORBIS_SHA256SUM} | sha256sum --check && \ echo ${VORBIS_SHA256SUM} | sha256sum --check && \
tar -zx --strip-components=1 -f libvorbis-${VORBIS_VERSION}.tar.gz && \ tar -zx --strip-components=1 -f libvorbis-${VORBIS_VERSION}.tar.gz && \
./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \ ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \
make -j $(nproc | awk '{print $1 / 2}') && \ make -j $(nproc | awk '{print $1 / 2}') && \
make install && \ make install && \
rm -rf ${DIR} rm -rf ${DIR}
### libvpx https://www.webmproject.org/code/ ### libvpx https://www.webmproject.org/code/
RUN \ RUN \
DIR=/tmp/vpx && \ DIR=/tmp/vpx && \
mkdir -p ${DIR} && \ mkdir -p ${DIR} && \
cd ${DIR} && \ cd ${DIR} && \
curl -sL https://codeload.github.com/webmproject/libvpx/tar.gz/v${VPX_VERSION} | \ curl -sL https://codeload.github.com/webmproject/libvpx/tar.gz/v${VPX_VERSION} | \
tar -zx --strip-components=1 && \ tar -zx --strip-components=1 && \
./configure --prefix="${PREFIX}" --enable-vp8 --enable-vp9 --enable-vp9-highbitdepth --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 && \ --disable-debug --disable-examples --disable-docs --disable-install-bins && \
make -j $(nproc | awk '{print $1 / 2}') && \ make -j $(nproc | awk '{print $1 / 2}') && \
make install && \ make install && \
rm -rf ${DIR} rm -rf ${DIR}
### libwebp https://developers.google.com/speed/webp/ ### libwebp https://developers.google.com/speed/webp/
RUN \ RUN \
DIR=/tmp/vebp && \ DIR=/tmp/vebp && \
mkdir -p ${DIR} && \ mkdir -p ${DIR} && \
cd ${DIR} && \ cd ${DIR} && \
curl -sL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz | \ curl -sL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz | \
tar -zx --strip-components=1 && \ tar -zx --strip-components=1 && \
./configure --prefix="${PREFIX}" --enable-shared && \ ./configure --prefix="${PREFIX}" --enable-shared && \
make -j $(nproc | awk '{print $1 / 2}') && \ make -j $(nproc | awk '{print $1 / 2}') && \
make install && \ make install && \
rm -rf ${DIR} rm -rf ${DIR}
### libmp3lame http://lame.sourceforge.net/ ### libmp3lame http://lame.sourceforge.net/
RUN \ RUN \
DIR=/tmp/lame && \ DIR=/tmp/lame && \
mkdir -p ${DIR} && \ mkdir -p ${DIR} && \
cd ${DIR} && \ cd ${DIR} && \
curl -sL https://sourceforge.net/projects/lame/files/lame/${LAME_VERSION}/lame-${LAME_VERSION}.tar.gz/download | \ curl -sL https://sourceforge.net/projects/lame/files/lame/${LAME_VERSION}/lame-${LAME_VERSION}.tar.gz/download | \
tar -zx --strip-components=1 && \ tar -zx --strip-components=1 && \
./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \
make -j $(nproc | awk '{print $1 / 2}') && \ make -j $(nproc | awk '{print $1 / 2}') && \
make install && \ make install && \
rm -rf ${DIR} rm -rf ${DIR}
### fdk-aac https://github.com/mstorsjo/fdk-aac ### fdk-aac https://github.com/mstorsjo/fdk-aac
RUN \ RUN \
DIR=/tmp/fdk-aac && \ DIR=/tmp/fdk-aac && \
mkdir -p ${DIR} && \ mkdir -p ${DIR} && \
cd ${DIR} && \ cd ${DIR} && \
curl -sL https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC_VERSION}.tar.gz | \ curl -sL https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC_VERSION}.tar.gz | \
tar -zx --strip-components=1 && \ tar -zx --strip-components=1 && \
autoreconf -fiv && \ autoreconf -fiv && \
./configure --prefix="${PREFIX}" --enable-shared --datadir="${DIR}" && \ ./configure --prefix="${PREFIX}" --enable-shared --datadir="${DIR}" && \
make -j $(nproc | awk '{print $1 / 2}') && \ make -j $(nproc | awk '{print $1 / 2}') && \
make install && \ make install && \
rm -rf ${DIR} rm -rf ${DIR}
## openjpeg https://github.com/uclouvain/openjpeg ## openjpeg https://github.com/uclouvain/openjpeg
RUN \ RUN \
DIR=/tmp/openjpeg && \ DIR=/tmp/openjpeg && \
mkdir -p ${DIR} && \ mkdir -p ${DIR} && \
cd ${DIR} && \ cd ${DIR} && \
curl -sL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | \ curl -sL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | \
tar -zx --strip-components=1 && \ tar -zx --strip-components=1 && \
cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \
make -j $(nproc | awk '{print $1 / 2}') && \ make -j $(nproc | awk '{print $1 / 2}') && \
make install && \ make install && \
rm -rf ${DIR} rm -rf ${DIR}
## freetype https://www.freetype.org/ ## freetype https://www.freetype.org/
RUN \ RUN \
DIR=/tmp/freetype && \ DIR=/tmp/freetype && \
mkdir -p ${DIR} && \ mkdir -p ${DIR} && \
cd ${DIR} && \ cd ${DIR} && \
curl -sLO https://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 && \ echo ${FREETYPE_SHA256SUM} | sha256sum --check && \
tar -zx --strip-components=1 -f freetype-${FREETYPE_VERSION}.tar.gz && \ tar -zx --strip-components=1 -f freetype-${FREETYPE_VERSION}.tar.gz && \
./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \
make -j $(nproc | awk '{print $1 / 2}') && \ make -j $(nproc | awk '{print $1 / 2}') && \
make install && \ make install && \
rm -rf ${DIR} rm -rf ${DIR}
## fridibi https://www.fribidi.org/ ## fridibi https://www.fribidi.org/
RUN \ RUN \
DIR=/tmp/fribidi && \ DIR=/tmp/fribidi && \
mkdir -p ${DIR} && \ mkdir -p ${DIR} && \
cd ${DIR} && \ cd ${DIR} && \
curl -sLO https://github.com/fribidi/fribidi/archive/${FRIBIDI_VERSION}.tar.gz && \ curl -sLO https://github.com/fribidi/fribidi/archive/${FRIBIDI_VERSION}.tar.gz && \
echo ${FRIBIDI_SHA256SUM} | sha256sum --check && \ echo ${FRIBIDI_SHA256SUM} | sha256sum --check && \
tar -zx --strip-components=1 -f ${FRIBIDI_VERSION}.tar.gz && \ tar -zx --strip-components=1 -f ${FRIBIDI_VERSION}.tar.gz && \
sed -i 's/^SUBDIRS =.*/SUBDIRS=gen.tab charset lib bin/' Makefile.am && \ sed -i 's/^SUBDIRS =.*/SUBDIRS=gen.tab charset lib bin/' Makefile.am && \
./bootstrap --no-config --auto && \ ./bootstrap --no-config --auto && \
./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \
make -j1 && \ make -j1 && \
make install && \ make install && \
rm -rf ${DIR} rm -rf ${DIR}
## fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/ ## fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/
RUN \ RUN \
DIR=/tmp/fontconfig && \ DIR=/tmp/fontconfig && \
mkdir -p ${DIR} && \ mkdir -p ${DIR} && \
cd ${DIR} && \ 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 && \ 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 -j $(nproc | awk '{print $1 / 2}') && \ make -j $(nproc | awk '{print $1 / 2}') && \
make install && \ make install && \
rm -rf ${DIR} rm -rf ${DIR}
## libass https://github.com/libass/libass ## libass https://github.com/libass/libass
RUN \ RUN \
DIR=/tmp/libass && \ DIR=/tmp/libass && \
mkdir -p ${DIR} && \ mkdir -p ${DIR} && \
cd ${DIR} && \ 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 && \ echo ${LIBASS_SHA256SUM} | sha256sum --check && \
tar -zx --strip-components=1 -f ${LIBASS_VERSION}.tar.gz && \ tar -zx --strip-components=1 -f ${LIBASS_VERSION}.tar.gz && \
./autogen.sh && \ ./autogen.sh && \
./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \
make -j $(nproc | awk '{print $1 / 2}') && \ make -j $(nproc | awk '{print $1 / 2}') && \
make install && \ make install && \
rm -rf ${DIR} rm -rf ${DIR}
## kvazaar https://github.com/ultravideo/kvazaar ## kvazaar https://github.com/ultravideo/kvazaar
RUN \ RUN \
DIR=/tmp/kvazaar && \ DIR=/tmp/kvazaar && \
mkdir -p ${DIR} && \ mkdir -p ${DIR} && \
cd ${DIR} && \ 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 && \ tar -zx --strip-components=1 -f v${KVAZAAR_VERSION}.tar.gz && \
./autogen.sh && \ ./autogen.sh && \
./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \
make -j $(nproc | awk '{print $1 / 2}') && \ make -j $(nproc | awk '{print $1 / 2}') && \
make install && \ make install && \
rm -rf ${DIR} rm -rf ${DIR}
RUN \ RUN \
DIR=/tmp/aom && \ DIR=/tmp/aom && \
git clone --branch ${AOM_VERSION} --depth 1 https://aomedia.googlesource.com/aom ${DIR} ; \ git clone --branch ${AOM_VERSION} --depth 1 https://aomedia.googlesource.com/aom ${DIR} && \
cd ${DIR} ; \ cd ${DIR} && \
rm -rf CMakeCache.txt CMakeFiles ; \ rm -rf CMakeCache.txt CMakeFiles && \
mkdir -p ./aom_build ; \ mkdir -p ./aom_build && \
cd ./aom_build ; \ cd ./aom_build && \
cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ..; \ cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 .. && \
make ; \ make && \
make install ; \ make install && \
rm -rf ${DIR} rm -rf ${DIR}
RUN \ RUN \
DIR=/tmp/libpthread-stubs && \ DIR=/tmp/libpthread-stubs && \
mkdir -p ${DIR} && \ mkdir -p ${DIR} && \
cd ${DIR} && \ cd ${DIR} && \
curl -sLO https://xcb.freedesktop.org/dist/libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}.tar.gz && \ 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 && \ tar -zx --strip-components=1 -f libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}.tar.gz && \
./configure --prefix="${PREFIX}" && \ ./configure --prefix="${PREFIX}" && \
make -j $(nproc | awk '{print $1 / 2}') && \ make -j $(nproc | awk '{print $1 / 2}') && \
make install && \ make install && \
rm -rf ${DIR} rm -rf ${DIR}
## libzmq https://github.com/zeromq/libzmq/ ## libzmq https://github.com/zeromq/libzmq/
RUN \ RUN \
DIR=/tmp/libzmq && \ DIR=/tmp/libzmq && \
mkdir -p ${DIR} && \ mkdir -p ${DIR} && \
cd ${DIR} && \ cd ${DIR} && \
curl -sLO https://github.com/zeromq/libzmq/archive/v${LIBZMQ_VERSION}.tar.gz && \ curl -sLO https://github.com/zeromq/libzmq/archive/v${LIBZMQ_VERSION}.tar.gz && \
echo ${LIBZMQ_SHA256SUM} | sha256sum --check && \ echo ${LIBZMQ_SHA256SUM} | sha256sum --check && \
tar -xz --strip-components=1 -f v${LIBZMQ_VERSION}.tar.gz && \ tar -xz --strip-components=1 -f v${LIBZMQ_VERSION}.tar.gz && \
./autogen.sh && \ ./autogen.sh && \
./configure --prefix="${PREFIX}" && \ ./configure --prefix="${PREFIX}" && \
make -j $(nproc | awk '{print $1 / 2}') && \ make -j $(nproc | awk '{print $1 / 2}') && \
make check && \ make check && \
make install && \ make install && \
rm -rf ${DIR} rm -rf ${DIR}
## libsrt https://github.com/Haivision/srt ## libsrt https://github.com/Haivision/srt
RUN \ RUN \
DIR=/tmp/srt && \ DIR=/tmp/srt && \
mkdir -p ${DIR} && \ mkdir -p ${DIR} && \
cd ${DIR} && \ cd ${DIR} && \
curl -sLO https://github.com/Haivision/srt/archive/v${LIBSRT_VERSION}.tar.gz && \ curl -sLO https://github.com/Haivision/srt/archive/v${LIBSRT_VERSION}.tar.gz && \
tar -xz --strip-components=1 -f v${LIBSRT_VERSION}.tar.gz && \ tar -xz --strip-components=1 -f v${LIBSRT_VERSION}.tar.gz && \
cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \
make -j $(nproc | awk '{print $1 / 2}') && \ make -j $(nproc | awk '{print $1 / 2}') && \
make install && \ make install && \
rm -rf ${DIR} rm -rf ${DIR}
## libpng ## libpng
RUN \ RUN \
DIR=/tmp/png && \ DIR=/tmp/png && \
mkdir -p ${DIR} && \ mkdir -p ${DIR} && \
cd ${DIR} && \ cd ${DIR} && \
git clone https://git.code.sf.net/p/libpng/code ${DIR} -b v${LIBPNG_VERSION} --depth 1 && \ git clone https://git.code.sf.net/p/libpng/code ${DIR} -b v${LIBPNG_VERSION} --depth 1 && \
./autogen.sh && \ ./autogen.sh && \
./configure --prefix="${PREFIX}" && \ ./configure --prefix="${PREFIX}" && \
make check && \ make check && \
make install && \ make install && \
rm -rf ${DIR} rm -rf ${DIR}
## Download ffmpeg https://ffmpeg.org/ ## Download ffmpeg https://ffmpeg.org/
RUN \ RUN \
DIR=/tmp/ffmpeg && mkdir -p ${DIR} && cd ${DIR} && \ DIR=/tmp/ffmpeg && mkdir -p ${DIR} && cd ${DIR} && \
curl -sLO https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ curl -sLO https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \
tar -jx --strip-components=1 -f 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 && \ ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \
make ; make install make && make install
## Build ffmpeg https://ffmpeg.org/ ## Build ffmpeg https://ffmpeg.org/
RUN \ RUN \
DIR=/tmp/ffmpeg && cd ${DIR} && \ DIR=/tmp/ffmpeg && cd ${DIR} && \
./configure \ ./configure \
--disable-debug \ --disable-debug \
--disable-doc \ --disable-doc \
--disable-ffplay \ --disable-ffplay \
--enable-gpl \ --enable-gpl \
--enable-libaom \ --enable-libaom \
--enable-libass \ --enable-libass \
--enable-libfdk_aac \ --enable-libfdk_aac \
--enable-libfreetype \ --enable-libfreetype \
--enable-libmp3lame \ --enable-libmp3lame \
--enable-libopenjpeg \ --enable-libopenjpeg \
--enable-libopus \ --enable-libopus \
--enable-libsrt \ --enable-libsrt \
--enable-libvorbis \ --enable-libvorbis \
--enable-libvpx \ --enable-libvpx \
--enable-libwebp \ --enable-libwebp \
--enable-libx264 \ --enable-libx264 \
--enable-libx265 \ --enable-libx265 \
--enable-libzmq \ --enable-libzmq \
--enable-nonfree \ --enable-nonfree \
--enable-fontconfig \ --enable-fontconfig \
--enable-postproc \ --enable-postproc \
--enable-shared \ --enable-shared \
--enable-version3 \ --enable-version3 \
--extra-cflags="-I${PREFIX}/include" \ --extra-cflags="-I${PREFIX}/include" \
--extra-ldflags="-L${PREFIX}/lib" \ --extra-ldflags="-L${PREFIX}/lib" \
--extra-libs=-ldl \ --extra-libs=-ldl \
--extra-libs=-lpthread \ --extra-libs=-lpthread \
--prefix="${PREFIX}" && \ --prefix="${PREFIX}" && \
make clean && \ make clean && \
make -j $(nproc | awk '{print $1 / 2}') && \ make -j $(nproc | awk '{print $1 / 2}') && \
make install && \ make install && \
make tools/zmqsend && cp tools/zmqsend ${PREFIX}/bin/ && \ make tools/zmqsend && cp tools/zmqsend ${PREFIX}/bin/ && \
make distclean && \ make distclean && \
hash -r && \ hash -r && \
cd tools && \ cd tools && \
make qt-faststart && cp qt-faststart ${PREFIX}/bin/ make qt-faststart && cp qt-faststart ${PREFIX}/bin/
RUN \ RUN \
ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /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 && \ for lib in /usr/local/lib64/*.so.*; do ln -s "${lib##*/}" "${lib%%.so.*}".so; done && \
cp ${PREFIX}/bin/* /usr/local/bin/ && \ cp ${PREFIX}/bin/* /usr/local/bin/ && \
cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \
LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib ffmpeg -buildconf && \ 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 && \ cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \
mkdir -p /usr/local/lib64/pkgconfig && \ 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 \ 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##*/}"; \ sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib64/pkgconfig/"${pc##*/}"; \
done done
FROM base FROM base
ARG FFPLAYOUT_VERSION=0.17.1 ARG FFPLAYOUT_VERSION=0.17.0-beta7
ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib
@ -432,8 +447,8 @@ ADD ./overide.conf /etc/systemd/system/ffplayout.service.d/overide.conf
RUN \ RUN \
yum update -y \ yum update -y \
&& yum install -y wget dejavu-sans-fonts sudo \ && yum install -y wget dejavu-sans-fonts sudo \
&& wget -q -O /tmp/ffplayout_${FFPLAYOUT_VERSION}.x86_64.rpm "https://github.com/ffplayout/ffplayout/releases/download/v${VERSION}/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm" \ && wget -q -O /tmp/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm "https://github.com/ffplayout/ffplayout/releases/download/v${FFPLAYOUT_VERSION}/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm" \
&& yum install -y /tmp/ffplayout_${FFPLAYOUT_VERSION}.x86_64.rpm \ && yum install -y /tmp/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm \
&& yum clean all \ && yum clean all \
&& rm /tmp/ffplayout-${FFPLAYOUT_VERSION}.x86_64.rpm \ && rm /tmp/ffplayout-${FFPLAYOUT_VERSION}.x86_64.rpm \
&& mkdir -p /home/ffpu && chown -R ffpu: /home/ffpu \ && mkdir -p /home/ffpu && chown -R ffpu: /home/ffpu \
@ -445,4 +460,4 @@ EXPOSE 8787
VOLUME [ "/sys/fs/cgroup" ] VOLUME [ "/sys/fs/cgroup" ]
CMD ["/usr/sbin/init"] CMD ["/usr/sbin/init"]

@ -1 +1 @@
Subproject commit 4dc932635dba4b96479ffa1a29fec71d113a99a7 Subproject commit 99339155ebb01e598fb42bd09456445efde867c8

View File

@ -44,7 +44,7 @@ for target in "${targets[@]}"; do
cp ./target/${target}/release/ffpapi.exe . cp ./target/${target}/release/ffpapi.exe .
cp ./target/${target}/release/ffplayout.exe . cp ./target/${target}/release/ffplayout.exe .
zip -r "ffplayout-v${version}_${target}.zip" assets docs public LICENSE README.md CHANGELOG.md ffplayout.exe ffpapi.exe -x *.db zip -r "ffplayout-v${version}_${target}.zip" assets docker docs public LICENSE README.md CHANGELOG.md ffplayout.exe ffpapi.exe -x *.db
rm -f ffplayout.exe ffpapi.exe rm -f ffplayout.exe ffpapi.exe
elif [[ $target == "x86_64-apple-darwin" ]] || [[ $target == "aarch64-apple-darwin" ]]; then elif [[ $target == "x86_64-apple-darwin" ]] || [[ $target == "aarch64-apple-darwin" ]]; then
if [[ -f "ffplayout-v${version}_${target}.tar.gz" ]]; then if [[ -f "ffplayout-v${version}_${target}.tar.gz" ]]; then
@ -62,7 +62,7 @@ for target in "${targets[@]}"; do
cp ./target/${target}/release/ffpapi . cp ./target/${target}/release/ffpapi .
cp ./target/${target}/release/ffplayout . cp ./target/${target}/release/ffplayout .
tar -czvf "ffplayout-v${version}_${target}.tar.gz" --exclude='*.db' --exclude='*.db-shm' --exclude='*.db-wal' assets docs public LICENSE README.md CHANGELOG.md ffplayout ffpapi tar -czvf "ffplayout-v${version}_${target}.tar.gz" --exclude='*.db' --exclude='*.db-shm' --exclude='*.db-wal' assets docker docs public LICENSE README.md CHANGELOG.md ffplayout ffpapi
rm -f ffplayout ffpapi rm -f ffplayout ffpapi
else else
if [[ -f "ffplayout-v${version}_${target}.tar.gz" ]]; then if [[ -f "ffplayout-v${version}_${target}.tar.gz" ]]; then
@ -73,7 +73,7 @@ for target in "${targets[@]}"; do
cp ./target/${target}/release/ffpapi . cp ./target/${target}/release/ffpapi .
cp ./target/${target}/release/ffplayout . cp ./target/${target}/release/ffplayout .
tar -czvf "ffplayout-v${version}_${target}.tar.gz" --exclude='*.db' --exclude='*.db-shm' --exclude='*.db-wal' assets docs public LICENSE README.md CHANGELOG.md ffplayout ffpapi tar -czvf "ffplayout-v${version}_${target}.tar.gz" --exclude='*.db' --exclude='*.db-shm' --exclude='*.db-wal' assets docker docs public LICENSE README.md CHANGELOG.md ffplayout ffpapi
rm -f ffplayout ffpapi rm -f ffplayout ffpapi
fi fi