diff --git a/transcoder/Dockerfile.build b/transcoder/Dockerfile.build index 80f9abe3..d822d287 100644 --- a/transcoder/Dockerfile.build +++ b/transcoder/Dockerfile.build @@ -10,9 +10,9 @@ 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="n4.4" +ARG FFMPEG_VERSION="n5.0" ARG NVIDIA_CODEC_HEADERS_VERSION="n9.0.18.4" ARG PYTHON_VERSION diff --git a/transcoder/Makefile b/transcoder/Makefile index facbde20..bcf1e2cf 100644 --- a/transcoder/Makefile +++ b/transcoder/Makefile @@ -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) diff --git a/transcoder/utils/utils.c b/transcoder/utils/utils.c index 9d970928..06282771 100644 --- a/transcoder/utils/utils.c +++ b/transcoder/utils/utils.c @@ -266,7 +266,7 @@ void log_frame_side_data(const char* category,const AVFrame *pFrame) int add_packet_frame_id_and_pts(AVPacket *packet,int64_t frame_id,pts_t pts) { AVDictionary * frameDict = NULL; - int frameDictSize = 0; + size_t frameDictSize = 0; char buf[sizeof("9223372036854775807")]; uint8_t *frameDictData = NULL; sprintf(buf,"%lld",frame_id); @@ -287,7 +287,7 @@ int get_packet_frame_id(const AVPacket *packet,int64_t *frame_id_ptr) { const char *frame_str; AVDictionary * frameDict = NULL; - int frameDictSize = 0; + size_t frameDictSize = 0; uint8_t *frameDictData = av_packet_get_side_data(packet, AV_PKT_DATA_STRINGS_METADATA, &frameDictSize); *frame_id_ptr = AV_NOPTS_VALUE; if (!frameDictData) @@ -305,7 +305,7 @@ int get_packet_original_pts(const AVPacket *packet,pts_t *pts_ptr) { const char *pts_str; AVDictionary * frameDict = NULL; - int frameDictSize = 0; + size_t frameDictSize = 0; uint8_t *frameDictData = av_packet_get_side_data(packet, AV_PKT_DATA_STRINGS_METADATA, &frameDictSize); *pts_ptr = AV_NOPTS_VALUE; if (!frameDictData) diff --git a/transcoder/utils/utils.h b/transcoder/utils/utils.h index 6bb201e7..5a6ff9b0 100644 --- a/transcoder/utils/utils.h +++ b/transcoder/utils/utils.h @@ -13,6 +13,7 @@ #include #include #include +#include size_t load_file_to_memory(const char *filename, char **result);