nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 829 lines 43 kB view raw
1From 6ca213328dc9f63cd9b39768b4c1d5953c71219c Mon Sep 17 00:00:00 2001 2From: hashworks <mail@hashworks.net> 3Date: Sat, 25 May 2024 19:25:57 +0200 4Subject: [PATCH 01/12] Update ffmpeg version to 7.0 5 6--- 7 misc/prerequisites.sh | 2 +- 8 1 file changed, 1 insertion(+), 1 deletion(-) 9 10diff --git a/misc/prerequisites.sh b/misc/prerequisites.sh 11index a647558d3..eb4505cdc 100755 12--- a/misc/prerequisites.sh 13+++ b/misc/prerequisites.sh 14@@ -13,7 +13,7 @@ OPUS_VERSION=1.3.1 15 VPX_VERSION=1.11.0 16 FDKAAC_VERSION=2.0.2 17 NASM_VERSION=2.15.05 18-FFMPEG_VERSION=5.0.1 19+FFMPEG_VERSION=7.0 20 JEMALLOC_VERSION=5.3.0 21 PCRE2_VERSION=10.39 22 OPENH264_VERSION=2.4.0 23 24From 80b015e5374a2e4aa3f850a6797ff066860caa3d Mon Sep 17 00:00:00 2001 25From: hashworks <mail@hashworks.net> 26Date: Sat, 25 May 2024 19:26:26 +0200 27Subject: [PATCH 02/12] ffmpeg Update: stream->codecpar->channel_layout to 28 ch_layout 29MIME-Version: 1.0 30Content-Type: text/plain; charset=UTF-8 31Content-Transfer-Encoding: 8bit 32 33``` 34[ 17/505| 3%] [static] libapi_server.a: C++ projects/api_server/controllers/v1/vhosts/apps/output_profiles/output_profiles_controller.cpp => intermediates/RELEASE/objs/api_server/controllers/v1/vhosts/apps/output_profiles/output_profiles_controller.o 35In file included from projects/providers/multiplex/multiplex_stream.h:11, 36 from projects/providers/multiplex/multiplex_application.h:16, 37 from projects/api_server/controllers/v1/vhosts/apps/multiplex_channels/multiplex_channels_controller.cpp:13: 38projects/modules/ffmpeg/ffmpeg_conv.h: In static member function ‘static bool ffmpeg::Conv::ToMediaTrack(AVStream*, std::shared_ptr<MediaTrack>)’: 39projects/modules/ffmpeg/ffmpeg_conv.h:375:130: error: ‘AVCodecParameters’ {aka ‘struct AVCodecParameters’} has no member named ‘channel_layout’; did you mean ‘ch_layout’? 40 375 | media_track->GetChannel().SetLayout(ffmpeg::Conv::ToAudioChannelLayout(stream->codecpar->channel_layout)); 41 | ^~~~~~~~~~~~~~ 42 | ch_layout 43``` 44--- 45 src/projects/modules/ffmpeg/ffmpeg_conv.h | 2 +- 46 1 file changed, 1 insertion(+), 1 deletion(-) 47 48diff --git a/src/projects/modules/ffmpeg/ffmpeg_conv.h b/src/projects/modules/ffmpeg/ffmpeg_conv.h 49index 115864a05..c7eb3da34 100644 50--- a/src/projects/modules/ffmpeg/ffmpeg_conv.h 51+++ b/src/projects/modules/ffmpeg/ffmpeg_conv.h 52@@ -373,7 +373,7 @@ namespace ffmpeg 53 case cmn::MediaType::Audio: 54 media_track->SetSampleRate(stream->codecpar->sample_rate); 55 media_track->GetSample().SetFormat(ffmpeg::Conv::ToAudioSampleFormat(stream->codecpar->format)); 56- media_track->GetChannel().SetLayout(ffmpeg::Conv::ToAudioChannelLayout(stream->codecpar->channel_layout)); 57+ media_track->GetChannel().SetLayout(ffmpeg::Conv::ToAudioChannelLayout(stream->codecpar->ch_layout)); 58 break; 59 default: 60 break; 61 62From 29d3b3dbd7f3d0d05b71cb5f5f41f3396304b389 Mon Sep 17 00:00:00 2001 63From: hashworks <mail@hashworks.net> 64Date: Sat, 25 May 2024 19:26:26 +0200 65Subject: [PATCH 03/12] ffmpeg Update: Replace deprecated channel_layout with 66 ch_layout.u.mask 67 68``` 69 /** 70 * Audio only. The channel layout bitmask. May be 0 if the channel layout is 71 * unknown or unspecified, otherwise the number of bits set must be equal to 72 * the channels field. 73 * @deprecated use ch_layout 74 */ 75 attribute_deprecated 76 uint64_t channel_layout; 77``` 78--- 79 src/projects/modules/ffmpeg/ffmpeg_conv.h | 4 ++-- 80 1 file changed, 2 insertions(+), 2 deletions(-) 81 82diff --git a/src/projects/modules/ffmpeg/ffmpeg_conv.h b/src/projects/modules/ffmpeg/ffmpeg_conv.h 83index c7eb3da34..1be2ccb90 100644 84--- a/src/projects/modules/ffmpeg/ffmpeg_conv.h 85+++ b/src/projects/modules/ffmpeg/ffmpeg_conv.h 86@@ -373,7 +373,7 @@ namespace ffmpeg 87 case cmn::MediaType::Audio: 88 media_track->SetSampleRate(stream->codecpar->sample_rate); 89 media_track->GetSample().SetFormat(ffmpeg::Conv::ToAudioSampleFormat(stream->codecpar->format)); 90- media_track->GetChannel().SetLayout(ffmpeg::Conv::ToAudioChannelLayout(stream->codecpar->ch_layout)); 91+ media_track->GetChannel().SetLayout(ffmpeg::Conv::ToAudioChannelLayout(stream->codecpar->ch_layout.u.mask)); 92 break; 93 default: 94 break; 95@@ -493,7 +493,7 @@ namespace ffmpeg 96 media_frame->SetMediaType(media_type); 97 media_frame->SetBytesPerSample(::av_get_bytes_per_sample(static_cast<AVSampleFormat>(frame->format))); 98 media_frame->SetNbSamples(frame->nb_samples); 99- media_frame->GetChannels().SetLayout(ffmpeg::Conv::ToAudioChannelLayout(frame->channel_layout)); 100+ media_frame->GetChannels().SetLayout(ffmpeg::Conv::ToAudioChannelLayout(frame->ch_layout.u.mask)); 101 media_frame->SetSampleRate(frame->sample_rate); 102 media_frame->SetFormat(frame->format); 103 media_frame->SetDuration(frame->pkt_duration); 104 105From 86d3cd217e6b59ee6ab85400548ccc2697045f21 Mon Sep 17 00:00:00 2001 106From: hashworks <mail@hashworks.net> 107Date: Sat, 25 May 2024 19:46:33 +0200 108Subject: [PATCH 04/12] ffmpeg Update: Replace deprecated frame->pkt_duration 109 with duration 110 111``` 112 /** 113 * duration of the corresponding packet, expressed in 114 * AVStream->time_base units, 0 if unknown. 115 * - encoding: unused 116 * - decoding: Read by user. 117 * 118 * @deprecated use duration instead 119 */ 120 attribute_deprecated 121 int64_t pkt_duration; 122``` 123--- 124 src/projects/modules/ffmpeg/ffmpeg_conv.h | 4 ++-- 125 src/projects/transcoder/codec/decoder/decoder_aac.cpp | 6 +++--- 126 src/projects/transcoder/codec/decoder/decoder_avc.cpp | 4 ++-- 127 .../transcoder/codec/decoder/decoder_avc_nilogan.cpp | 4 ++-- 128 src/projects/transcoder/codec/decoder/decoder_avc_nv.cpp | 4 ++-- 129 src/projects/transcoder/codec/decoder/decoder_avc_qsv.cpp | 4 ++-- 130 src/projects/transcoder/codec/decoder/decoder_avc_xma.cpp | 4 ++-- 131 src/projects/transcoder/codec/decoder/decoder_hevc.cpp | 4 ++-- 132 .../transcoder/codec/decoder/decoder_hevc_nilogan.cpp | 4 ++-- 133 src/projects/transcoder/codec/decoder/decoder_hevc_nv.cpp | 4 ++-- 134 src/projects/transcoder/codec/decoder/decoder_hevc_qsv.cpp | 4 ++-- 135 src/projects/transcoder/codec/decoder/decoder_hevc_xma.cpp | 4 ++-- 136 src/projects/transcoder/codec/decoder/decoder_mp3.cpp | 6 +++--- 137 src/projects/transcoder/codec/decoder/decoder_opus.cpp | 6 +++--- 138 src/projects/transcoder/codec/decoder/decoder_vp8.cpp | 2 +- 139 15 files changed, 32 insertions(+), 32 deletions(-) 140 141diff --git a/src/projects/modules/ffmpeg/ffmpeg_conv.h b/src/projects/modules/ffmpeg/ffmpeg_conv.h 142index 1be2ccb90..06d4107c8 100644 143--- a/src/projects/modules/ffmpeg/ffmpeg_conv.h 144+++ b/src/projects/modules/ffmpeg/ffmpeg_conv.h 145@@ -478,7 +478,7 @@ namespace ffmpeg 146 media_frame->SetHeight(frame->height); 147 media_frame->SetFormat(frame->format); 148 media_frame->SetPts((frame->pts == AV_NOPTS_VALUE) ? -1LL : frame->pts); 149- media_frame->SetDuration(frame->pkt_duration); 150+ media_frame->SetDuration(frame->duration); 151 152 AVFrame* moved_frame = av_frame_alloc(); 153 av_frame_move_ref(moved_frame, frame); 154@@ -496,7 +496,7 @@ namespace ffmpeg 155 media_frame->GetChannels().SetLayout(ffmpeg::Conv::ToAudioChannelLayout(frame->ch_layout.u.mask)); 156 media_frame->SetSampleRate(frame->sample_rate); 157 media_frame->SetFormat(frame->format); 158- media_frame->SetDuration(frame->pkt_duration); 159+ media_frame->SetDuration(frame->duration); 160 media_frame->SetPts((frame->pts == AV_NOPTS_VALUE) ? -1LL : frame->pts); 161 162 AVFrame* moved_frame = av_frame_alloc(); 163diff --git a/src/projects/transcoder/codec/decoder/decoder_aac.cpp b/src/projects/transcoder/codec/decoder/decoder_aac.cpp 164index c1302d50a..1fbefdae3 100644 165--- a/src/projects/transcoder/codec/decoder/decoder_aac.cpp 166+++ b/src/projects/transcoder/codec/decoder/decoder_aac.cpp 167@@ -215,16 +215,16 @@ void DecoderAAC::CodecThread() 168 } 169 170 // If there is no duration, the duration is calculated by timebase. 171- if (_frame->pkt_duration <= 0LL) 172+ if (_frame->duration <= 0LL) 173 { 174- _frame->pkt_duration = ffmpeg::Conv::GetDurationPerFrame(cmn::MediaType::Audio, GetRefTrack(), _frame); 175+ _frame->duration = ffmpeg::Conv::GetDurationPerFrame(cmn::MediaType::Audio, GetRefTrack(), _frame); 176 } 177 178 179 // If the decoded audio frame does not have a PTS, Increase frame duration time in PTS of previous frame 180 if(_frame->pts == AV_NOPTS_VALUE) 181 { 182- _frame->pts = _last_pkt_pts + _frame->pkt_duration; 183+ _frame->pts = _last_pkt_pts + _frame->duration; 184 } 185 186 auto output_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Audio, _frame); 187diff --git a/src/projects/transcoder/codec/decoder/decoder_avc.cpp b/src/projects/transcoder/codec/decoder/decoder_avc.cpp 188index 1ec6f185e..b7339e71c 100644 189--- a/src/projects/transcoder/codec/decoder/decoder_avc.cpp 190+++ b/src/projects/transcoder/codec/decoder/decoder_avc.cpp 191@@ -270,9 +270,9 @@ void DecoderAVC::CodecThread() 192 } 193 194 // If there is no duration, the duration is calculated by framerate and timebase. 195- if(_frame->pkt_duration <= 0LL && _context->framerate.num > 0 && _context->framerate.den > 0) 196+ if(_frame->duration <= 0LL && _context->framerate.num > 0 && _context->framerate.den > 0) 197 { 198- _frame->pkt_duration = (int64_t)( ((double)_context->framerate.den / (double)_context->framerate.num) / ((double) GetRefTrack()->GetTimeBase().GetNum() / (double) GetRefTrack()->GetTimeBase().GetDen()) ); 199+ _frame->duration = (int64_t)( ((double)_context->framerate.den / (double)_context->framerate.num) / ((double) GetRefTrack()->GetTimeBase().GetNum() / (double) GetRefTrack()->GetTimeBase().GetDen()) ); 200 } 201 202 203diff --git a/src/projects/transcoder/codec/decoder/decoder_avc_nilogan.cpp b/src/projects/transcoder/codec/decoder/decoder_avc_nilogan.cpp 204index 50b829a93..7bb959102 100644 205--- a/src/projects/transcoder/codec/decoder/decoder_avc_nilogan.cpp 206+++ b/src/projects/transcoder/codec/decoder/decoder_avc_nilogan.cpp 207@@ -292,9 +292,9 @@ void DecoderAVCxNILOGAN::CodecThread() 208 } 209 210 // If there is no duration, the duration is calculated by framerate and timebase. 211- if(_frame->pkt_duration <= 0LL && _context->framerate.num > 0 && _context->framerate.den > 0) 212+ if(_frame->duration <= 0LL && _context->framerate.num > 0 && _context->framerate.den > 0) 213 { 214- _frame->pkt_duration = (int64_t)( ((double)_context->framerate.den / (double)_context->framerate.num) / ((double) GetRefTrack()->GetTimeBase().GetNum() / (double) GetRefTrack()->GetTimeBase().GetDen()) ); 215+ _frame->duration = (int64_t)( ((double)_context->framerate.den / (double)_context->framerate.num) / ((double) GetRefTrack()->GetTimeBase().GetNum() / (double) GetRefTrack()->GetTimeBase().GetDen()) ); 216 } 217 218 auto decoded_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Video, _frame); 219diff --git a/src/projects/transcoder/codec/decoder/decoder_avc_nv.cpp b/src/projects/transcoder/codec/decoder/decoder_avc_nv.cpp 220index d6a444901..d5b82f2f6 100644 221--- a/src/projects/transcoder/codec/decoder/decoder_avc_nv.cpp 222+++ b/src/projects/transcoder/codec/decoder/decoder_avc_nv.cpp 223@@ -271,9 +271,9 @@ void DecoderAVCxNV::CodecThread() 224 } 225 226 // If there is no duration, the duration is calculated by framerate and timebase. 227- if(_frame->pkt_duration <= 0LL && _context->framerate.num > 0 && _context->framerate.den > 0) 228+ if(_frame->duration <= 0LL && _context->framerate.num > 0 && _context->framerate.den > 0) 229 { 230- _frame->pkt_duration = (int64_t)( ((double)_context->framerate.den / (double)_context->framerate.num) / (double) GetRefTrack()->GetTimeBase().GetExpr() ); 231+ _frame->duration = (int64_t)( ((double)_context->framerate.den / (double)_context->framerate.num) / (double) GetRefTrack()->GetTimeBase().GetExpr() ); 232 } 233 234 auto decoded_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Video, _frame); 235diff --git a/src/projects/transcoder/codec/decoder/decoder_avc_qsv.cpp b/src/projects/transcoder/codec/decoder/decoder_avc_qsv.cpp 236index 541040a2d..595065866 100644 237--- a/src/projects/transcoder/codec/decoder/decoder_avc_qsv.cpp 238+++ b/src/projects/transcoder/codec/decoder/decoder_avc_qsv.cpp 239@@ -210,9 +210,9 @@ void DecoderAVCxQSV::CodecThread() 240 } 241 242 // If there is no duration, the duration is calculated by framerate and timebase. 243- if(_frame->pkt_duration <= 0LL && _context->framerate.num > 0 && _context->framerate.den > 0) 244+ if(_frame->duration <= 0LL && _context->framerate.num > 0 && _context->framerate.den > 0) 245 { 246- _frame->pkt_duration = (int64_t)( ((double)_context->framerate.den / (double)_context->framerate.num) / ((double) GetRefTrack()->GetTimeBase().GetNum() / (double) GetRefTrack()->GetTimeBase().GetDen()) ); 247+ _frame->duration = (int64_t)( ((double)_context->framerate.den / (double)_context->framerate.num) / ((double) GetRefTrack()->GetTimeBase().GetNum() / (double) GetRefTrack()->GetTimeBase().GetDen()) ); 248 } 249 250 auto decoded_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Video, _frame); 251diff --git a/src/projects/transcoder/codec/decoder/decoder_avc_xma.cpp b/src/projects/transcoder/codec/decoder/decoder_avc_xma.cpp 252index b4bc8b896..494c5f910 100644 253--- a/src/projects/transcoder/codec/decoder/decoder_avc_xma.cpp 254+++ b/src/projects/transcoder/codec/decoder/decoder_avc_xma.cpp 255@@ -295,9 +295,9 @@ void DecoderAVCxXMA::CodecThread() 256 } 257 258 // If there is no duration, the duration is calculated by framerate and timebase. 259- if(_frame->pkt_duration <= 0LL && _context->framerate.num > 0 && _context->framerate.den > 0) 260+ if(_frame->duration <= 0LL && _context->framerate.num > 0 && _context->framerate.den > 0) 261 { 262- _frame->pkt_duration = (int64_t)( ((double)_context->framerate.den / (double)_context->framerate.num) / ((double) GetRefTrack()->GetTimeBase().GetNum() / (double) GetRefTrack()->GetTimeBase().GetDen()) ); 263+ _frame->duration = (int64_t)( ((double)_context->framerate.den / (double)_context->framerate.num) / ((double) GetRefTrack()->GetTimeBase().GetNum() / (double) GetRefTrack()->GetTimeBase().GetDen()) ); 264 } 265 266 auto decoded_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Video, _frame); 267diff --git a/src/projects/transcoder/codec/decoder/decoder_hevc.cpp b/src/projects/transcoder/codec/decoder/decoder_hevc.cpp 268index eea80b21b..0c58fec8c 100755 269--- a/src/projects/transcoder/codec/decoder/decoder_hevc.cpp 270+++ b/src/projects/transcoder/codec/decoder/decoder_hevc.cpp 271@@ -261,9 +261,9 @@ void DecoderHEVC::CodecThread() 272 } 273 274 // If there is no duration, the duration is calculated by framerate and timebase. 275- if(_frame->pkt_duration <= 0LL && _context->framerate.num > 0 && _context->framerate.den > 0) 276+ if(_frame->duration <= 0LL && _context->framerate.num > 0 && _context->framerate.den > 0) 277 { 278- _frame->pkt_duration = (int64_t)( ((double)_context->framerate.den / (double)_context->framerate.num) / ((double) GetRefTrack()->GetTimeBase().GetNum() / (double) GetRefTrack()->GetTimeBase().GetDen()) ); 279+ _frame->duration = (int64_t)( ((double)_context->framerate.den / (double)_context->framerate.num) / ((double) GetRefTrack()->GetTimeBase().GetNum() / (double) GetRefTrack()->GetTimeBase().GetDen()) ); 280 } 281 282 auto decoded_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Video, _frame); 283diff --git a/src/projects/transcoder/codec/decoder/decoder_hevc_nilogan.cpp b/src/projects/transcoder/codec/decoder/decoder_hevc_nilogan.cpp 284index e5868db24..60a68ef87 100644 285--- a/src/projects/transcoder/codec/decoder/decoder_hevc_nilogan.cpp 286+++ b/src/projects/transcoder/codec/decoder/decoder_hevc_nilogan.cpp 287@@ -257,9 +257,9 @@ void DecoderHEVCxNILOGAN::CodecThread() 288 } 289 290 // If there is no duration, the duration is calculated by framerate and timebase. 291- if(_frame->pkt_duration <= 0LL && _context->framerate.num > 0 && _context->framerate.den > 0) 292+ if(_frame->duration <= 0LL && _context->framerate.num > 0 && _context->framerate.den > 0) 293 { 294- _frame->pkt_duration = (int64_t)( ((double)_context->framerate.den / (double)_context->framerate.num) / ((double) GetRefTrack()->GetTimeBase().GetNum() / (double) GetRefTrack()->GetTimeBase().GetDen()) ); 295+ _frame->duration = (int64_t)( ((double)_context->framerate.den / (double)_context->framerate.num) / ((double) GetRefTrack()->GetTimeBase().GetNum() / (double) GetRefTrack()->GetTimeBase().GetDen()) ); 296 } 297 298 auto decoded_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Video, _frame); 299diff --git a/src/projects/transcoder/codec/decoder/decoder_hevc_nv.cpp b/src/projects/transcoder/codec/decoder/decoder_hevc_nv.cpp 300index 76f7f5ed1..44fe91828 100644 301--- a/src/projects/transcoder/codec/decoder/decoder_hevc_nv.cpp 302+++ b/src/projects/transcoder/codec/decoder/decoder_hevc_nv.cpp 303@@ -260,9 +260,9 @@ void DecoderHEVCxNV::CodecThread() 304 } 305 306 // If there is no duration, the duration is calculated by framerate and timebase. 307- if(_frame->pkt_duration <= 0LL && _context->framerate.num > 0 && _context->framerate.den > 0) 308+ if(_frame->duration <= 0LL && _context->framerate.num > 0 && _context->framerate.den > 0) 309 { 310- _frame->pkt_duration = (int64_t)( ((double)_context->framerate.den / (double)_context->framerate.num) / ((double) GetRefTrack()->GetTimeBase().GetNum() / (double) GetRefTrack()->GetTimeBase().GetDen()) ); 311+ _frame->duration = (int64_t)( ((double)_context->framerate.den / (double)_context->framerate.num) / ((double) GetRefTrack()->GetTimeBase().GetNum() / (double) GetRefTrack()->GetTimeBase().GetDen()) ); 312 } 313 314 auto decoded_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Video, _frame); 315diff --git a/src/projects/transcoder/codec/decoder/decoder_hevc_qsv.cpp b/src/projects/transcoder/codec/decoder/decoder_hevc_qsv.cpp 316index c7ec0d137..c8531e0ba 100644 317--- a/src/projects/transcoder/codec/decoder/decoder_hevc_qsv.cpp 318+++ b/src/projects/transcoder/codec/decoder/decoder_hevc_qsv.cpp 319@@ -208,9 +208,9 @@ void DecoderHEVCxQSV::CodecThread() 320 } 321 322 // If there is no duration, the duration is calculated by framerate and timebase. 323- if(_frame->pkt_duration <= 0LL && _context->framerate.num > 0 && _context->framerate.den > 0) 324+ if(_frame->duration <= 0LL && _context->framerate.num > 0 && _context->framerate.den > 0) 325 { 326- _frame->pkt_duration = (int64_t)( ((double)_context->framerate.den / (double)_context->framerate.num) / ((double) GetRefTrack()->GetTimeBase().GetNum() / (double) GetRefTrack()->GetTimeBase().GetDen()) ); 327+ _frame->duration = (int64_t)( ((double)_context->framerate.den / (double)_context->framerate.num) / ((double) GetRefTrack()->GetTimeBase().GetNum() / (double) GetRefTrack()->GetTimeBase().GetDen()) ); 328 } 329 330 auto decoded_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Video, _frame); 331diff --git a/src/projects/transcoder/codec/decoder/decoder_hevc_xma.cpp b/src/projects/transcoder/codec/decoder/decoder_hevc_xma.cpp 332index 521dc12ef..1f971b4f6 100644 333--- a/src/projects/transcoder/codec/decoder/decoder_hevc_xma.cpp 334+++ b/src/projects/transcoder/codec/decoder/decoder_hevc_xma.cpp 335@@ -295,9 +295,9 @@ void DecoderHEVCxXMA::CodecThread() 336 } 337 338 // If there is no duration, the duration is calculated by framerate and timebase. 339- if(_frame->pkt_duration <= 0LL && _context->framerate.num > 0 && _context->framerate.den > 0) 340+ if(_frame->duration <= 0LL && _context->framerate.num > 0 && _context->framerate.den > 0) 341 { 342- _frame->pkt_duration = (int64_t)( ((double)_context->framerate.den / (double)_context->framerate.num) / ((double) GetRefTrack()->GetTimeBase().GetNum() / (double) GetRefTrack()->GetTimeBase().GetDen()) ); 343+ _frame->duration = (int64_t)( ((double)_context->framerate.den / (double)_context->framerate.num) / ((double) GetRefTrack()->GetTimeBase().GetNum() / (double) GetRefTrack()->GetTimeBase().GetDen()) ); 344 } 345 346 auto decoded_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Video, _frame); 347diff --git a/src/projects/transcoder/codec/decoder/decoder_mp3.cpp b/src/projects/transcoder/codec/decoder/decoder_mp3.cpp 348index a53c2f831..c7301a1cf 100644 349--- a/src/projects/transcoder/codec/decoder/decoder_mp3.cpp 350+++ b/src/projects/transcoder/codec/decoder/decoder_mp3.cpp 351@@ -215,16 +215,16 @@ void DecoderMP3::CodecThread() 352 } 353 354 // If there is no duration, the duration is calculated by timebase. 355- if (_frame->pkt_duration <= 0LL) 356+ if (_frame->duration <= 0LL) 357 { 358- _frame->pkt_duration = ffmpeg::Conv::GetDurationPerFrame(cmn::MediaType::Audio, GetRefTrack(), _frame); 359+ _frame->duration = ffmpeg::Conv::GetDurationPerFrame(cmn::MediaType::Audio, GetRefTrack(), _frame); 360 } 361 362 363 // If the decoded audio frame does not have a PTS, Increase frame duration time in PTS of previous frame 364 if(_frame->pts == AV_NOPTS_VALUE) 365 { 366- _frame->pts = _last_pkt_pts + _frame->pkt_duration; 367+ _frame->pts = _last_pkt_pts + _frame->duration; 368 } 369 370 auto output_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Audio, _frame); 371diff --git a/src/projects/transcoder/codec/decoder/decoder_opus.cpp b/src/projects/transcoder/codec/decoder/decoder_opus.cpp 372index 031db5f06..2d43143e9 100644 373--- a/src/projects/transcoder/codec/decoder/decoder_opus.cpp 374+++ b/src/projects/transcoder/codec/decoder/decoder_opus.cpp 375@@ -215,16 +215,16 @@ void DecoderOPUS::CodecThread() 376 } 377 378 // If there is no duration, the duration is calculated by timebase. 379- if (_frame->pkt_duration <= 0LL) 380+ if (_frame->duration <= 0LL) 381 { 382- _frame->pkt_duration = ffmpeg::Conv::GetDurationPerFrame(cmn::MediaType::Audio, GetRefTrack(), _frame); 383+ _frame->duration = ffmpeg::Conv::GetDurationPerFrame(cmn::MediaType::Audio, GetRefTrack(), _frame); 384 } 385 386 387 // If the decoded audio frame does not have a PTS, Increase frame duration time in PTS of previous frame 388 if(_frame->pts == AV_NOPTS_VALUE) 389 { 390- _frame->pts = _last_pkt_pts + _frame->pkt_duration; 391+ _frame->pts = _last_pkt_pts + _frame->duration; 392 } 393 394 auto output_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Audio, _frame); 395diff --git a/src/projects/transcoder/codec/decoder/decoder_vp8.cpp b/src/projects/transcoder/codec/decoder/decoder_vp8.cpp 396index c52edb977..616147a7a 100644 397--- a/src/projects/transcoder/codec/decoder/decoder_vp8.cpp 398+++ b/src/projects/transcoder/codec/decoder/decoder_vp8.cpp 399@@ -253,7 +253,7 @@ void DecoderVP8::CodecThread() 400 } 401 402 // If there is no duration, the duration is calculated by framerate and timebase. 403- _frame->pkt_duration = (_frame->pkt_duration <= 0LL) ? ffmpeg::Conv::GetDurationPerFrame(cmn::MediaType::Video, GetRefTrack()) : _frame->pkt_duration; 404+ _frame->duration = (_frame->duration <= 0LL) ? ffmpeg::Conv::GetDurationPerFrame(cmn::MediaType::Video, GetRefTrack()) : _frame->duration; 405 406 auto decoded_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Video, _frame); 407 ::av_frame_unref(_frame); 408 409From f469e7e18344243248585b3b5478aba95454231e Mon Sep 17 00:00:00 2001 410From: hashworks <mail@hashworks.net> 411Date: Sat, 25 May 2024 20:26:32 +0200 412Subject: [PATCH 05/12] ffmpeg Update: Replace deprecated 413 av_get_channel_layout_string with av_get_channel_layout_describe 414 415``` 416/** 417 * Return a description of a channel layout. 418 * If nb_channels is <= 0, it is guessed from the channel_layout. 419 * 420 * @param buf put here the string containing the channel layout 421 * @param buf_size size in bytes of the buffer 422 * @param nb_channels number of channels 423 * @param channel_layout channel layout bitset 424 * @deprecated use av_channel_layout_describe() 425 */ 426attribute_deprecated 427void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout); 428``` 429--- 430 src/projects/modules/ffmpeg/ffmpeg_conv.h | 7 ++++--- 431 1 file changed, 4 insertions(+), 3 deletions(-) 432 433diff --git a/src/projects/modules/ffmpeg/ffmpeg_conv.h b/src/projects/modules/ffmpeg/ffmpeg_conv.h 434index 06d4107c8..05981c542 100644 435--- a/src/projects/modules/ffmpeg/ffmpeg_conv.h 436+++ b/src/projects/modules/ffmpeg/ffmpeg_conv.h 437@@ -701,11 +701,12 @@ namespace ffmpeg 438 } 439 else 440 { 441- char channel_layout[16]{}; 442- ::av_get_channel_layout_string(channel_layout, OV_COUNTOF(channel_layout), parameters->channels, parameters->channel_layout); 443+ char channel_layout_buf[16]{}; 444+ 445+ ::av_channel_layout_describe(&parameters->ch_layout, channel_layout_buf, OV_COUNTOF(channel_layout_buf)); 446 447 // 48000 Hz, stereo, fltp, 448- message.AppendFormat("%d Hz, %s(%d), %s, ", parameters->sample_rate, channel_layout, parameters->channels, ::av_get_sample_fmt_name(static_cast<AVSampleFormat>(parameters->format))); 449+ message.AppendFormat("%d Hz, %s(%d), %s, ", parameters->sample_rate, channel_layout_buf, parameters->channels, ::av_get_sample_fmt_name(static_cast<AVSampleFormat>(parameters->format))); 450 } 451 452 message.AppendFormat("%d kbps, ", (parameters->bit_rate / 1024)); 453 454From a73e2efb2466d18fc15fdeccb0c5da031bcec643 Mon Sep 17 00:00:00 2001 455From: hashworks <mail@hashworks.net> 456Date: Sat, 25 May 2024 20:31:15 +0200 457Subject: [PATCH 06/12] ffmpeg Update: Replace deprecated channels with 458 ch_layout.nb_channels 459 460``` 461 /** 462 * Audio only. The number of audio channels. 463 * @deprecated use ch_layout.nb_channels 464 */ 465 attribute_deprecated 466 int channels; 467``` 468--- 469 src/projects/modules/ffmpeg/ffmpeg_conv.h | 5 ++--- 470 1 file changed, 2 insertions(+), 3 deletions(-) 471 472diff --git a/src/projects/modules/ffmpeg/ffmpeg_conv.h b/src/projects/modules/ffmpeg/ffmpeg_conv.h 473index 05981c542..7b199f08a 100644 474--- a/src/projects/modules/ffmpeg/ffmpeg_conv.h 475+++ b/src/projects/modules/ffmpeg/ffmpeg_conv.h 476@@ -702,11 +702,10 @@ namespace ffmpeg 477 else 478 { 479 char channel_layout_buf[16]{}; 480- 481 ::av_channel_layout_describe(&parameters->ch_layout, channel_layout_buf, OV_COUNTOF(channel_layout_buf)); 482 483 // 48000 Hz, stereo, fltp, 484- message.AppendFormat("%d Hz, %s(%d), %s, ", parameters->sample_rate, channel_layout_buf, parameters->channels, ::av_get_sample_fmt_name(static_cast<AVSampleFormat>(parameters->format))); 485+ message.AppendFormat("%d Hz, %s(%d), %s, ", parameters->sample_rate, channel_layout_buf, parameters->ch_layout.nb_channels, ::av_get_sample_fmt_name(static_cast<AVSampleFormat>(parameters->format))); 486 } 487 488 message.AppendFormat("%d kbps, ", (parameters->bit_rate / 1024)); 489@@ -790,7 +789,7 @@ namespace ffmpeg 490 break; 491 492 case cmn::MediaType::Audio: { 493- codecpar->channels = static_cast<int>(media_track->GetChannel().GetCounts()); 494+ codecpar->ch_layout.nb_channels = static_cast<int>(media_track->GetChannel().GetCounts()); 495 codecpar->channel_layout = ToAVChannelLayout(media_track->GetChannel().GetLayout()); 496 codecpar->sample_rate = media_track->GetSample().GetRateNum(); 497 codecpar->frame_size = (media_track->GetAudioSamplesPerFrame()!=0)?media_track->GetAudioSamplesPerFrame():1024; 498 499From f0334563e0aa1baf038c8c93111b2517e1a7f7be Mon Sep 17 00:00:00 2001 500From: hashworks <mail@hashworks.net> 501Date: Sat, 25 May 2024 20:49:52 +0200 502Subject: [PATCH 07/12] ffmpeg Update: Replace deprecated channel_layout with 503 ch_layout struct 504 505--- 506 src/projects/modules/ffmpeg/ffmpeg_conv.h | 13 +++++++++---- 507 src/projects/modules/segment_writer/writer.cpp | 8 ++++++-- 508 .../transcoder/codec/encoder/encoder_aac.cpp | 8 ++++++-- 509 .../transcoder/codec/encoder/encoder_ffopus.cpp | 10 +++++++--- 510 src/projects/transcoder/filter/filter_resampler.cpp | 2 +- 511 5 files changed, 29 insertions(+), 12 deletions(-) 512 513diff --git a/src/projects/modules/ffmpeg/ffmpeg_conv.h b/src/projects/modules/ffmpeg/ffmpeg_conv.h 514index 7b199f08a..f67932f63 100644 515--- a/src/projects/modules/ffmpeg/ffmpeg_conv.h 516+++ b/src/projects/modules/ffmpeg/ffmpeg_conv.h 517@@ -789,10 +789,15 @@ namespace ffmpeg 518 break; 519 520 case cmn::MediaType::Audio: { 521- codecpar->ch_layout.nb_channels = static_cast<int>(media_track->GetChannel().GetCounts()); 522- codecpar->channel_layout = ToAVChannelLayout(media_track->GetChannel().GetLayout()); 523- codecpar->sample_rate = media_track->GetSample().GetRateNum(); 524- codecpar->frame_size = (media_track->GetAudioSamplesPerFrame()!=0)?media_track->GetAudioSamplesPerFrame():1024; 525+ uint64_t channel_layout = ToAVChannelLayout(media_track->GetChannel().GetLayout()); 526+ codecpar->ch_layout = { 527+ .order = AVChannelOrder::AV_CHANNEL_ORDER_NATIVE, 528+ .nb_channels = static_cast<int>(media_track->GetChannel().GetCounts()), 529+ .u = {.mask = channel_layout} 530+ }; 531+ 532+ codecpar->sample_rate = media_track->GetSample().GetRateNum(); 533+ codecpar->frame_size = (media_track->GetAudioSamplesPerFrame()!=0)?media_track->GetAudioSamplesPerFrame():1024; 534 } 535 break; 536 537diff --git a/src/projects/modules/segment_writer/writer.cpp b/src/projects/modules/segment_writer/writer.cpp 538index 1fb8fd94d..6e2dc42b7 100644 539--- a/src/projects/modules/segment_writer/writer.cpp 540+++ b/src/projects/modules/segment_writer/writer.cpp 541@@ -256,13 +256,17 @@ bool Writer::FillCodecParameters(const std::shared_ptr<const Track> &track, AVCo 542 codec_parameters->codec_type = AVMEDIA_TYPE_AUDIO; 543 codec_parameters->codec_id = AvCodecIdFromMediaCodecId(media_track->GetCodecId()); 544 codec_parameters->bit_rate = media_track->GetBitrate(); 545- codec_parameters->channels = static_cast<int>(media_track->GetChannel().GetCounts()); 546- codec_parameters->channel_layout = AvChannelLayoutFromAudioChannelLayout(media_track->GetChannel().GetLayout()); 547 codec_parameters->sample_rate = media_track->GetSample().GetRateNum(); 548 codec_parameters->frame_size = 1024; 549 codec_parameters->format = static_cast<int>(media_track->GetSample().GetFormat()); 550 codec_parameters->codec_tag = 0; 551 552+ codec_parameters->ch_layout = { 553+ .order = AVChannelOrder::AV_CHANNEL_ORDER_NATIVE, 554+ .nb_channels = static_cast<int>(media_track->GetChannel().GetCounts()), 555+ .u = {.mask = static_cast<uint64_t>(AvChannelLayoutFromAudioChannelLayout(media_track->GetChannel().GetLayout()))} 556+ }; 557+ 558 std::shared_ptr<ov::Data> extra_data = nullptr; 559 if (media_track->GetCodecId() == cmn::MediaCodecId::Aac) 560 { 561diff --git a/src/projects/transcoder/codec/encoder/encoder_aac.cpp b/src/projects/transcoder/codec/encoder/encoder_aac.cpp 562index 238de1541..91e5eefd3 100644 563--- a/src/projects/transcoder/codec/encoder/encoder_aac.cpp 564+++ b/src/projects/transcoder/codec/encoder/encoder_aac.cpp 565@@ -15,8 +15,12 @@ bool EncoderAAC::SetCodecParams() 566 _codec_context->bit_rate = GetRefTrack()->GetBitrate(); 567 _codec_context->sample_fmt = (AVSampleFormat)GetSupportedFormat(); 568 _codec_context->sample_rate = GetRefTrack()->GetSampleRate(); 569- _codec_context->channel_layout = static_cast<uint64_t>(GetRefTrack()->GetChannel().GetLayout()); 570- _codec_context->channels = GetRefTrack()->GetChannel().GetCounts(); 571+ 572+ _codec_context->ch_layout = { 573+ .order = AVChannelOrder::AV_CHANNEL_ORDER_NATIVE, 574+ .nb_channels = static_cast<int>(GetRefTrack()->GetChannel().GetCounts()), 575+ .u = {.mask = static_cast<uint64_t>(GetRefTrack()->GetChannel().GetLayout())} 576+ }; 577 578 _bitstream_format = cmn::BitstreamFormat::AAC_ADTS; 579 580diff --git a/src/projects/transcoder/codec/encoder/encoder_ffopus.cpp b/src/projects/transcoder/codec/encoder/encoder_ffopus.cpp 581index c70021b18..3c0a53812 100644 582--- a/src/projects/transcoder/codec/encoder/encoder_ffopus.cpp 583+++ b/src/projects/transcoder/codec/encoder/encoder_ffopus.cpp 584@@ -15,9 +15,13 @@ bool EncoderFFOPUS::SetCodecParams() 585 _codec_context->bit_rate = GetRefTrack()->GetBitrate(); 586 _codec_context->sample_fmt = (AVSampleFormat)GetSupportedFormat(); 587 _codec_context->sample_rate = GetRefTrack()->GetSampleRate(); 588- _codec_context->channel_layout = static_cast<uint64_t>(GetRefTrack()->GetChannel().GetLayout()); 589- _codec_context->channels = GetRefTrack()->GetChannel().GetCounts(); 590- 591+ 592+ _codec_context->ch_layout = { 593+ .order = AVChannelOrder::AV_CHANNEL_ORDER_NATIVE, 594+ .nb_channels = static_cast<int>(GetRefTrack()->GetChannel().GetCounts()), 595+ .u = {.mask = static_cast<uint64_t>(GetRefTrack()->GetChannel().GetLayout())} 596+ }; 597+ 598 // Support Frequency 599 // 4000 - OPUS_BANDWIDTH_NARROWBAND (8kHz) (2~8 kbps) 600 // 6000 - OPUS_BANDWIDTH_MEDIUMBAND (12kHz) 601diff --git a/src/projects/transcoder/filter/filter_resampler.cpp b/src/projects/transcoder/filter/filter_resampler.cpp 602index beda3b993..9bf3f33fd 100644 603--- a/src/projects/transcoder/filter/filter_resampler.cpp 604+++ b/src/projects/transcoder/filter/filter_resampler.cpp 605@@ -248,7 +248,7 @@ void FilterResampler::WorkerThread() 606 if (ret < 0) 607 { 608 logte("An error occurred while feeding the audio filtergraph: pts: %lld, linesize: %d, srate: %d, layout: %d, channels: %d, format: %d, rq: %d", 609- _frame->pts, _frame->linesize[0], _frame->sample_rate, _frame->channel_layout, _frame->channels, _frame->format, _input_buffer.Size()); 610+ _frame->pts, _frame->linesize[0], _frame->sample_rate, _frame->ch_layout.u.mask, _frame->ch_layout.nb_channels, _frame->format, _input_buffer.Size()); 611 612 continue; 613 } 614 615From 555e779e02311a31dfd6a8ee7e65c21e1e0a3b8c Mon Sep 17 00:00:00 2001 616From: hashworks <mail@hashworks.net> 617Date: Sat, 25 May 2024 21:01:39 +0200 618Subject: [PATCH 08/12] ffmpeg Update: Drop depreacted avcodec_close and use 619 avcodec_free_context only 620 621--- 622 src/projects/transcoder/codec/decoder/decoder_avc.cpp | 1 - 623 src/projects/transcoder/codec/decoder/decoder_avc_nilogan.cpp | 1 - 624 src/projects/transcoder/codec/decoder/decoder_avc_nv.cpp | 1 - 625 src/projects/transcoder/codec/decoder/decoder_avc_xma.cpp | 1 - 626 src/projects/transcoder/codec/decoder/decoder_hevc.cpp | 1 - 627 src/projects/transcoder/codec/decoder/decoder_hevc_nv.cpp | 1 - 628 src/projects/transcoder/codec/decoder/decoder_hevc_xma.cpp | 1 - 629 src/projects/transcoder/codec/decoder/decoder_vp8.cpp | 1 - 630 8 files changed, 8 deletions(-) 631 632diff --git a/src/projects/transcoder/codec/decoder/decoder_avc.cpp b/src/projects/transcoder/codec/decoder/decoder_avc.cpp 633index b7339e71c..760f02622 100644 634--- a/src/projects/transcoder/codec/decoder/decoder_avc.cpp 635+++ b/src/projects/transcoder/codec/decoder/decoder_avc.cpp 636@@ -92,7 +92,6 @@ bool DecoderAVC::InitCodec() 637 638 void DecoderAVC::UninitCodec() 639 { 640- ::avcodec_close(_context); 641 ::avcodec_free_context(&_context); 642 643 _context = nullptr; 644diff --git a/src/projects/transcoder/codec/decoder/decoder_avc_nilogan.cpp b/src/projects/transcoder/codec/decoder/decoder_avc_nilogan.cpp 645index 7bb959102..7c6bbcd0d 100644 646--- a/src/projects/transcoder/codec/decoder/decoder_avc_nilogan.cpp 647+++ b/src/projects/transcoder/codec/decoder/decoder_avc_nilogan.cpp 648@@ -117,7 +117,6 @@ bool DecoderAVCxNILOGAN::InitCodec() 649 it seems that dynamic resolution is supported 650 void DecoderAVCxNILOGAN::UninitCodec() 651 { 652- ::avcodec_close(_context); 653 ::avcodec_free_context(&_context); 654 655 _context = nullptr; 656diff --git a/src/projects/transcoder/codec/decoder/decoder_avc_nv.cpp b/src/projects/transcoder/codec/decoder/decoder_avc_nv.cpp 657index d5b82f2f6..83c3da39e 100644 658--- a/src/projects/transcoder/codec/decoder/decoder_avc_nv.cpp 659+++ b/src/projects/transcoder/codec/decoder/decoder_avc_nv.cpp 660@@ -99,7 +99,6 @@ bool DecoderAVCxNV::InitCodec() 661 662 void DecoderAVCxNV::UninitCodec() 663 { 664- ::avcodec_close(_context); 665 ::avcodec_free_context(&_context); 666 667 _context = nullptr; 668diff --git a/src/projects/transcoder/codec/decoder/decoder_avc_xma.cpp b/src/projects/transcoder/codec/decoder/decoder_avc_xma.cpp 669index 494c5f910..22d8fdfe9 100644 670--- a/src/projects/transcoder/codec/decoder/decoder_avc_xma.cpp 671+++ b/src/projects/transcoder/codec/decoder/decoder_avc_xma.cpp 672@@ -111,7 +111,6 @@ bool DecoderAVCxXMA::InitCodec() 673 674 void DecoderAVCxXMA::UninitCodec() 675 { 676- ::avcodec_close(_context); 677 ::avcodec_free_context(&_context); 678 679 _context = nullptr; 680diff --git a/src/projects/transcoder/codec/decoder/decoder_hevc.cpp b/src/projects/transcoder/codec/decoder/decoder_hevc.cpp 681index 0c58fec8c..88d0d5e6a 100755 682--- a/src/projects/transcoder/codec/decoder/decoder_hevc.cpp 683+++ b/src/projects/transcoder/codec/decoder/decoder_hevc.cpp 684@@ -84,7 +84,6 @@ bool DecoderHEVC::InitCodec() 685 686 void DecoderHEVC::UninitCodec() 687 { 688- ::avcodec_close(_context); 689 ::avcodec_free_context(&_context); 690 691 _context = nullptr; 692diff --git a/src/projects/transcoder/codec/decoder/decoder_hevc_nv.cpp b/src/projects/transcoder/codec/decoder/decoder_hevc_nv.cpp 693index 44fe91828..36dab687d 100644 694--- a/src/projects/transcoder/codec/decoder/decoder_hevc_nv.cpp 695+++ b/src/projects/transcoder/codec/decoder/decoder_hevc_nv.cpp 696@@ -93,7 +93,6 @@ bool DecoderHEVCxNV::InitCodec() 697 698 void DecoderHEVCxNV::UninitCodec() 699 { 700- ::avcodec_close(_context); 701 ::avcodec_free_context(&_context); 702 703 _context = nullptr; 704diff --git a/src/projects/transcoder/codec/decoder/decoder_hevc_xma.cpp b/src/projects/transcoder/codec/decoder/decoder_hevc_xma.cpp 705index 1f971b4f6..2c1e27a78 100644 706--- a/src/projects/transcoder/codec/decoder/decoder_hevc_xma.cpp 707+++ b/src/projects/transcoder/codec/decoder/decoder_hevc_xma.cpp 708@@ -111,7 +111,6 @@ bool DecoderHEVCxXMA::InitCodec() 709 710 void DecoderHEVCxXMA::UninitCodec() 711 { 712- ::avcodec_close(_context); 713 ::avcodec_free_context(&_context); 714 715 _context = nullptr; 716diff --git a/src/projects/transcoder/codec/decoder/decoder_vp8.cpp b/src/projects/transcoder/codec/decoder/decoder_vp8.cpp 717index 616147a7a..464b1c27d 100644 718--- a/src/projects/transcoder/codec/decoder/decoder_vp8.cpp 719+++ b/src/projects/transcoder/codec/decoder/decoder_vp8.cpp 720@@ -83,7 +83,6 @@ bool DecoderVP8::InitCodec() 721 722 void DecoderVP8::UninitCodec() 723 { 724- ::avcodec_close(_context); 725 ::avcodec_free_context(&_context); 726 727 _context = nullptr; 728 729From 9685274797362b8f3235464e1c4902465389dec9 Mon Sep 17 00:00:00 2001 730From: hashworks <mail@hashworks.net> 731Date: Sat, 25 May 2024 22:19:24 +0200 732Subject: [PATCH 09/12] ffmpeg Update: Change buffer to const in OnWrite 733 function declaration 734 735--- 736 src/projects/modules/segment_writer/writer.h | 2 +- 737 1 file changed, 1 insertion(+), 1 deletion(-) 738 739diff --git a/src/projects/modules/segment_writer/writer.h b/src/projects/modules/segment_writer/writer.h 740index ca06dcf37..c87b25b0d 100644 741--- a/src/projects/modules/segment_writer/writer.h 742+++ b/src/projects/modules/segment_writer/writer.h 743@@ -120,7 +120,7 @@ class Writer 744 int DecideBufferSize() const; 745 746 int OnWrite(const uint8_t *buf, int buf_size); 747- static int OnWrite(void *opaque, uint8_t *buf, int buf_size) 748+ static int OnWrite(void *opaque, const uint8_t *buf, int buf_size) 749 { 750 return (static_cast<Writer *>(opaque))->OnWrite(buf, buf_size); 751 } 752 753From 70ec85fcfebc8a2969756f117687bca64abdbb77 Mon Sep 17 00:00:00 2001 754From: hashworks <mail@hashworks.net> 755Date: Sat, 15 Jun 2024 15:54:07 +0200 756Subject: [PATCH 10/12] Drop unsupported ffmpeg v7 configuration flags 757 758Disabling lzo isn't allowed anymore https://github.com/FFmpeg/FFmpeg/commit/df272928ff8041f87b92f4cf8dbf12a28fe9cdf7 759 760Couldn't find commits for the other two. But I suspect they are now 761enabled by default. 762--- 763 misc/prerequisites.sh | 4 ++-- 764 1 file changed, 2 insertions(+), 2 deletions(-) 765 766diff --git a/misc/prerequisites.sh b/misc/prerequisites.sh 767index eb4505cdc..9766a50a6 100755 768--- a/misc/prerequisites.sh 769+++ b/misc/prerequisites.sh 770@@ -316,8 +316,8 @@ install_ffmpeg() 771 --extra-ldflags="${ADDI_LDFLAGS} -L${PREFIX}/lib -Wl,-rpath,${PREFIX}/lib " \ 772 --extra-libs=-ldl ${ADDI_EXTRA_LIBS} \ 773 ${ADDI_LICENSE} \ 774- --disable-everything --disable-programs --disable-avdevice --disable-dwt --disable-lsp --disable-lzo --disable-faan --disable-pixelutils \ 775- --enable-shared --enable-zlib --enable-libopus --enable-libvpx --enable-libfdk_aac --enable-libopenh264 --enable-openssl --enable-network --enable-libsrt --enable-dct --enable-rdft ${ADDI_LIBS} \ 776+ --disable-everything --disable-programs --disable-avdevice --disable-dwt --disable-lsp --disable-faan --disable-pixelutils \ 777+ --enable-shared --enable-zlib --enable-libopus --enable-libvpx --enable-libfdk_aac --enable-libopenh264 --enable-openssl --enable-network --enable-libsrt ${ADDI_LIBS} \ 778 ${ADDI_HWACCEL} \ 779 --enable-ffmpeg \ 780 --enable-encoder=libvpx_vp8,libopus,libfdk_aac,libopenh264,mjpeg,png${ADDI_ENCODER} \ 781 782From ac60ded1c973593285177fe5757e82b6ea91be77 Mon Sep 17 00:00:00 2001 783From: hashworks <mail@hashworks.net> 784Date: Sat, 15 Jun 2024 15:55:11 +0200 785Subject: [PATCH 11/12] Ignore the included uid in the jemalloc tar archive 786 787Otherwise this fails with `Cannot change ownership to uid 66878, gid 788100: Invalid argument`, at least with podman. 789--- 790 misc/prerequisites.sh | 2 +- 791 1 file changed, 1 insertion(+), 1 deletion(-) 792 793diff --git a/misc/prerequisites.sh b/misc/prerequisites.sh 794index 9766a50a6..5d11048a1 100755 795--- a/misc/prerequisites.sh 796+++ b/misc/prerequisites.sh 797@@ -348,7 +348,7 @@ install_jemalloc() 798 (DIR=${TEMP_PATH}/jemalloc && \ 799 mkdir -p ${DIR} && \ 800 cd ${DIR} && \ 801- curl -sSLf https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/jemalloc-${JEMALLOC_VERSION}.tar.bz2 | tar -jx --strip-components=1 && \ 802+ curl -sSLf https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/jemalloc-${JEMALLOC_VERSION}.tar.bz2 | tar -jx --strip-components=1 --no-same-owner && \ 803 ./configure --prefix="${PREFIX}" && \ 804 make -j$(nproc) && \ 805 sudo make install_include install_lib && \ 806 807From 9b01f66afa8f45deee945baab4dbbef542a6618c Mon Sep 17 00:00:00 2001 808From: hashworks <mail@hashworks.net> 809Date: Sat, 6 Jul 2024 01:43:08 +0200 810Subject: [PATCH 12/12] ffmpeg Update: Replace deprecated frame->pkt_duration 811 with duration in transcoder context 812 813--- 814 src/projects/transcoder/transcoder_context.h | 2 +- 815 1 file changed, 1 insertion(+), 1 deletion(-) 816 817diff --git a/src/projects/transcoder/transcoder_context.h b/src/projects/transcoder/transcoder_context.h 818index a34a635a9..a1e198e22 100644 819--- a/src/projects/transcoder/transcoder_context.h 820+++ b/src/projects/transcoder/transcoder_context.h 821@@ -78,7 +78,7 @@ class MediaFrame 822 823 if (_priv_data) 824 { 825- _priv_data->pkt_duration = duration; 826+ _priv_data->duration = duration; 827 } 828 } 829