-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
135 lines (114 loc) · 4 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# ffmpeg - http://ffmpeg.org/download.html
FROM debian:stretch-slim AS base
RUN apt-get update && apt-get upgrade
# Add avahi for NDI discovery
RUN apt-get install -y avahi-daemon avahi-utils
ADD configs/avahi-daemon.conf /etc/avahi/avahi-daemon.conf
# Add some other dependencies
RUN apt-get install -y apt-utils libssl1.1 libglib2.0-0 libgomp1
# Create a Build Docker image
FROM base AS build
WORKDIR /tmp/workdir
RUN apt-get install -y libgcc-6-dev libstdc++ ca-certificates libcrypto++-dev expat git
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.1 \
FDKAAC_VERSION=0.1.5 \
X264_VERSION=20170226-2245-stable \
X265_VERSION=2.3 \
SRC=/usr/local
RUN apt-get install -y autoconf \
automake \
bash \
binutils \
bzip2 \
cmake \
curl \
coreutils \
diffutils \
file \
g++ \
gcc \
gperf \
libexpat-dev \
libglib2.0-dev \
libssl-dev \
libtool \
make \
python \
tar \
yasm \
zlib1g-dev
## NewTek NDI Software Developer Kit 3.8 https://www.newtek.com/ndi/sdk/#download-sdk
# ADD ["NDI SDK for Linux/lib/x86_64-linux-gnu/*", "/usr/lib/"]
ADD ["NDI SDK for Linux", "/usr/local/ndi/"]
## 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://download.videolan.org/pub/videolan/x265/x265_${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}
### 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}
## 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
RUN DIR=/tmp/ffmpeg && cd ${DIR} && \
./configure \
--enable-gpl \
--enable-libndi_newtek \
--enable-libx264 \
--enable-nonfree \
--extra-cflags="-I${PREFIX}/include -I/usr/local/ndi/include" \
--extra-ldflags="-L${PREFIX}/lib -L/usr/local/ndi/lib/x86_64-linux-gnu" \
--prefix="${PREFIX}" && \
make && \
make install && \
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/lib/ && \
cp ${PREFIX}/bin/* /usr/local/bin/ && \
cp /usr/local/ndi/lib/x86_64-linux-gnu/* /usr/local/lib/ && \
cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \
LD_LIBRARY_PATH=/usr/local/lib ffmpeg -buildconf
### Release Stage
FROM base AS release
MAINTAINER Johan Els <[email protected]>
EXPOSE 5353/UDP
EXPOSE 5960-5969
ENV LD_LIBRARY_PATH /usr/local/lib
CMD ["--help"]
ADD ["scripts/entrypoint.sh", "/usr/local/bin/"]
ENTRYPOINT ["entrypoint.sh"]
COPY --from=build /usr/local /usr/local