-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
190 lines (153 loc) · 3.43 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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
FROM python:3.11-bullseye AS base
RUN apt-get update && apt-get -y upgrade && apt-get install -yqq \
curl \
wget
RUN pip install --upgrade pip \
&& pip install poetry \
&& poetry config virtualenvs.create false
#
# Build base
#
FROM base AS build
RUN apt-get install -yqq \
apt-utils \
autoconf \
automake \
build-essential \
cmake \
g++ \
git \
intltool \
libexpat1-dev \
libtool \
liburiparser-dev \
meson \
nasm \
ninja-build \
pkg-config \
swig \
uuid-dev \
wget \
yasm
#
# BMX
#
FROM build AS bmx
RUN mkdir /src
WORKDIR /src
RUN git clone https://github.com/Limecraft/ebu-libmxf
RUN git clone https://github.com/Limecraft/ebu-libmxfpp
RUN git clone https://github.com/Limecraft/ebu-bmx
WORKDIR /src/ebu-libmxf
RUN ./autogen.sh && ./configure && make && make install && /sbin/ldconfig
WORKDIR /src/ebu-libmxfpp
RUN ./autogen.sh && ./configure && make && make install && /sbin/ldconfig
WORKDIR /src/ebu-bmx
RUN ./autogen.sh && ./configure && make && make install && /sbin/ldconfig
#
# FFMPEG
#
FROM build AS ffmpeg
ENV FFMPEG_VERSION 6.0
ENV MLT_VERSION 7.16.0
ENV LD_LIBRARY_PATH /usr/local/lib
WORKDIR /src
# FFMPEG
RUN \
wget http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz \
&& tar -xzf ffmpeg-${FFMPEG_VERSION}.tar.gz \
&& rm ffmpeg-${FFMPEG_VERSION}.tar.gz \
&& mv ffmpeg-${FFMPEG_VERSION} ffmpeg
# MLT
RUN \
wget https://github.com/mltframework/mlt/archive/refs/tags/v${MLT_VERSION}.tar.gz \
&& tar -xzf v7.16.0.tar.gz \
&& rm v${MLT_VERSION}.tar.gz \
&& mv mlt-${MLT_VERSION} mlt
# Build ffmpeg
WORKDIR /src/ffmpeg
RUN apt-get install -yqq \
libgcrypt20-dev \
libgnutls-openssl-dev \
libx264-dev \
libmp3lame-dev \
libsox-dev \
libtheora-dev \
libvorbis-dev \
libvpx-dev
RUN ./configure \
--prefix=/usr/local \
--disable-doc \
--enable-gpl \
--enable-version3 \
--enable-shared \
--enable-debug \
--enable-pthreads \
--enable-libmp3lame \
--enable-libtheora \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-gnutls \
--extra-version=NEBULA \
--enable-runtime-cpudetect && make -j16 && make install
# Build MLT
WORKDIR /src/mlt/build
RUN apt-get install -yqq \
libgavl-dev \
libsamplerate0-dev \
libxml2-dev \
ladspa-sdk \
libjack-dev \
libsoup2.4-dev \
libexif-dev \
xutils-dev \
libegl1-mesa-dev \
libeigen3-dev \
libfftw3-dev \
libvdpau-dev \
librtaudio-dev \
libsamplerate-dev \
python3-dev
RUN cmake --enable-gpl -D SWIG_PYTHON=ON ..
RUN cmake --build .
RUN cmake --install . --prefix /usr/local
#
# Final image
#
FROM base
ENV PYTHONUNBUFFERED=1
COPY --from=bmx /usr/local/lib/lib* /usr/local/lib/
COPY --from=bmx /usr/local/bin/* /usr/local/bin/
# Install runtime dependencies
# Build essentials are needed for building some python packages
RUN apt-get install -yqq \
amb-plugins \
build-essential \
cifs-utils \
curl \
libexif12 \
libexpat1 \
libgcrypt20 \
libgnutls-openssl27 \
libmp3lame0 \
librtaudio6 \
libsamplerate0 \
libsox3 \
libtheora0 \
liburiparser1 \
libvorbis0a \
libvpx6 \
libx264-160 \
libxml2 \
lsp-plugins-ladspa \
mediainfo \
uuid \
zlib1g-dev
#
# Copy built files
#
COPY --from=ffmpeg /usr/local/ /usr/local/
RUN cp /usr/local/lib/python3/dist-packages/mlt7.py /usr/local/lib/python3.11/site-packages/mlt.py
RUN cp /usr/local/lib/python3/dist-packages/_mlt7.so /usr/local/lib/python3.11/site-packages/_mlt7.so
RUN ldconfig