Skip to content
Snippets Groups Projects
Commit 7763bffd authored by Aline Gondim Santos's avatar Aline Gondim Santos
Browse files

misc: bump ffmpeg to n5.0

Change-Id: Ib9c7799cbfe4db0c429f9f8287122b47dceac296
parent e6ad7ef7
No related branches found
No related tags found
No related merge requests found
......@@ -75,6 +75,8 @@ target_link_libraries(${ProjectName} PUBLIC libavfilter libswscale libswresample
add_custom_command(
TARGET ${ProjectName}
PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/ffmpeg/ ${CONTRIB_PATH}/src/ffmpeg
COMMAND python ${DAEMON}/compat/msvc/winmake.py -fb ffmpeg
COMMAND python ${PROJECT_SOURCE_DIR}/../SDK/jplManipulation.py --preassemble --plugin=${ProjectName}
COMMENT "Assembling Plugin files"
)
......
......@@ -116,18 +116,17 @@ FilterAudioSubscriber::setIRAVFrame()
{
int ret, got_frame;
AVCodecContext* pCodecCtx;
AVCodec* pCodec;
AVPacket* packet;
FILE* pFile = fopen(irFile_.c_str(), "rb");
pCodecCtx = pFormatCtx_->streams[audioStream_]->codec;
pCodec = avcodec_find_decoder(pCodecCtx->codec_id);
const AVCodec* pCodec = avcodec_find_decoder(pFormatCtx_->streams[audioStream_]->codecpar->codec_id);
if (pCodec == NULL) {
Plog::log(Plog::LogPriority::INFO, TAG, "Codec not found.");
return;
}
pCodecCtx = avcodec_alloc_context3(pCodec);
// Open codec
if (avcodec_open2(pCodecCtx, pCodec, NULL) < 0) {
Plog::log(Plog::LogPriority::INFO, TAG, "Could not open codec.");
......@@ -151,16 +150,29 @@ FilterAudioSubscriber::setIRAVFrame()
packet->size = static_cast<int>(fread(inbuf, 1, AUDIO_INBUF_SIZE, pFile));
int idx = 0;
AVFrame* pFrame = av_frame_alloc();
if (avcodec_send_packet(pCodecCtx, packet) < 0) {
avcodec_close(pCodecCtx);
av_frame_unref(pFrame);
av_frame_free(&pFrame);
av_packet_free(&packet);
avformat_close_input(&pFormatCtx_);
avformat_free_context(pFormatCtx_);
Plog::log(Plog::LogPriority::INFO, TAG, "Error submitting the packet to the decoder");
return;
}
while (packet->size > 0 && idx < frames) {
idx++;
got_frame = 0;
int len = avcodec_decode_audio4(pCodecCtx, pFrame, &got_frame, packet);
if (len < 0) {
if (avcodec_receive_frame(pCodecCtx, pFrame) < 0) {
break;
}
if (got_frame) {
auto len = av_get_bytes_per_sample(pCodecCtx->sample_fmt);
reverbFilter_.feedInput(pFrame, "ir0");
}
packet->size -= len;
packet->data += len;
}
......
{
"name": "ffmpeg",
"version": "n4.4.2",
"url": "https://github.com/FFmpeg/FFmpeg/archive/__VERSION__.tar.gz",
"version": "n5.0",
"url": "https://git.ffmpeg.org/gitweb/ffmpeg.git/snapshot/__VERSION__.tar.gz",
"deps": [
"vpx",
"x264",
......@@ -13,13 +13,13 @@
"change-RTCP-ratio.patch",
"rtp_ext_abs_send_time.patch",
"libopusenc-reload-packet-loss-at-encode.patch",
"libopusdec-enable-FEC.patch"
],
"win_patches": [
"libopusdec-enable-FEC.patch",
"windows-configure.patch",
"windows-configure-ffnvcodec.patch",
"windows-configure-libmfx.patch"
],
"win_patches": [
],
"project_paths": [],
"with_env" : "10.0.16299.0",
"custom_scripts": {
......
FFMPEG_HASH := n4.4.2
FFMPEG_HASH := n5.0
FFMPEG_URL := https://git.ffmpeg.org/gitweb/ffmpeg.git/snapshot/$(FFMPEG_HASH).tar.gz
PKGS+=ffmpeg
......
......@@ -99,6 +99,10 @@ endif()
add_custom_command(
TARGET ${ProjectName}
PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/zlib ${CONTRIB_PATH}/src/zlib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/ffmpeg/ ${CONTRIB_PATH}/src/ffmpeg
COMMAND python ${DAEMON}/compat/msvc/winmake.py -fb zlib
COMMAND python ${DAEMON}/compat/msvc/winmake.py -fb ffmpeg
COMMAND python ${PROJECT_SOURCE_DIR}/../SDK/jplManipulation.py --preassemble --plugin=${ProjectName}
COMMAND ${CMAKE_COMMAND} -E copy ${ONNX_DIR}/onnxruntime.lib ${JPL_DIRECTORY}/lib/${CONTRIB_PLATFORM}
COMMAND ${CMAKE_COMMAND} -E copy ${ONNX_DIR}/onnxruntime.dll ${JPL_DIRECTORY}/lib/${CONTRIB_PLATFORM}
......
{
"name": "ffmpeg",
"version": "n4.4.2",
"url": "https://github.com/FFmpeg/FFmpeg/archive/__VERSION__.tar.gz",
"version": "n5.0",
"url": "https://git.ffmpeg.org/gitweb/ffmpeg.git/snapshot/__VERSION__.tar.gz",
"deps": [
"zlib",
"vpx",
......@@ -14,13 +14,13 @@
"change-RTCP-ratio.patch",
"rtp_ext_abs_send_time.patch",
"libopusenc-reload-packet-loss-at-encode.patch",
"libopusdec-enable-FEC.patch"
],
"win_patches": [
"libopusdec-enable-FEC.patch",
"windows-configure.patch",
"windows-configure-ffnvcodec.patch",
"windows-configure-libmfx.patch"
],
"win_patches": [
],
"project_paths": [],
"with_env" : "10.0.16299.0",
"custom_scripts": {
......
FFMPEG_HASH := n4.4.2
FFMPEG_HASH := n5.0
FFMPEG_URL := https://git.ffmpeg.org/gitweb/ffmpeg.git/snapshot/$(FFMPEG_HASH).tar.gz
PKGS+=ffmpeg
......
......@@ -340,11 +340,10 @@ PluginProcessor::loadBackground()
int got_frame;
AVCodecContext* pCodecCtx;
AVCodec* pCodec;
AVPacket* packet;
pCodecCtx = pFormatCtx_->streams[videoStream_]->codec;
pCodec = avcodec_find_decoder(pCodecCtx->codec_id);
const AVCodec* pCodec = avcodec_find_decoder(
pFormatCtx_->streams[videoStream_]->codecpar->codec_id);
if (pCodec == nullptr) {
mainFilter_.clean();
pFormatCtx_.reset();
......@@ -352,6 +351,7 @@ PluginProcessor::loadBackground()
return;
}
pCodecCtx = avcodec_alloc_context3(pCodec);
// Open codec
if (avcodec_open2(pCodecCtx, pCodec, NULL) < 0) {
mainFilter_.clean();
......@@ -370,13 +370,26 @@ PluginProcessor::loadBackground()
return;
}
if (avcodec_send_packet(pCodecCtx, packet) < 0) {
avcodec_close(pCodecCtx);
av_packet_free(&packet);
pFormatCtx_.reset();
Plog::log(Plog::LogPriority::INFO, TAG, "Could not send packet no codec.");
return;
}
AVFrame* bgImage = av_frame_alloc();
avcodec_decode_video2(pCodecCtx, bgImage, &got_frame, packet);
if (got_frame) {
if (avcodec_receive_frame(pCodecCtx, bgImage) < 0) {
avcodec_close(pCodecCtx);
av_packet_free(&packet);
pFormatCtx_.reset();
mainFilter_.clean();
Plog::log(Plog::LogPriority::INFO, TAG, "Could not read packet from codec.");
return;
}
mainFilter_.feedInput(bgImage, "background");
mainFilter_.feedEOF("background");
} else
mainFilter_.clean();
frameFree(bgImage);
avcodec_close(pCodecCtx);
......
......@@ -125,11 +125,10 @@ WatermarkVideoSubscriber::loadMarkLogo()
int got_frame;
AVCodecContext* pCodecCtx;
AVCodec* pCodec;
AVPacket* packet;
pCodecCtx = pFormatCtx_->streams[videoStream_]->codec;
pCodec = avcodec_find_decoder(pCodecCtx->codec_id);
const AVCodec* pCodec = avcodec_find_decoder(
pFormatCtx_->streams[videoStream_]->codecpar->codec_id);
if (pCodec == nullptr) {
pFormatCtx_.reset();
Plog::log(Plog::LogPriority::INFO, TAG, "Codec not found.");
......@@ -137,6 +136,7 @@ WatermarkVideoSubscriber::loadMarkLogo()
return;
}
pCodecCtx = avcodec_alloc_context3(pCodec);
// Open codec
if (avcodec_open2(pCodecCtx, pCodec, NULL) < 0) {
pFormatCtx_.reset();
......@@ -155,11 +155,26 @@ WatermarkVideoSubscriber::loadMarkLogo()
return;
}
if (avcodec_send_packet(pCodecCtx, packet) < 0) {
avcodec_close(pCodecCtx);
av_packet_free(&packet);
pFormatCtx_.reset();
Plog::log(Plog::LogPriority::INFO, TAG, "Could not send packet no codec.");
validLogo_ = false;
return;
}
AVFrame* logoImage = av_frame_alloc();
avcodec_decode_video2(pCodecCtx, logoImage, &got_frame, packet);
if (got_frame) {
logoFilter_.feedInput(logoImage, "logo");
if (avcodec_receive_frame(pCodecCtx, logoImage) < 0) {
avcodec_close(pCodecCtx);
av_packet_free(&packet);
pFormatCtx_.reset();
Plog::log(Plog::LogPriority::INFO, TAG, "Could not read packet from codec.");
validLogo_ = false;
return;
}
logoFilter_.feedInput(logoImage, "logo");
logoFilter_.feedEOF("logo");
frameFree(logoImage);
......
{
"name": "ffmpeg",
"version": "n4.4.2",
"url": "https://github.com/FFmpeg/FFmpeg/archive/__VERSION__.tar.gz",
"version": "n5.0",
"url": "https://git.ffmpeg.org/gitweb/ffmpeg.git/snapshot/__VERSION__.tar.gz",
"deps": [
"zlib",
"freetype",
......@@ -15,13 +15,13 @@
"change-RTCP-ratio.patch",
"rtp_ext_abs_send_time.patch",
"libopusenc-reload-packet-loss-at-encode.patch",
"libopusdec-enable-FEC.patch"
],
"win_patches": [
"libopusdec-enable-FEC.patch",
"windows-configure.patch",
"windows-configure-ffnvcodec.patch",
"windows-configure-libmfx.patch"
],
"win_patches": [
],
"project_paths": [],
"with_env" : "10.0.16299.0",
"custom_scripts": {
......
FFMPEG_HASH := n4.4.2
FFMPEG_HASH := n5.0
FFMPEG_URL := https://git.ffmpeg.org/gitweb/ffmpeg.git/snapshot/$(FFMPEG_HASH).tar.gz
PKGS+=ffmpeg
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment