forked from anba8005/ndi-webrtc-peer-ffmpeg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
116 lines (100 loc) · 3.45 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
# ffmpeg - http://ffmpeg.org/download.html
#
# From https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
#
# https://hub.docker.com/r/jrottenberg/ffmpeg/
#
#
FROM ubuntu:focal AS base
WORKDIR /tmp/workdir
RUN apt-get -yqq update && \
apt-get install -yq --no-install-recommends ca-certificates expat libgomp1 && \
apt-get autoremove -y && \
apt-get clean -y
ARG PKG_CONFIG_PATH=/opt/ffmpeg/lib/pkgconfig
ARG LD_LIBRARY_PATH=/opt/ffmpeg/lib
ARG PREFIX=/opt/ffmpeg
ARG MAKEFLAGS="-j4"
ENV FFMPEG_VERSION=4.1.8 \
X264_VERSION=20191217-2245-stable \
SRC=/usr/local
ADD ["NDI SDK for Linux", "/usr/local/ndi/"]
ENV DEBIAN_FRONTEND=noninteractive
RUN buildDeps="autoconf \
automake \
cmake \
curl \
bzip2 \
libexpat1-dev \
g++ \
gcc \
git \
gperf \
libtool \
make \
nasm \
perl \
pkg-config \
libsrt-dev \
python \
libssl-dev \
yasm \
libavahi-client-dev \
libavahi-common-dev \
libopus-dev \
libva-dev \
zlib1g-dev" && \
apt-get -yqq update && \
apt-get install -yq --no-install-recommends ${buildDeps}
## 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}" --disable-shared --enable-static --enable-pic --disable-cli && \
make && \
make install && \
rm -rf ${DIR}
RUN \
DIR=/tmp/ffnvcodec && \
mkdir -p ${DIR} && \
cd ${DIR} && \
git clone https://github.com/FFmpeg/nv-codec-headers.git && \
cd nv-codec-headers && \
make && \
make install && \
rm -rf ${DIR}
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 && mkdir -p ${DIR} && cd ${DIR} && \
./configure \
--disable-debug \
--disable-doc \
--disable-ffplay \
--disable-ffprobe \
--enable-libndi_newtek \
--enable-static \
--disable-shared \
--enable-gpl \
--enable-libx264 \
--enable-nonfree \
--enable-libopus \
--enable-postproc \
--enable-nvenc \
--enable-vaapi \
--enable-runtime-cpudetect \
--enable-protocol='file,udp,rtp,srt' \
--enable-libsrt \
--extra-cflags="-I${PREFIX}/ -I/usr/local/ndi/include" \
--extra-ldflags="-L${PREFIX}/lib -L/usr/local/ndi/lib/x86_64-linux-gnu" \
--extra-libs=-ldl \
--prefix="${PREFIX}" && \
make && make install && rm -rf ${DIR}
CMD /bin/cp -r /opt/ffmpeg/bin /ffmpeg-install && \
/bin/cp -r /opt/ffmpeg/lib /ffmpeg-install && \
/bin/cp -r /opt/ffmpeg/include /ffmpeg-install