-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
138 lines (114 loc) · 3.62 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
FROM ampervue/python27
# https://github.com/ampervue/docker-python27-opencv
MAINTAINER David Karchmer <[email protected]>
########################################
#
# Image based on Ubuntu:trusty
#
# with Python 2.7
# and OpenCV 3 (built)
# plus a bunch of build essencials
#######################################
ENV OPENCV_VERSION 2.4.10
WORKDIR /usr/local/src
RUN git clone --depth 1 https://github.com/l-smash/l-smash \
&& git clone --depth 1 git://git.videolan.org/x264.git \
&& hg clone https://bitbucket.org/multicoreware/x265 \
&& git clone --depth 1 git://source.ffmpeg.org/ffmpeg \
&& git clone https://github.com/Itseez/opencv.git \
&& git clone https://github.com/Itseez/opencv_contrib.git \
&& git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git \
&& git clone --depth 1 https://chromium.googlesource.com/webm/libvpx \
&& git clone https://git.xiph.org/opus.git \
&& git clone --depth 1 https://github.com/mulx/aacgain.git
# Build L-SMASH
# =================================
WORKDIR /usr/local/src/l-smash
RUN ./configure
RUN make -j 4
RUN make install
# =================================
# Build libx264
# =================================
WORKDIR /usr/local/src/x264
RUN ./configure --enable-static
RUN make -j 4
RUN make install
# =================================
# Build libx265
# =================================
WORKDIR /usr/local/src/x265/build/linux
RUN cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ../../source
RUN make -j 4
RUN make install
# =================================
# Build libfdk-aac
# =================================
WORKDIR /usr/local/src/fdk-aac
RUN autoreconf -fiv
RUN ./configure --disable-shared
RUN make -j 4
RUN make install
# =================================
# Build libvpx
# =================================
WORKDIR /usr/local/src/libvpx
RUN ./configure --disable-examples
RUN make -j 4
RUN make install
# =================================
# Build libopus
# =================================
WORKDIR /usr/local/src/opus
RUN ./autogen.sh
RUN ./configure --disable-shared
RUN make -j 4
RUN make install
# =================================
# Build OpenCV 3.x
# =================================
RUN apt-get update -qq && apt-get install -y --force-yes libopencv-dev
RUN pip install --no-cache-dir --upgrade numpy
WORKDIR /usr/local/src
RUN mkdir -p opencv/release
WORKDIR /usr/local/src/opencv/release
RUN cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D WITH_TBB=ON \
-D BUILD_PYTHON_SUPPORT=ON \
-D WITH_V4L=ON \
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
..
RUN make -j4
RUN make install
RUN sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
RUN ldconfig
# =================================
# Build ffmpeg.
# =================================
RUN apt-get update -qq && apt-get install -y --force-yes \
libass-dev
# --enable-libx265 - Remove until we can debug compile error
WORKDIR /usr/local/src/ffmpeg
RUN ./configure --extra-libs="-ldl" \
--enable-gpl \
--enable-libass \
--enable-libfdk-aac \
--enable-libfontconfig \
--enable-libfreetype \
--enable-libfribidi \
--enable-libmp3lame \
--enable-libopus \
--enable-libtheora \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-nonfree
RUN make -j 4
RUN make install
# =================================
# Remove all tmpfile
# =================================
WORKDIR /usr/local/
RUN rm -rf /usr/local/src
# =================================