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 Oct 31, 2023
1 parent cd20f1c commit 6b5bc00
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions transcoder/Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#docker run --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -it -v ~/dev/live/transcoder:/tmp -p 6543:6543 kaltura/live-transcoder
#gdb --args ./transcoder -f /tmp/config2.json

ARG CUDA_VERSION="11.1.1-devel"
ARG CUDA_VERSION="12.2.0-devel-ubuntu20.04"

ARG PYTHON_VERSION=3.8

Expand All @@ -12,8 +12,8 @@ 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

ARG FFMPEG_VERSION="n4.4"
ARG NVIDIA_CODEC_HEADERS_VERSION="n9.0.18.4"
ARG FFMPEG_VERSION="n5.0"
ARG NVIDIA_CODEC_HEADERS_VERSION="n12.0.16.0"
ARG PYTHON_VERSION

RUN git clone --branch ${NVIDIA_CODEC_HEADERS_VERSION} https://github.com/FFmpeg/nv-codec-headers.git
Expand All @@ -25,7 +25,7 @@ RUN git clone --branch ${FFMPEG_VERSION} https://github.com/ffmpeg/ffmpeg.git


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/include --extra-ldflags=-L/usr/local/cuda/lib64 && \
./configure --disable-doc --enable-nonfree --disable-shared --enable-nvenc --enable-cuda --enable-cuvid --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/include --extra-ldflags=-L/usr/local/cuda/lib64 && \
make -j 8

RUN apt-get install valgrind -y
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 6b5bc00

Please sign in to comment.