Skip to content

Commit a7e5e19

Browse files
committed
add ffmpeg options:
1 parent e2449ee commit a7e5e19

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

ffmpeg/Dockerfile

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
3232
PYTHONUNBUFFERED=1 \
3333
LIBRARY_PATH=/usr/local/cuda/lib64/stubs \
3434
_CUDA_COMPAT_PATH="/usr/local/cuda/compat" \
35-
LD_LIBRARY_PATH="/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/compat/lib:/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda/lib64:/usr/include/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/opt/intel/compilers_and_libraries_2020.3.279/linux/mkl/lib/intel64" \
35+
LD_LIBRARY_PATH="/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/compat/lib:/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda/lib64:/usr/include/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/opt/intel/compilers_and_libraries_2020.3.279/linux/mkl/lib/intel64:/usr/local/lib" \
3636
PATH="/usr/local/mpi/bin:/usr/local/ucx:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/bin/cmake/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/tensorrt/bin:/usr/local/src/lightgbm/LightGBM" \
3737
LANG=C.UTF-8
3838

@@ -174,7 +174,7 @@ RUN rm -fr /var/lib/apt/lists/* && \
174174
git subversion \
175175
zlib1g-dev \
176176
&& \
177-
ln -s /usr/include/libv4l1-videodev.h /usr/include/linux/videodev.h && \
177+
ln -s /usr/include/libv4l1-videodev.h /usr/include/videodev.h && \
178178
find /usr/local/cuda-${CUDA}/lib64/ -type f -name 'lib*_static.a' -not -name 'libcudart_static.a' -delete
179179

180180
WORKDIR /tmp
@@ -296,7 +296,7 @@ RUN set -xe && \
296296
git -C /usr/local/ffmpeg_sources/x264 pull 2> /dev/null || \
297297
git clone --depth 1 https://code.videolan.org/videolan/x264 && \
298298
cd /usr/local/ffmpeg_sources/x264 && \
299-
./configure --enable-static --enable-pic && \
299+
./configure --enable-shared --enable-pic && \
300300
make && \
301301
make install
302302

@@ -306,7 +306,7 @@ RUN set -xe && \
306306
git clone https://github.com/videolan/x265 \
307307
/usr/local/ffmpeg_sources/x265 && \
308308
cd /usr/local/ffmpeg_sources/x265/build/linux && \
309-
cmake -G "Unix Makefiles" -DENABLE_SHARED=off ../../source && \
309+
cmake -G "Unix Makefiles" -DENABLE_SHARED=on ../../source && \
310310
make -j$(nproc) && \
311311
make install
312312

@@ -376,18 +376,23 @@ RUN set -xe && \
376376
--pkg-config-flags="--static" \
377377
--extra-libs="-lpthread -lm" \
378378
--enable-gpl \
379+
--enable-openssl \
380+
--enable-libaom \
379381
--enable-libass \
380382
--enable-libnpp \
381383
--enable-libfdk-aac \
382384
--enable-libfreetype \
383385
--enable-libmp3lame \
384386
--enable-libopus \
387+
--enable-libsvtav1 \
385388
--enable-libvorbis \
386-
--enable-libvpx \
389+
--enable-libsnappy \
390+
--enable-libvpx \
387391
--enable-libx264 \
388392
--enable-libx265 \
389-
--enable-static \
393+
--enable-shared \
390394
--enable-cuda \
395+
--enable-pic \
391396
--enable-cuvid \
392397
--enable-nvenc \
393398
--enable-libnpp \
@@ -403,6 +408,7 @@ RUN ln -s /usr/include/x86_64-linux-gnu/cudnn_v7.h /usr/local/cuda/include/cudnn
403408
WORKDIR /tmp
404409
ENV OPENCV_VERSION="4.5.2"
405410
COPY libnvcuvid.so.455.45.01 /usr/lib/x86_64-linux-gnu/libnvcuvid.so.1
411+
RUN ln -s /usr/lib/x86_64-linux-gnu/libnvcuvid.so.1 /usr/lib/libnvcuvid.so.1
406412
RUN wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \
407413
wget -O opencv-contrib.zip https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip && \
408414
unzip ${OPENCV_VERSION}.zip && \
@@ -448,6 +454,7 @@ RUN cd /tmp/opencv-${OPENCV_VERSION}/cmake_binary && \
448454
-D BUILD_opencv_video=ON \
449455
-D BUILD_opencv_videoio=ON \
450456
-D BUILD_opencv_videostab=ON \
457+
-D BUILD_SHARED_LIBS=ON \
451458
-D CMAKE_BUILD_TYPE=RELEASE \
452459
-D CMAKE_INSTALL_PREFIX=$(python3 -c "import sys; print(sys.prefix)") \
453460
# -D CUDA_ARCH_BIN=7.5 \
@@ -513,18 +520,18 @@ RUN cd /tmp/opencv-${OPENCV_VERSION}/cmake_binary && \
513520
-D WITH_TBB=ON \
514521
-D WITH_TIFF=ON \
515522
-D WITH_UNICAP=OFF \
516-
-D WITH_V4L=ON \
517-
-D WITH_VTK=ON \
523+
-D WITH_V4L=OFF \
524+
-D WITH_VTK=OFF \
518525
-D WITH_WEBP=ON \
519526
-D WITH_XIMEA=OFF \
520527
-D WITH_XINE=OFF \
521528
-D WITH_ZLIB=ON \
522-
# -G Ninja \
529+
-G Ninja \
523530
-D CMAKE_INSTALL_PREFIX=/usr/local \
524531
.. 2>&1 | tee cmake_messages.txt
525-
#RUN cd /tmp/opencv-4.5.2/cmake_binary && ninja
526-
RUN cd /tmp/opencv-4.5.2/cmake_binary && make
527-
#-j$(nproc) && make install
532+
RUN cd /tmp/opencv-4.5.2/cmake_binary && ninja
533+
# cd /tmp/opencv-4.5.2/cmake_binary && \
534+
# make -j$(nproc) && make install
528535
RUN rm /usr/lib/x86_64-linux-gnu/libnvcuvid.so.1
529536

530537
RUN set -xe && \

0 commit comments

Comments
 (0)