Skip to content

Commit

Permalink
Update ffmpeg in transcoder (#180)
Browse files Browse the repository at this point in the history
* Upgrade ffmpeg and Cuda in transcoder.

* Upgrade ffmpeg and Cuda in transcoder.

* Upgrade ffmpeg and Cuda in transcoder.

* Upgrade ffmpeg and Cuda in transcoder.

* Upgrade ffmpeg and Cuda in transcoder.

* Upgrade ffmpeg and Cuda in transcoder.

* Upgrade ffmpeg and Cuda in transcoder.

* Upgrade ffmpeg and Cuda in transcoder.
  • Loading branch information
shamamayair authored Nov 5, 2023
1 parent cd20f1c commit 51c2da9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions transcoder/Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -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

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
6 changes: 3 additions & 3 deletions transcoder/utils/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)
Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions transcoder/utils/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <stdio.h>
#include <stdbool.h>
#include <arpa/inet.h>
#include <libavcodec/avcodec.h>

size_t load_file_to_memory(const char *filename, char **result);

Expand Down

0 comments on commit 51c2da9

Please sign in to comment.