This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
167 lines (143 loc) · 3.82 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# ffmpeg - http://ffmpeg.org/download.html
#
# From https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
#
# NDI - by NewTek - newtek.com
#
# Dockerfile inspiration: https://hub.docker.com/r/jrottenberg/ffmpeg/
#
# Kasper Olsson Hans TV2 Denmark
#
FROM ubuntu:16.04 AS base
WORKDIR /
# CleanUp Ubuntu
RUN apt-get -yqq update && \
apt-get install -yq --no-install-recommends ca-certificates expat libgomp1 && \
apt-get autoremove -y && \
apt-get clean -y
FROM base as build
# Environment
ENV PKG_CONFIG_PATH=/ffmpeg_build/ffmpeg/lib/pkgconfig
# Build dependencies:
RUN buildDeps="autoconf \
automake \
build-essential \
cmake \
git \
libass-dev \
libfreetype6-dev \
libtheora-dev \
libtool \
libvorbis-dev \
mercurial \
pkg-config \
texinfo \
wget \
zlib1g-dev \
yasm \
libx264-dev \
libx265-dev \
libvpx-dev \
libfdk-aac-dev \
libmp3lame-dev \
libopus-dev \
v4l-utils \
v4l2loopback-dkms \
libsdl2-dev \
libtheora-dev \
libtool \
libva-dev \
libvdpau-dev \
libvorbis-dev \
libxcb1-dev \
libxcb-shm0-dev \
libxcb-xfixes0-dev \
libopencore-amrnb-dev \
libopencore-amrwb-dev \
librtmp-dev \
curl \
bzip2 \
libexpat1-dev \
g++ \
gcc \
gperf \
libtool \
make \
nasm \
perl \
pkg-config \
python \
avahi-daemon \
avahi-utils \
libnss-mdns \
libssl-dev" && \
apt-get -yqq update && \
apt-get install -yq --no-install-recommends ${buildDeps}
# Prepare build sources, build and lib folders:
WORKDIR "ffmpeg_build/lib/pkgconfig"
# Install NDI SDK
WORKDIR "/ndi"
COPY InstallNDISDK_v3_Linux.sh .
RUN chmod +x InstallNDISDK_v3_Linux.sh
RUN ./InstallNDISDK_v3_Linux.sh
# ToDo..... mv rename file to underscore: (find fix for this workaround)
RUN mv NDI\ SDK\ for\ Linux NDI_SDK_for_Linux
# Put NDI lib ref text into conf file
RUN echo "/ndi/NDI_SDK_for_Linux/lib/x86_64-linux-gnu" >> /etc/ld.so.conf.d/ndi.conf
RUN ldconfig
# Fetch FFmpeg:
WORKDIR "/ffmpeg_sources"
RUN wget -O ffmpeg-snapshot.tar.bz2 http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \
tar xjvf ffmpeg-snapshot.tar.bz2
# Compile FFmpeg:
WORKDIR "/ffmpeg_sources/ffmpeg"
RUN ./configure \
--prefix="/ffmpeg_build" \
--pkg-config-flags="--static" \
--extra-cflags="-I/ndi/NDI_SDK_for_Linux/include" \
--extra-ldflags="-L/ndi/NDI_SDK_for_Linux/lib/x86_64-linux-gnu" \
--bindir="/bin" \
--enable-gpl \
--enable-libass \
--enable-libfdk-aac \
--enable-libfreetype \
--enable-libmp3lame \
--enable-libopencore-amrnb \
--enable-libopencore-amrwb \
--enable-librtmp \
--enable-libopus \
--enable-libtheora \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-nonfree \
--enable-version3 \
--enable-libndi_newtek \
--enable-libxcb \
--disable-decklink
RUN make
RUN make install
#KAOL Remove restriction in Avahi - put a # in front of rlimit-nproc=3
#RUN sed -i '/rlimit-nproc/s/^/#/' /etc/avahi/avahi-daemon.conf
#Start Dbus & Avahi to handle mDNS
RUN update-rc.d dbus defaults
RUN update-rc.d avahi-daemon defaults
# Cleanup
RUN mv /ffmpeg_sources/ffmpeg/ffmpeg /usr/local/ffmpeg
RUN rm /ndi/InstallNDISDK_v3_Linux.sh
#For network testing ------ KAOL uncomment to test
RUN apt-get install -yq --no-install-recommends net-tools iputils-ping
#ADD Avahi script for running Daemon on startup
ADD "start.sh" "/root/start.sh"
RUN chmod +x /root/start.sh
#Make User - to be able to run Avahi:
#RUN useradd -r -u 1901 dockeruser
#USER dockeruser
#Info
MAINTAINER KAOL TV2 Denmark
ENTRYPOINT ["/root/start.sh"]
ENV LD_LIBRARY_PATH=/usr/local/lib
#EXPOSE 5353:5353/udp
#EXPOSE 5941:5941/udp
EXPOSE 5000-6000/udp
EXPOSE 5000-6000