Skip to content

Commit

Permalink
Upgrade ffmpeg and Cuda in transcoder.
Browse files Browse the repository at this point in the history
  • Loading branch information
shamamayair committed Nov 2, 2023
1 parent 52190a5 commit 0ca4bfa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
10 changes: 3 additions & 7 deletions transcoder/Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ENV TZ=Europe/Kiev
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
WORKDIR /build

RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub && apt-get update && apt-get install -y sudo git build-essential gdbserver vim yasm cmake libtool autogen dh-autoreconf libbz2-dev libc6 libc6-dev unzip wget libnuma1 libnuma-dev frei0r-plugins-dev libgnutls28-dev libass-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libopus-dev librtmp-dev libsoxr-dev libspeex-dev libtheora-dev libvo-amrwbenc-dev libvorbis-dev libvpx-dev libwebp-dev libx264-dev libx265-dev libxvidcore-dev gdb
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub && apt-get update && apt-get install -y sudo git build-essential gdbserver vim yasm cmake libtool autogen dh-autoreconf libbz2-dev libc6 libc6-dev unzip wget libnuma1 libnuma-dev frei0r-plugins-dev libgnutls28-dev libass-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libopus-dev librtmp-dev libsoxr-dev libspeex-dev libtheora-dev libvo-amrwbenc-dev libvorbis-dev libvpx-dev libwebp-dev libx264-dev libx265-dev libxvidcore-dev gdb

ARG FFMPEG_VERSION="n5.0"
ARG NVIDIA_CODEC_HEADERS_VERSION="n9.0.18.4"
Expand All @@ -23,12 +23,8 @@ RUN cd nv-codec-headers && \

RUN git clone --branch ${FFMPEG_VERSION} https://github.com/ffmpeg/ffmpeg.git


COPY tests/Makefile /build/ffmpeg/libavfilter
COPY tests/allfilters.c /build/ffmpeg/libavfilter

RUN cd ffmpeg && rm libavfilter/vf_sharpen_npp.c && \
./configure --disable-doc --enable-nonfree --disable-shared --enable-nvenc --enable-cuda-nvcc --enable-cuvid --enable-libnpp --extra-cflags=-Ilocal/include --enable-gpl --enable-version3 --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --enable-libx264 --enable-libx265 --extra-cflags=-I/usr/local/cuda/targets/x86_64-linux/include --extra-ldflags="-L/usr/local/cuda/targets/x86_64-linux/lib" && \
RUN cd ffmpeg && \
./configure --disable-doc --enable-nonfree --disable-shared --enable-nvenc --enable-cuda --enable-cuvid --enable-libnpp --extra-cflags=-Ilocal/include --enable-gpl --enable-version3 --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --enable-libx264 --enable-libx265 --extra-cflags=-I/usr/local/cuda/targets/x86_64-linux/include --extra-ldflags="-L/usr/local/cuda/targets/x86_64-linux/lib" && \
make -j 8

RUN apt-get install valgrind -y
Expand Down
3 changes: 2 additions & 1 deletion transcoder/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ else
X264_LIB_DIR := ./x264
endif


IDIRS = -I. -I$(FFMPEG_LIB_DIR) -I"./common" -I"./utils" -I"./KMP" -I"./transcode" -I"./debug"
LDIR = -L/usr/local/cuda/lib64 -L$(X264_LIB_DIR) -L$(FFMPEG_LIB_DIR)/libavfilter -L$(FFMPEG_LIB_DIR)/libswresample -L$(FFMPEG_LIB_DIR)/libswscale -L$(FFMPEG_LIB_DIR)/libwresmple -L$(FFMPEG_LIB_DIR)/libavdevice -L$(FFMPEG_LIB_DIR)/libavutil -L$(FFMPEG_LIB_DIR)/libavformat -L$(FFMPEG_LIB_DIR)/libavcodec -L$(FFMPEG_LIB_DIR)/libpostproc -L/usr/local/lib
FFMPEG_LIBS = -lavfilter -lavformat -lswscale -lavcodec -lavutil -lswresample -lpostproc -lx264 -lx265
LIBS = -lm -lpthread -lz -lbz2 -ldl
CUDA_LIBS = -lnppig_static -lnppicc_static -lnppc_static -lnppidei_static -lcublas_static -lcudart_static -lculibos -lcudart -lstdc++
CUDA_LIBS = -lnppif -lnppig_static -lnppicc_static -lnppc_static -lnppidei_static -lcublas_static -lcudart_static -lculibos -lcudart -lstdc++
CFLAGS = -Wall -g $(IDIRS) -fPIC -static -std=c11 -D_GNU_SOURCE -fexceptions
CPPFLAGS = -Wall -g $(IDIRS) -fPIC -static -std=c++14 -D_GNU_SOURCE -fexceptions
LDFLAGS = $(LDIR) $(LIBS) $(FFMPEG_LIBS) $(LIBS)
Expand Down

0 comments on commit 0ca4bfa

Please sign in to comment.