Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ffmpeg in transcoder #180

Merged
merged 8 commits into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading