biome: 1.9.2 -> 1.9.3 (#349335)
[NixPkgs.git] / pkgs / servers / misc / oven-media-engine / support-ffmpeg-7.patch
blob5ca777df19195b6a2e39ffa5f24de1c7648c6936
1 From 6ca213328dc9f63cd9b39768b4c1d5953c71219c Mon Sep 17 00:00:00 2001
2 From: hashworks <mail@hashworks.net>
3 Date: Sat, 25 May 2024 19:25:57 +0200
4 Subject: [PATCH 01/12] Update ffmpeg version to 7.0
6 ---
7 misc/prerequisites.sh | 2 +-
8 1 file changed, 1 insertion(+), 1 deletion(-)
10 diff --git a/misc/prerequisites.sh b/misc/prerequisites.sh
11 index 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
24 From 80b015e5374a2e4aa3f850a6797ff066860caa3d Mon Sep 17 00:00:00 2001
25 From: hashworks <mail@hashworks.net>
26 Date: Sat, 25 May 2024 19:26:26 +0200
27 Subject: [PATCH 02/12] ffmpeg Update: stream->codecpar->channel_layout to
28 ch_layout
29 MIME-Version: 1.0
30 Content-Type: text/plain; charset=UTF-8
31 Content-Transfer-Encoding: 8bit
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
35 In 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:
38 projects/modules/ffmpeg/ffmpeg_conv.h: In static member function ‘static bool ffmpeg::Conv::ToMediaTrack(AVStream*, std::shared_ptr<MediaTrack>)’:
39 projects/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(-)
48 diff --git a/src/projects/modules/ffmpeg/ffmpeg_conv.h b/src/projects/modules/ffmpeg/ffmpeg_conv.h
49 index 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;
62 From 29d3b3dbd7f3d0d05b71cb5f5f41f3396304b389 Mon Sep 17 00:00:00 2001
63 From: hashworks <mail@hashworks.net>
64 Date: Sat, 25 May 2024 19:26:26 +0200
65 Subject: [PATCH 03/12] ffmpeg Update: Replace deprecated channel_layout with
66 ch_layout.u.mask
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
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(-)
82 diff --git a/src/projects/modules/ffmpeg/ffmpeg_conv.h b/src/projects/modules/ffmpeg/ffmpeg_conv.h
83 index 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);
105 From 86d3cd217e6b59ee6ab85400548ccc2697045f21 Mon Sep 17 00:00:00 2001
106 From: hashworks <mail@hashworks.net>
107 Date: Sat, 25 May 2024 19:46:33 +0200
108 Subject: [PATCH 04/12] ffmpeg Update: Replace deprecated frame->pkt_duration
109 with duration
113 * duration of the corresponding packet, expressed in
114 * AVStream->time_base units, 0 if unknown.
115 * - encoding: unused
116 * - decoding: Read by user.
118 * @deprecated use duration instead
120 attribute_deprecated
121 int64_t pkt_duration;
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(-)
141 diff --git a/src/projects/modules/ffmpeg/ffmpeg_conv.h b/src/projects/modules/ffmpeg/ffmpeg_conv.h
142 index 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);
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);
162 AVFrame* moved_frame = av_frame_alloc();
163 diff --git a/src/projects/transcoder/codec/decoder/decoder_aac.cpp b/src/projects/transcoder/codec/decoder/decoder_aac.cpp
164 index 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()
170 // If there is no duration, the duration is calculated by timebase.
171 - if (_frame->pkt_duration <= 0LL)
172 + if (_frame->duration <= 0LL)
174 - _frame->pkt_duration = ffmpeg::Conv::GetDurationPerFrame(cmn::MediaType::Audio, GetRefTrack(), _frame);
175 + _frame->duration = ffmpeg::Conv::GetDurationPerFrame(cmn::MediaType::Audio, GetRefTrack(), _frame);
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)
182 - _frame->pts = _last_pkt_pts + _frame->pkt_duration;
183 + _frame->pts = _last_pkt_pts + _frame->duration;
186 auto output_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Audio, _frame);
187 diff --git a/src/projects/transcoder/codec/decoder/decoder_avc.cpp b/src/projects/transcoder/codec/decoder/decoder_avc.cpp
188 index 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()
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)
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()) );
203 diff --git a/src/projects/transcoder/codec/decoder/decoder_avc_nilogan.cpp b/src/projects/transcoder/codec/decoder/decoder_avc_nilogan.cpp
204 index 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()
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)
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()) );
218 auto decoded_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Video, _frame);
219 diff --git a/src/projects/transcoder/codec/decoder/decoder_avc_nv.cpp b/src/projects/transcoder/codec/decoder/decoder_avc_nv.cpp
220 index 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()
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)
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() );
234 auto decoded_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Video, _frame);
235 diff --git a/src/projects/transcoder/codec/decoder/decoder_avc_qsv.cpp b/src/projects/transcoder/codec/decoder/decoder_avc_qsv.cpp
236 index 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()
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)
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()) );
250 auto decoded_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Video, _frame);
251 diff --git a/src/projects/transcoder/codec/decoder/decoder_avc_xma.cpp b/src/projects/transcoder/codec/decoder/decoder_avc_xma.cpp
252 index 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()
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)
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()) );
266 auto decoded_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Video, _frame);
267 diff --git a/src/projects/transcoder/codec/decoder/decoder_hevc.cpp b/src/projects/transcoder/codec/decoder/decoder_hevc.cpp
268 index 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()
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)
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()) );
282 auto decoded_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Video, _frame);
283 diff --git a/src/projects/transcoder/codec/decoder/decoder_hevc_nilogan.cpp b/src/projects/transcoder/codec/decoder/decoder_hevc_nilogan.cpp
284 index 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()
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)
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()) );
298 auto decoded_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Video, _frame);
299 diff --git a/src/projects/transcoder/codec/decoder/decoder_hevc_nv.cpp b/src/projects/transcoder/codec/decoder/decoder_hevc_nv.cpp
300 index 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()
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)
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()) );
314 auto decoded_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Video, _frame);
315 diff --git a/src/projects/transcoder/codec/decoder/decoder_hevc_qsv.cpp b/src/projects/transcoder/codec/decoder/decoder_hevc_qsv.cpp
316 index 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()
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)
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()) );
330 auto decoded_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Video, _frame);
331 diff --git a/src/projects/transcoder/codec/decoder/decoder_hevc_xma.cpp b/src/projects/transcoder/codec/decoder/decoder_hevc_xma.cpp
332 index 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()
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)
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()) );
346 auto decoded_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Video, _frame);
347 diff --git a/src/projects/transcoder/codec/decoder/decoder_mp3.cpp b/src/projects/transcoder/codec/decoder/decoder_mp3.cpp
348 index 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()
354 // If there is no duration, the duration is calculated by timebase.
355 - if (_frame->pkt_duration <= 0LL)
356 + if (_frame->duration <= 0LL)
358 - _frame->pkt_duration = ffmpeg::Conv::GetDurationPerFrame(cmn::MediaType::Audio, GetRefTrack(), _frame);
359 + _frame->duration = ffmpeg::Conv::GetDurationPerFrame(cmn::MediaType::Audio, GetRefTrack(), _frame);
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)
366 - _frame->pts = _last_pkt_pts + _frame->pkt_duration;
367 + _frame->pts = _last_pkt_pts + _frame->duration;
370 auto output_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Audio, _frame);
371 diff --git a/src/projects/transcoder/codec/decoder/decoder_opus.cpp b/src/projects/transcoder/codec/decoder/decoder_opus.cpp
372 index 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()
378 // If there is no duration, the duration is calculated by timebase.
379 - if (_frame->pkt_duration <= 0LL)
380 + if (_frame->duration <= 0LL)
382 - _frame->pkt_duration = ffmpeg::Conv::GetDurationPerFrame(cmn::MediaType::Audio, GetRefTrack(), _frame);
383 + _frame->duration = ffmpeg::Conv::GetDurationPerFrame(cmn::MediaType::Audio, GetRefTrack(), _frame);
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)
390 - _frame->pts = _last_pkt_pts + _frame->pkt_duration;
391 + _frame->pts = _last_pkt_pts + _frame->duration;
394 auto output_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Audio, _frame);
395 diff --git a/src/projects/transcoder/codec/decoder/decoder_vp8.cpp b/src/projects/transcoder/codec/decoder/decoder_vp8.cpp
396 index 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()
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;
406 auto decoded_frame = ffmpeg::Conv::ToMediaFrame(cmn::MediaType::Video, _frame);
407 ::av_frame_unref(_frame);
409 From f469e7e18344243248585b3b5478aba95454231e Mon Sep 17 00:00:00 2001
410 From: hashworks <mail@hashworks.net>
411 Date: Sat, 25 May 2024 20:26:32 +0200
412 Subject: [PATCH 05/12] ffmpeg Update: Replace deprecated
413 av_get_channel_layout_string with av_get_channel_layout_describe
417 * Return a description of a channel layout.
418 * If nb_channels is <= 0, it is guessed from the channel_layout.
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()
426 attribute_deprecated
427 void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout);
430 src/projects/modules/ffmpeg/ffmpeg_conv.h | 7 ++++---
431 1 file changed, 4 insertions(+), 3 deletions(-)
433 diff --git a/src/projects/modules/ffmpeg/ffmpeg_conv.h b/src/projects/modules/ffmpeg/ffmpeg_conv.h
434 index 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
439 else
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]{};
445 + ::av_channel_layout_describe(&parameters->ch_layout, channel_layout_buf, OV_COUNTOF(channel_layout_buf));
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)));
452 message.AppendFormat("%d kbps, ", (parameters->bit_rate / 1024));
454 From a73e2efb2466d18fc15fdeccb0c5da031bcec643 Mon Sep 17 00:00:00 2001
455 From: hashworks <mail@hashworks.net>
456 Date: Sat, 25 May 2024 20:31:15 +0200
457 Subject: [PATCH 06/12] ffmpeg Update: Replace deprecated channels with
458 ch_layout.nb_channels
462 * Audio only. The number of audio channels.
463 * @deprecated use ch_layout.nb_channels
465 attribute_deprecated
466 int channels;
469 src/projects/modules/ffmpeg/ffmpeg_conv.h | 5 ++---
470 1 file changed, 2 insertions(+), 3 deletions(-)
472 diff --git a/src/projects/modules/ffmpeg/ffmpeg_conv.h b/src/projects/modules/ffmpeg/ffmpeg_conv.h
473 index 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
479 char channel_layout_buf[16]{};
481 ::av_channel_layout_describe(&parameters->ch_layout, channel_layout_buf, OV_COUNTOF(channel_layout_buf));
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)));
488 message.AppendFormat("%d kbps, ", (parameters->bit_rate / 1024));
489 @@ -790,7 +789,7 @@ namespace ffmpeg
490 break;
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;
499 From f0334563e0aa1baf038c8c93111b2517e1a7f7be Mon Sep 17 00:00:00 2001
500 From: hashworks <mail@hashworks.net>
501 Date: Sat, 25 May 2024 20:49:52 +0200
502 Subject: [PATCH 07/12] ffmpeg Update: Replace deprecated channel_layout with
503 ch_layout struct
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(-)
513 diff --git a/src/projects/modules/ffmpeg/ffmpeg_conv.h b/src/projects/modules/ffmpeg/ffmpeg_conv.h
514 index 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;
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 + };
532 + codecpar->sample_rate = media_track->GetSample().GetRateNum();
533 + codecpar->frame_size = (media_track->GetAudioSamplesPerFrame()!=0)?media_track->GetAudioSamplesPerFrame():1024;
535 break;
537 diff --git a/src/projects/modules/segment_writer/writer.cpp b/src/projects/modules/segment_writer/writer.cpp
538 index 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;
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 + };
558 std::shared_ptr<ov::Data> extra_data = nullptr;
559 if (media_track->GetCodecId() == cmn::MediaCodecId::Aac)
561 diff --git a/src/projects/transcoder/codec/encoder/encoder_aac.cpp b/src/projects/transcoder/codec/encoder/encoder_aac.cpp
562 index 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();
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 + };
578 _bitstream_format = cmn::BitstreamFormat::AAC_ADTS;
580 diff --git a/src/projects/transcoder/codec/encoder/encoder_ffopus.cpp b/src/projects/transcoder/codec/encoder/encoder_ffopus.cpp
581 index 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();
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 + };
598 // Support Frequency
599 // 4000 - OPUS_BANDWIDTH_NARROWBAND (8kHz) (2~8 kbps)
600 // 6000 - OPUS_BANDWIDTH_MEDIUMBAND (12kHz)
601 diff --git a/src/projects/transcoder/filter/filter_resampler.cpp b/src/projects/transcoder/filter/filter_resampler.cpp
602 index 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)
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());
612 continue;
615 From 555e779e02311a31dfd6a8ee7e65c21e1e0a3b8c Mon Sep 17 00:00:00 2001
616 From: hashworks <mail@hashworks.net>
617 Date: Sat, 25 May 2024 21:01:39 +0200
618 Subject: [PATCH 08/12] ffmpeg Update: Drop depreacted avcodec_close and use
619 avcodec_free_context only
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(-)
632 diff --git a/src/projects/transcoder/codec/decoder/decoder_avc.cpp b/src/projects/transcoder/codec/decoder/decoder_avc.cpp
633 index 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()
638 void DecoderAVC::UninitCodec()
640 - ::avcodec_close(_context);
641 ::avcodec_free_context(&_context);
643 _context = nullptr;
644 diff --git a/src/projects/transcoder/codec/decoder/decoder_avc_nilogan.cpp b/src/projects/transcoder/codec/decoder/decoder_avc_nilogan.cpp
645 index 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()
652 - ::avcodec_close(_context);
653 ::avcodec_free_context(&_context);
655 _context = nullptr;
656 diff --git a/src/projects/transcoder/codec/decoder/decoder_avc_nv.cpp b/src/projects/transcoder/codec/decoder/decoder_avc_nv.cpp
657 index 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()
662 void DecoderAVCxNV::UninitCodec()
664 - ::avcodec_close(_context);
665 ::avcodec_free_context(&_context);
667 _context = nullptr;
668 diff --git a/src/projects/transcoder/codec/decoder/decoder_avc_xma.cpp b/src/projects/transcoder/codec/decoder/decoder_avc_xma.cpp
669 index 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()
674 void DecoderAVCxXMA::UninitCodec()
676 - ::avcodec_close(_context);
677 ::avcodec_free_context(&_context);
679 _context = nullptr;
680 diff --git a/src/projects/transcoder/codec/decoder/decoder_hevc.cpp b/src/projects/transcoder/codec/decoder/decoder_hevc.cpp
681 index 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()
686 void DecoderHEVC::UninitCodec()
688 - ::avcodec_close(_context);
689 ::avcodec_free_context(&_context);
691 _context = nullptr;
692 diff --git a/src/projects/transcoder/codec/decoder/decoder_hevc_nv.cpp b/src/projects/transcoder/codec/decoder/decoder_hevc_nv.cpp
693 index 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()
698 void DecoderHEVCxNV::UninitCodec()
700 - ::avcodec_close(_context);
701 ::avcodec_free_context(&_context);
703 _context = nullptr;
704 diff --git a/src/projects/transcoder/codec/decoder/decoder_hevc_xma.cpp b/src/projects/transcoder/codec/decoder/decoder_hevc_xma.cpp
705 index 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()
710 void DecoderHEVCxXMA::UninitCodec()
712 - ::avcodec_close(_context);
713 ::avcodec_free_context(&_context);
715 _context = nullptr;
716 diff --git a/src/projects/transcoder/codec/decoder/decoder_vp8.cpp b/src/projects/transcoder/codec/decoder/decoder_vp8.cpp
717 index 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()
722 void DecoderVP8::UninitCodec()
724 - ::avcodec_close(_context);
725 ::avcodec_free_context(&_context);
727 _context = nullptr;
729 From 9685274797362b8f3235464e1c4902465389dec9 Mon Sep 17 00:00:00 2001
730 From: hashworks <mail@hashworks.net>
731 Date: Sat, 25 May 2024 22:19:24 +0200
732 Subject: [PATCH 09/12] ffmpeg Update: Change buffer to const in OnWrite
733 function declaration
736 src/projects/modules/segment_writer/writer.h | 2 +-
737 1 file changed, 1 insertion(+), 1 deletion(-)
739 diff --git a/src/projects/modules/segment_writer/writer.h b/src/projects/modules/segment_writer/writer.h
740 index 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;
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)
750 return (static_cast<Writer *>(opaque))->OnWrite(buf, buf_size);
753 From 70ec85fcfebc8a2969756f117687bca64abdbb77 Mon Sep 17 00:00:00 2001
754 From: hashworks <mail@hashworks.net>
755 Date: Sat, 15 Jun 2024 15:54:07 +0200
756 Subject: [PATCH 10/12] Drop unsupported ffmpeg v7 configuration flags
758 Disabling lzo isn't allowed anymore https://github.com/FFmpeg/FFmpeg/commit/df272928ff8041f87b92f4cf8dbf12a28fe9cdf7
760 Couldn't find commits for the other two. But I suspect they are now
761 enabled by default.
763 misc/prerequisites.sh | 4 ++--
764 1 file changed, 2 insertions(+), 2 deletions(-)
766 diff --git a/misc/prerequisites.sh b/misc/prerequisites.sh
767 index 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} \
782 From ac60ded1c973593285177fe5757e82b6ea91be77 Mon Sep 17 00:00:00 2001
783 From: hashworks <mail@hashworks.net>
784 Date: Sat, 15 Jun 2024 15:55:11 +0200
785 Subject: [PATCH 11/12] Ignore the included uid in the jemalloc tar archive
787 Otherwise this fails with `Cannot change ownership to uid 66878, gid
788 100: Invalid argument`, at least with podman.
790 misc/prerequisites.sh | 2 +-
791 1 file changed, 1 insertion(+), 1 deletion(-)
793 diff --git a/misc/prerequisites.sh b/misc/prerequisites.sh
794 index 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 && \
807 From 9b01f66afa8f45deee945baab4dbbef542a6618c Mon Sep 17 00:00:00 2001
808 From: hashworks <mail@hashworks.net>
809 Date: Sat, 6 Jul 2024 01:43:08 +0200
810 Subject: [PATCH 12/12] ffmpeg Update: Replace deprecated frame->pkt_duration
811 with duration in transcoder context
814 src/projects/transcoder/transcoder_context.h | 2 +-
815 1 file changed, 1 insertion(+), 1 deletion(-)
817 diff --git a/src/projects/transcoder/transcoder_context.h b/src/projects/transcoder/transcoder_context.h
818 index 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
823 if (_priv_data)
825 - _priv_data->pkt_duration = duration;
826 + _priv_data->duration = duration;