[info=b1d0945196caf644183aec4883cd5e5db3e18c6aa4f97552283f46c366df6f65]

OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/ffmpeg-5?expand=0&rev=96
This commit is contained in:
Jan Engelhardt 2024-07-09 14:13:45 +00:00 committed by Git OBS Bridge
commit dcb1efdd81
39 changed files with 4066 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

View File

@ -0,0 +1,44 @@
From f1f973313b6edc460339c2dfa4675dd3ad72fe98 Mon Sep 17 00:00:00 2001
From: Paul B Mahol <onemda@gmail.com>
Date: Mon, 27 Nov 2023 11:52:37 +0100
Subject: [PATCH] avfilter/af_dialoguenhance: do output scaling once
References: https://bugzilla.opensuse.org/1222730
References: CVE-2023-49528
---
libavfilter/af_dialoguenhance.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/libavfilter/af_dialoguenhance.c b/libavfilter/af_dialoguenhance.c
index 5c8614c185..2674313f5c 100644
--- a/libavfilter/af_dialoguenhance.c
+++ b/libavfilter/af_dialoguenhance.c
@@ -108,7 +108,7 @@ static int config_input(AVFilterLink *inlink)
generate_window_func(s->window, s->fft_size, WFUNC_SINE, &overlap);
- iscale = 1.f / s->fft_size;
+ iscale = 1.f / (s->fft_size * 1.5f);
ret = av_tx_init(&s->tx_ctx[0], &s->tx_fn, AV_TX_FLOAT_RDFT, 0, s->fft_size, &scale, 0);
if (ret < 0)
@@ -296,13 +296,10 @@ static int de_stereo(AVFilterContext *ctx, AVFrame *out)
memcpy(left_osamples, left_in, overlap * sizeof(float));
memcpy(right_osamples, right_in, overlap * sizeof(float));
- // 4 times overlap with squared hanning window results in 1.5 time increase in amplitude
- if (!ctx->is_disabled) {
- for (int i = 0; i < overlap; i++)
- center_osamples[i] = left_out[i] / 1.5f;
- } else {
+ if (ctx->is_disabled)
memset(center_osamples, 0, overlap * sizeof(float));
- }
+ else
+ memcpy(center_osamples, left_out, overlap * sizeof(float));
return 0;
}
--
2.44.0

View File

@ -0,0 +1,56 @@
From 2d9ed64859c9887d0504cd71dbd5b2c15e14251a Mon Sep 17 00:00:00 2001
From: Paul B Mahol <onemda@gmail.com>
Date: Sat, 25 Nov 2023 12:54:28 +0100
Subject: [PATCH] avfilter/af_dialoguenhance: fix overreads
References: https://bugzilla.opensuse.org/1222730
References: CVE-2023-49528
---
libavfilter/af_dialoguenhance.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/libavfilter/af_dialoguenhance.c b/libavfilter/af_dialoguenhance.c
index 1762ea7cde..29c8ab10a7 100644
--- a/libavfilter/af_dialoguenhance.c
+++ b/libavfilter/af_dialoguenhance.c
@@ -96,12 +96,12 @@ static int config_input(AVFilterLink *inlink)
if (!s->window)
return AVERROR(ENOMEM);
- s->in_frame = ff_get_audio_buffer(inlink, s->fft_size * 4);
- s->center_frame = ff_get_audio_buffer(inlink, s->fft_size * 4);
- s->out_dist_frame = ff_get_audio_buffer(inlink, s->fft_size * 4);
- s->windowed_frame = ff_get_audio_buffer(inlink, s->fft_size * 4);
- s->windowed_out = ff_get_audio_buffer(inlink, s->fft_size * 4);
- s->windowed_prev = ff_get_audio_buffer(inlink, s->fft_size * 4);
+ s->in_frame = ff_get_audio_buffer(inlink, (s->fft_size + 2) * 2);
+ s->center_frame = ff_get_audio_buffer(inlink, (s->fft_size + 2) * 2);
+ s->out_dist_frame = ff_get_audio_buffer(inlink, (s->fft_size + 2) * 2);
+ s->windowed_frame = ff_get_audio_buffer(inlink, (s->fft_size + 2) * 2);
+ s->windowed_out = ff_get_audio_buffer(inlink, (s->fft_size + 2) * 2);
+ s->windowed_prev = ff_get_audio_buffer(inlink, (s->fft_size + 2) * 2);
if (!s->in_frame || !s->windowed_out || !s->windowed_prev ||
!s->out_dist_frame || !s->windowed_frame || !s->center_frame)
return AVERROR(ENOMEM);
@@ -250,6 +250,7 @@ static int de_stereo(AVFilterContext *ctx, AVFrame *out)
float *right_osamples = (float *)out->extended_data[1];
float *center_osamples = (float *)out->extended_data[2];
const int offset = s->fft_size - s->overlap;
+ const int nb_samples = FFMIN(s->overlap, s->in->nb_samples);
float vad;
// shift in/out buffers
@@ -258,8 +259,8 @@ static int de_stereo(AVFilterContext *ctx, AVFrame *out)
memmove(left_out, &left_out[s->overlap], offset * sizeof(float));
memmove(right_out, &right_out[s->overlap], offset * sizeof(float));
- memcpy(&left_in[offset], left_samples, s->overlap * sizeof(float));
- memcpy(&right_in[offset], right_samples, s->overlap * sizeof(float));
+ memcpy(&left_in[offset], left_samples, nb_samples * sizeof(float));
+ memcpy(&right_in[offset], right_samples, nb_samples * sizeof(float));
memset(&left_out[offset], 0, s->overlap * sizeof(float));
memset(&right_out[offset], 0, s->overlap * sizeof(float));
--
2.44.0

View File

@ -0,0 +1,71 @@
From 4671fb7dfb8e72b228e04f3b81da7f2003c62240 Mon Sep 17 00:00:00 2001
From: Paul B Mahol <onemda@gmail.com>
Date: Mon, 27 Nov 2023 00:38:56 +0100
Subject: [PATCH] avfilter/af_dialoguenhance: simplify channels copy
References: https://bugzilla.opensuse.org/1222730
References: CVE-2023-49528
---
libavfilter/af_dialoguenhance.c | 32 +++++++++++++++++---------------
1 file changed, 17 insertions(+), 15 deletions(-)
diff --git a/libavfilter/af_dialoguenhance.c b/libavfilter/af_dialoguenhance.c
index 29c8ab10a7..5c8614c185 100644
--- a/libavfilter/af_dialoguenhance.c
+++ b/libavfilter/af_dialoguenhance.c
@@ -249,20 +249,21 @@ static int de_stereo(AVFilterContext *ctx, AVFrame *out)
float *left_osamples = (float *)out->extended_data[0];
float *right_osamples = (float *)out->extended_data[1];
float *center_osamples = (float *)out->extended_data[2];
- const int offset = s->fft_size - s->overlap;
- const int nb_samples = FFMIN(s->overlap, s->in->nb_samples);
+ const int overlap = s->overlap;
+ const int offset = s->fft_size - overlap;
+ const int nb_samples = FFMIN(overlap, s->in->nb_samples);
float vad;
// shift in/out buffers
- memmove(left_in, &left_in[s->overlap], offset * sizeof(float));
- memmove(right_in, &right_in[s->overlap], offset * sizeof(float));
- memmove(left_out, &left_out[s->overlap], offset * sizeof(float));
- memmove(right_out, &right_out[s->overlap], offset * sizeof(float));
+ memmove(left_in, &left_in[overlap], offset * sizeof(float));
+ memmove(right_in, &right_in[overlap], offset * sizeof(float));
+ memmove(left_out, &left_out[overlap], offset * sizeof(float));
+ memmove(right_out, &right_out[overlap], offset * sizeof(float));
memcpy(&left_in[offset], left_samples, nb_samples * sizeof(float));
memcpy(&right_in[offset], right_samples, nb_samples * sizeof(float));
- memset(&left_out[offset], 0, s->overlap * sizeof(float));
- memset(&right_out[offset], 0, s->overlap * sizeof(float));
+ memset(&left_out[offset], 0, overlap * sizeof(float));
+ memset(&right_out[offset], 0, overlap * sizeof(float));
apply_window(s, left_in, windowed_left, 0);
apply_window(s, right_in, windowed_right, 0);
@@ -292,14 +293,15 @@ static int de_stereo(AVFilterContext *ctx, AVFrame *out)
apply_window(s, windowed_oleft, left_out, 1);
- for (int i = 0; i < s->overlap; i++) {
- // 4 times overlap with squared hanning window results in 1.5 time increase in amplitude
- if (!ctx->is_disabled)
+ memcpy(left_osamples, left_in, overlap * sizeof(float));
+ memcpy(right_osamples, right_in, overlap * sizeof(float));
+
+ // 4 times overlap with squared hanning window results in 1.5 time increase in amplitude
+ if (!ctx->is_disabled) {
+ for (int i = 0; i < overlap; i++)
center_osamples[i] = left_out[i] / 1.5f;
- else
- center_osamples[i] = 0.f;
- left_osamples[i] = left_in[i];
- right_osamples[i] = right_in[i];
+ } else {
+ memset(center_osamples, 0, overlap * sizeof(float));
}
return 0;
--
2.44.0

View File

@ -0,0 +1,29 @@
From 50f0f8c53c818f73fe2d752708e2fa9d2a2d8a07 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michael@niedermayer.cc>
Date: Sat, 23 Dec 2023 04:03:01 +0100
Subject: [PATCH] avfilter/af_stereowiden: Check length
References: https://bugzilla.opensuse.org/1223437
References: CVE-2023-51794
Fixes: out of array access
Fixes: tickets/10746/poc13ffmpeg
Found-by: Zeng Yunxiang
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
libavfilter/af_stereowiden.c | 2 ++
1 file changed, 2 insertions(+)
Index: ffmpeg-4.4.4/libavfilter/af_stereowiden.c
===================================================================
--- ffmpeg-4.4.4.orig/libavfilter/af_stereowiden.c
+++ ffmpeg-4.4.4/libavfilter/af_stereowiden.c
@@ -75,6 +75,8 @@ static int config_input(AVFilterLink *in
s->length = s->delay * inlink->sample_rate / 1000;
s->length *= 2;
+ if (s->length == 0)
+ return AVERROR(EINVAL);
s->buffer = av_calloc(s->length, sizeof(*s->buffer));
if (!s->buffer)
return AVERROR(ENOMEM);

View File

@ -0,0 +1,36 @@
From ab0fdaedd1e7224f7e84ea22fcbfaa4ca75a6c06 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michael@niedermayer.cc>
Date: Sun, 24 Dec 2023 20:31:02 +0100
Subject: [PATCH] avfilter/avf_showspectrum: fix off by 1 error
References: https://bugzilla.opensuse.org/1223087
References: CVE-2024-31585
References: https://bugzilla.opensuse.org/1223273
References: CVE-2023-51795
Fixes: out of array access
Fixes: tickets/10749/poc15ffmpeg
Regression since: 81df787b53eb5c6433731f6eaaf7f2a94d8a8c80
Found-by: Zeng Yunxiang
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
libavfilter/avf_showspectrum.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
index 8cf73fce70..99a5c33d09 100644
--- a/libavfilter/avf_showspectrum.c
+++ b/libavfilter/avf_showspectrum.c
@@ -1784,7 +1784,7 @@ static int showspectrumpic_request_frame(AVFilterLink *outlink)
int acc_samples = 0;
int dst_offset = 0;
- while (nb_frame <= s->nb_frames) {
+ while (nb_frame < s->nb_frames) {
AVFrame *cur_frame = s->frames[nb_frame];
int cur_frame_samples = cur_frame->nb_samples;
int nb_samples = 0;
--
2.44.0

View File

@ -0,0 +1,32 @@
From 61e73851a33f0b4cb7662f8578a4695e77bd3c19 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michael@niedermayer.cc>
Date: Sat, 23 Dec 2023 18:04:32 +0100
Subject: [PATCH] avfilter/f_reverse: Apply PTS compensation only when pts is
available
References: https://bugzilla.opensuse.org/1223274
References: CVE-2023-51796
Fixes: out of array access
Fixes: tickets/10753/poc16ffmpeg
Regression since: 45dc668aea0edac34969b5a1ff76cf9ad3a09be1
Found-by: Zeng Yunxiang
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
libavfilter/f_reverse.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: ffmpeg-5.1.4/libavfilter/f_reverse.c
===================================================================
--- ffmpeg-5.1.4.orig/libavfilter/f_reverse.c
+++ ffmpeg-5.1.4/libavfilter/f_reverse.c
@@ -253,7 +253,8 @@ static int areverse_request_frame(AVFilt
if (ret == AVERROR_EOF && s->nb_frames > 0) {
AVFrame *out = s->frames[s->nb_frames - 1];
out->pts = s->pts[s->flush_idx++] - s->nb_samples;
- s->nb_samples += s->pts[s->flush_idx] - s->pts[s->flush_idx - 1] - out->nb_samples;
+ if (s->nb_frames > 1)
+ s->nb_samples += s->pts[s->flush_idx] - s->pts[s->flush_idx - 1] - out->nb_samples;
if (av_sample_fmt_is_planar(out->format))
reverse_samples_planar(out);

View File

@ -0,0 +1,31 @@
From 99debe5f823f45a482e1dc08de35879aa9c74bd2 Mon Sep 17 00:00:00 2001
From: Zhao Zhili <zhilizhao@tencent.com>
Date: Fri, 29 Dec 2023 05:56:43 +0800
Subject: [PATCH] avfilter/vf_codecview: fix heap buffer overflow
References: https://bugzilla.opensuse.org/1223085
References: CVE-2024-31582
And improve the performance by a little bit.
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
libavfilter/vf_codecview.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/libavfilter/vf_codecview.c b/libavfilter/vf_codecview.c
index 55d9c8c04f..f65ccbda70 100644
--- a/libavfilter/vf_codecview.c
+++ b/libavfilter/vf_codecview.c
@@ -216,9 +216,6 @@ static void draw_block_rectangle(uint8_t *buf, int sx, int sy, int w, int h, ptr
buf[sx + w - 1] = color;
buf += stride;
}
-
- for (int x = sx; x < sx + w; x++)
- buf[x] = color;
}
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
--
2.44.0

View File

@ -0,0 +1,46 @@
From 3bb00c0a420c3ce83c6fafee30270d69622ccad7 Mon Sep 17 00:00:00 2001
From: Zhao Zhili <zhilizhao@tencent.com>
Date: Tue, 20 Feb 2024 20:08:55 +0800
Subject: [PATCH] avutil/hwcontext: Don't assume frames_uninit is reentrant
References: https://bugzilla.opensuse.org/1223070
References: CVE-2024-31578
Fix heap use after free when vulkan_frames_init failed.
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
libavutil/hwcontext.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c
index 1d2c2d7920..aa1329bf2b 100644
--- a/libavutil/hwcontext.c
+++ b/libavutil/hwcontext.c
@@ -359,7 +359,7 @@ int av_hwframe_ctx_init(AVBufferRef *ref)
if (ctx->internal->hw_type->frames_init) {
ret = ctx->internal->hw_type->frames_init(ctx);
if (ret < 0)
- goto fail;
+ return ret;
}
if (ctx->internal->pool_internal && !ctx->pool)
@@ -369,14 +369,10 @@ int av_hwframe_ctx_init(AVBufferRef *ref)
if (ctx->initial_pool_size > 0) {
ret = hwframe_pool_prealloc(ref);
if (ret < 0)
- goto fail;
+ return ret;
}
return 0;
-fail:
- if (ctx->internal->hw_type->frames_uninit)
- ctx->internal->hw_type->frames_uninit(ctx);
- return ret;
}
int av_hwframe_transfer_get_formats(AVBufferRef *hwframe_ref,
--
2.44.0

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<package>ffmpeg-5-mini</package>
</multibuild>

3
_scmsync.obsinfo Normal file
View File

@ -0,0 +1,3 @@
mtime: 1717004182
commit: b1d0945196caf644183aec4883cd5e5db3e18c6aa4f97552283f46c366df6f65
url: https://src.opensuse.org/jengelh/ffmpeg-5.git

9
baselibs.conf Normal file
View File

@ -0,0 +1,9 @@
libavcodec59
libavdevice59
libavfilter8
libavformat59
libavutil57
libpostproc56
libswresample4_ff5
obsoletes "libswresample4-<targettype> < <version>-<release>"
libswscale6

480
enable_decoders Normal file
View File

@ -0,0 +1,480 @@
## module name # reason for enablement in ffmpeg (usually there is another package that already got legal review)
aac
aasc
ac3
acelp_kelvin
adpcm_4xm
adpcm_adx
adpcm_afc
adpcm_agm
adpcm_aica
adpcm_argo
adpcm_ct
adpcm_dtk
adpcm_ea
adpcm_ea_maxis_xa
adpcm_ea_r1
adpcm_ea_r2
adpcm_ea_r3
adpcm_ea_xas
adpcm_g722
adpcm_g726
adpcm_g726le
adpcm_ima_acorn
adpcm_ima_alp
adpcm_ima_amv
adpcm_ima_apc
adpcm_ima_apm
adpcm_ima_cunning
adpcm_ima_dat4
adpcm_ima_dk3
adpcm_ima_dk4
adpcm_ima_ea_eacs
adpcm_ima_ea_sead
adpcm_ima_iss
adpcm_ima_moflex
adpcm_ima_mtf
adpcm_ima_oki
adpcm_ima_qt
adpcm_ima_rad
adpcm_ima_smjpeg
adpcm_ima_ssi
adpcm_ima_wav
adpcm_ima_ws
adpcm_ms
adpcm_mtaf
adpcm_psx
adpcm_sbpro_2
adpcm_sbpro_3
adpcm_sbpro_4
adpcm_swf
adpcm_thp
adpcm_thp_le
adpcm_vima
adpcm_xa
adpcm_xmd
adpcm_yamaha
adpcm_zork
alac
alias_pix
amrnb # opencore-amr
amrwb # opencore-amr
amv
anm
ansi # trivial
anull
apac
ape
apng # animated png
arbc
argo
ass # trivial
asv1
asv2
atrac1
atrac3
atrac3al
atrac3p
atrac3pal
aura
aura2
av1 # libaom
av1_nvdec # passthrough
av1_qsv # passthrough
av1_vaapi # passthrough
ayuv # trivial
bethsoftvid # trivial
bfi # trivial
bink
binkaudio_dct
binkaudio_rdft
bintext
bitpacked # trivial
bmp # trivial
bmv_audio
bmv_video
bonk
brender_pix
c93
cbd2_dpcm
ccaption
cdgraphics
cdtoons
cdxl
cinepak
clearvideo
cljr
cook
cpia
cscd
cyuv
dca
dds
derf_dpcm
dfa
dfpwm
dirac # dirac
dnxhd
dolby_e
dpx
dsd_lsbf
dsd_msbf
dsicinaudio
dsicinvideo
dss_sp
dvaudio
dvbsub
dvdsub
dvvideo
dxa
dxtory
eacmv
eamad
eatgq
eatgv
eatqi
eightbps
eightsvx_exp
eightsvx_fib
escape124
escape130
evrc
exr # openEXR
ffv1 # ffmpeg
ffvhuff # ffmpeg
ffwavesynth # pseudo
fits
flac # libFLAC
flashsv
flashsv2
flic
flv
fmvc
fourxm
ftr # fdk-aac
g723_1
g729
gdv
gem
gif # libpng
gremlin_dpcm
gsm # libgsm
gsm_ms
h261
h263
h263_v4l2m2m # passthrough
h263i
h263p
hap
hca
hcom
hdr
hnm4_video
hq_hqa
hqx
huffyuv # trivial+zlib
hymt # huffyuv-mt
iac
idcin
idf
iff_ilbm
ilbc # ilbc
imc
indeo2
indeo3
indeo4
indeo5
interplay_acm
interplay_dpcm
interplay_video
ipu
jacosub
jpeg2000 # openjpeg2
jpegls
jv
kgv1
kmvc
lagarith
libaom # libaom
libaom_av1 # libaom
libcodec2 # codec2
libdav1d # av1
libgsm # libgsm
libgsm_ms # libgsm
libjxl # libjxl
libopencore_amrnb # opencore-amr
libopencore_amrwb # opencore-amr
libopenh264 # passthrough/dlopen
libopenjpeg # openjpeg
libopus # opus
libschroedinger # schroedinger
libspeex # speex
libvorbis # libvorbis
libvpx_vp8 # libvpx
libvpx_vp9 # libvpx
libzvbi_teletext # zvbi
loco
lscr
m101
mace3
mace6
mdec
media100
metasound
microdvd
mimic
misc4
mjpeg # mjpegtools
mjpeg_qsv # passthrough
mjpegb
mlp
mmvideo
motionpixels
mp1 # twolame/lame
mp1float # twolame/lame
mp2 # twolame
mp2float # twolame
mp3 # lame
mp3adu
mp3adufloat
mp3float # lame
mp3on4
mp3on4float
mpc7
mpc8
mpeg1_cuvid # passthrough
mpeg1_v4l2m2m # passthrough
mpeg1video
mpeg2_cuvid # passthrough
mpeg2_qsv # passthrough
mpeg2_v4l2m2m # passthrough
mpeg2_vaapi # passthrough
mpeg2video
mpeg4
mpeg4_cuvid # passthrough
mpeg4_v4l2m2m # passthrough
mpegvideo
mpl2
msa1
mscc
msmpeg4
msmpeg4v1
msmpeg4v2
msmpeg4v3
msnsiren
msp2
msrle
mss1
msvideo1
mszh
mts2
mv30
mvc1
mvc2
mvdv
mvha
mwsc
mxpeg
nellymoser
nuv
on2avc
opus # opus
paf_audio
paf_video
pam # trivial
pbm # trivial
pcm_alaw # trivial
pcm_bluray
pcm_dvd
pcm_f16le # trivial
pcm_f24le # trivial
pcm_f32be # trivial
pcm_f32be # trivial
pcm_f32le # trivial
pcm_f64be # trivial
pcm_f64le # trivial
pcm_lxf # trivial
pcm_mulaw # trivial
pcm_s16be # trivial
pcm_s16be_planar # trivial
pcm_s16le # trivial
pcm_s16le_planar # trivial
pcm_s24be # trivial
pcm_s24daud # trivial
pcm_s24le # trivial
pcm_s24le_planar # trivial
pcm_s32be # trivial
pcm_s32le # trivial
pcm_s32le_planar # trivial
pcm_s64be # trivial
pcm_s64le # trivial
pcm_s8 # trivial
pcm_s8_planar # trivial
pcm_sga # trivial
pcm_u16be # trivial
pcm_u16le # trivial
pcm_u24be # trivial
pcm_u24le # trivial
pcm_u32be # trivial
pcm_u32le # trivial
pcm_u8 # trivial
pcm_vidc # trivial
pcx
pfm # trivial
pgm # trivial
pgmyuv # trivial
pgssub # mkvtoolnix
pgx
phm # trivial
photocd
pictor
pjs
png # libpng
ppm # trivial
prosumer
psd
ptx
qcelp
qdm2
qdmc
qdraw
qoi
qpeg
qtrle
r10k
r210
ra_144
ra_288
rasc
rawvideo # trivial
realtext
rka
rl2
roq
roq_dpcm
rpza
rscc
rv10
rv20
s302m
sami
sanm
sbc
screenpresso
sdx2_dpcm
sgi # trivial
sgirle # trivial
shorten
simbiosis_imx
sipr
siren
smackaud
smacker
smc
smvjpeg
snow
sol_dpcm
sonic
sp5x
speedhq
speex # speex
srgc
srt # trivial
ssa # trivial
stl
subrip
subviewer
subviewer1
sunrast # trivial
svq1
svq3
tak
targa # trivial
targa_y216
tdsc
text # trivial
theora # libtheora
thp
tiertexseqvideo
tiff # libtiff
tmv
truehd
truemotion1
truemotion2
truemotion2rt
truespeech
tscc
tscc2
tta
twinvq
txd
ulti
utvideo
v210 # trivial
v210x # trivial
v308 # trivial
v408 # trivial
v410 # trivial
vb
vble
vcr1
vmdaudio
vmdvideo
vmnc
vnull # trivial
vorbis # libvorbis
vp3 # libav
vp4 # libav
vp5 # libav
vp5 # libav
vp6 # libav
vp6 # libav
vp6a # libav
vp6a # libav
vp6f # libav
vp6f # libav
vp7 # libav
vp8 # libvpx
vp8_qsv # passthrough
vp8_v4l2m2m # passthrough
vp9 # libvpx
vp9_qsv # passthrough
vp9_v4l2m2m # passthrough
vplayer
vqa
vqc
wady_dpcm
wavarc
wavpack # wavpack
wbmp
wcmv
webp # libwebp
webvtt # trivial
wmav1
wmav2
wmavoice
wmv1
wmv2
wnv1
wrapped_avframe # passthrough
ws_snd1
xan_dpcm
xan_wc3
xan_wc4
xbin
xbm # trivial
xface
xl
xpm
xsub
xwd # xwd
y41p # trivial
y41p # trivial
ylc
yop
yuv4 # trivial
yuv4 # trivial
zero12v
zerocodec
zlib # zlib
zmbv # dosbox

195
enable_encoders Normal file
View File

@ -0,0 +1,195 @@
## module name # reason for enablement in ffmpeg (usually there is another package that already got legal review)
a64multi
a64multi5
aac
ac3
adpcm_adx
adpcm_argo
adpcm_g722
adpcm_g726
adpcm_g726le
adpcm_ima_alp
adpcm_ima_amv
adpcm_ima_apm
adpcm_ima_qt
adpcm_ima_ssi
adpcm_ima_wav
adpcm_ima_ws
adpcm_ms
adpcm_swf
adpcm_yamaha
alac
alias_pix
amv
anull
apng # libpng
ass # trivial
asv1
asv2
av1_nvenc
av1_vaapi
ayuv # trival
bitpacked # trivial
bmp # trivial
cinepak
cljr
dca
dfpwm
dnxhd
dpx
dvdsub
dvvideo
exr
ffv1
ffvhuff # trivial+zlib
flac # libFLAC
flashsv
flashsv2
flv
g723_1
gif # libpng
h261
h263
h263_v4l2m2m # passthrough
h263p
hdr
huffyuv # trivial+zlib
ilbc # ilbc
jpeg2000
jpegls
libaom # libaom
libaom_av1 # libaom
libcodec2 # codec2
libgsm # libgsm
libgsm_ms # libgsm
libjxl # libjxl
libmp3lame # lame
libopencore_amrnb # opencore-amr
libopenh264 # passthrough/dlopen
libopenjpeg # openjpeg
libopus # opus
librav1e # rav1e
libschroedinger # schroedinger
libspeex # speex
libsvtav1 # SVT-AV1
libtheora # libtheora
libtwolame # twolame
libvo_amrwbenc # vo-amrwbenc
libvorbis # libvorbis
libvpx_vp8 # libvpx
libvpx_vp9 # libvpx
libwebp # libwebp
libwebp_anim # libwebp
libxvid # xvidcore
mjpeg # mjpegtools
mjpeg_qsv # passthrough
mjpeg_vaapi # passthrough
mlp
mp2 # twolame
mp2fixed # twolame
mpeg1video
mpeg2_qsv
mpeg2_vaapi
mpeg2video
mpeg4
mpeg4_v4l2m2m # passthrough
msmpeg4v1
msmpeg4v2
msmpeg4v3
msnsiren
msvideo1
nellymoser
opus # opus
pam
pbm # trivial
pcm_alaw # trivial
pcm_f32be # trivial
pcm_f32le # trivial
pcm_f64be # trivial
pcm_f64le # trivial
pcm_mulaw # trivial
pcm_s16be # trivial
pcm_s16be_planar # trivial
pcm_s16le # trivial
pcm_s16le_planar # trivial
pcm_s24be # trivial
pcm_s24le # trivial
pcm_s24le_planar # trivial
pcm_s32be # trivial
pcm_s32le # trivial
pcm_s32le_planar # trivial
pcm_s8 # trivial
pcm_s8_planar # trivial
pcm_u16be # trivial
pcm_u16le # trivial
pcm_u24be # trivial
pcm_u24le # trivial
pcm_u32be # trivial
pcm_u32le # trivial
pcm_u8 # trivial
pcx
pgm # trivial
pgmyuv # trivial
phm # trivial
png # libpng
ppm # trivial
qoi
qtrle
r10k # trivial
r210 # trivial
ra_144
rawvideo # trivial
roq
roq_dpcm
rpza
rv10
rv20
s302m
sbc
sgi # trivial
siren
smc
snow
sonic
sonic_ls
speedhq
srt # trivial
ssa # trivial
subrip # trivial
sunrast # trivial
svq1
targa # trivial
text # trivial
tiff # libtiff
truehd
tta
ttml
utvideo
v210 # trivial
v308 # trivial
v408 # trivial
v410 # trivial
vc2 # dirac
vnull # trivial
vorbis # libvorbis
vp8_qsv # passthrough
vp8_v4l2m2m # passthrough
vp8_vaapi # passthrough
vp9_qsv # passthrough
vp9_vaapi # passthough
wavpack
wbmp
webvtt # trivial
wmav1
wmav2
wmv1
wmv2
wrapped_avframe # passthrough
xbm # trivial
xface
xsub
xwd # xwd
y41p # trivial
yuv4 # trivial
zlib # zlib
zmbv # dosbox

View File

@ -0,0 +1,195 @@
From: Ismail Dönmez <ismail@i10z.com>
Date: 2019-06-11 11:21:23
This is ffmpeg-4.1-dlopen-faac-mp3lame-opencore-x264-x265-xvid.patch
from OpenMandriva to optionally enable runtime enabling of
fdkaac/lame/x264/x265.
---
configure | 3 ++
libavcodec/dlopen.h | 12 ++++++++++
libavcodec/libfdk-aacdec.c | 53 +++++++++++++++++++++++++++++++++++++++++++++
libavcodec/libfdk-aacenc.c | 47 +++++++++++++++++++++++++++++++++++++++
4 files changed, 115 insertions(+)
Index: ffmpeg-5.1/configure
===================================================================
--- ffmpeg-5.1.orig/configure
+++ ffmpeg-5.1/configure
@@ -231,6 +231,7 @@ External library support:
--enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
and libraw1394 [no]
--enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
+ --enable-libfdk-aac-dlopen enable AAC de/encoding via dlopen()'ed libfdk-aac [no]
--enable-libflite enable flite (voice synthesis) support via libflite [no]
--enable-libfontconfig enable libfontconfig, useful for drawtext filter [no]
--enable-libfreetype enable libfreetype, needed for drawtext filter [no]
@@ -1787,6 +1788,7 @@ EXTERNAL_LIBRARY_GPL_LIST="
EXTERNAL_LIBRARY_NONFREE_LIST="
decklink
libfdk_aac
+ libfdk_aac_dlopen
libtls
"
@@ -6544,6 +6546,7 @@ enabled libdrm && require_pkg
enabled libfdk_aac && { check_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
{ require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
warn "using libfdk without pkg-config"; } }
+enabled libfdk_aac_dlopen && enable libfdk_aac && add_cppflags "-I/usr/include/fdk-aac"
flite_extralibs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
enabled libflite && require libflite "flite/flite.h" flite_init $flite_extralibs
enabled fontconfig && enable libfontconfig
Index: ffmpeg-5.1/libavcodec/dlopen.h
===================================================================
--- /dev/null
+++ ffmpeg-5.1/libavcodec/dlopen.h
@@ -0,0 +1,12 @@
+#ifndef LOCALINC_DLOPEN_H
+#define LOCALINC_DLOPEN_H
+#include <dlfcn.h>
+#define num2str(x) str(x)
+#define str(x) #x
+
+#define dl_sym(func, args, lib) \
+ dl_##func = args dlsym(lib, #func); \
+ if ((err = dlerror())) \
+ goto error;
+
+#endif
Index: ffmpeg-5.1/libavcodec/libfdk-aacdec.c
===================================================================
--- ffmpeg-5.1.orig/libavcodec/libfdk-aacdec.c
+++ ffmpeg-5.1/libavcodec/libfdk-aacdec.c
@@ -38,6 +38,54 @@
#define AAC_PCM_MAX_OUTPUT_CHANNELS AAC_PCM_OUTPUT_CHANNELS
#endif
+#ifdef CONFIG_LIBFDK_AAC_DLOPEN
+#include "dlopen.h"
+AAC_DECODER_ERROR (*dl_aacDecoder_AncDataInit)(HANDLE_AACDECODER, UCHAR*, int);
+HANDLE_AACDECODER (*dl_aacDecoder_Open)(TRANSPORT_TYPE, UINT);
+AAC_DECODER_ERROR (*dl_aacDecoder_Fill)(HANDLE_AACDECODER, UCHAR**, const UINT*, UINT*);
+AAC_DECODER_ERROR (*dl_aacDecoder_ConfigRaw)(HANDLE_AACDECODER, UCHAR **, const UINT*);
+AAC_DECODER_ERROR (*dl_aacDecoder_SetParam)(const HANDLE_AACDECODER, const AACDEC_PARAM, const INT);
+AAC_DECODER_ERROR (*dl_aacDecoder_DecodeFrame)(HANDLE_AACDECODER, INT_PCM*, const INT, const UINT);
+CStreamInfo* (*dl_aacDecoder_GetStreamInfo)(HANDLE_AACDECODER);
+void (*dl_aacDecoder_Close)(HANDLE_AACDECODER);
+#define aacDecoder_AncDataInit dl_aacDecoder_AncDataInit
+#define aacDecoder_Open dl_aacDecoder_Open
+#define aacDecoder_Fill dl_aacDecoder_Fill
+#define aacDecoder_ConfigRaw dl_aacDecoder_ConfigRaw
+#define aacDecoder_SetParam dl_aacDecoder_SetParam
+#define aacDecoder_DecodeFrame dl_aacDecoder_DecodeFrame
+#define aacDecoder_GetStreamInfo dl_aacDecoder_GetStreamInfo
+#define aacDecoder_Close dl_aacDecoder_Close
+#define FDKAAC_LIB "libfdk-aac.so.2"
+static int loadLibFdkAac(AVCodecContext *avctx);
+static int loadLibFdkAac(AVCodecContext *avctx) {
+ void *libfdkaac = NULL;
+ const char *err = NULL;
+
+ libfdkaac = dlopen(FDKAAC_LIB, RTLD_LAZY);
+ if(err = dlerror()) {
+ av_log(avctx, AV_LOG_FATAL, "%s\n%s is missing, libfdk-aac support will be disabled\n", err, FDKAAC_LIB);
+ if(libfdkaac)
+ dlclose(libfdkaac);
+ return 1;
+ }
+ dl_sym(aacDecoder_AncDataInit, (AAC_DECODER_ERROR (*)(HANDLE_AACDECODER, UCHAR*, int)), libfdkaac);
+ dl_sym(aacDecoder_Open, (HANDLE_AACDECODER (*)(TRANSPORT_TYPE, UINT)), libfdkaac);
+ dl_sym(aacDecoder_Fill, (AAC_DECODER_ERROR (*)(HANDLE_AACDECODER, UCHAR**, const UINT*, UINT*)), libfdkaac);
+ dl_sym(aacDecoder_ConfigRaw, (AAC_DECODER_ERROR (*)(HANDLE_AACDECODER, UCHAR**, const UINT*)), libfdkaac);
+ dl_sym(aacDecoder_SetParam, (AAC_DECODER_ERROR (*)(const HANDLE_AACDECODER, const AACDEC_PARAM, const INT)), libfdkaac);
+ dl_sym(aacDecoder_DecodeFrame, (AAC_DECODER_ERROR (*)(HANDLE_AACDECODER, INT_PCM*, const INT, const UINT)), libfdkaac);
+ dl_sym(aacDecoder_GetStreamInfo, (CStreamInfo* (*)(HANDLE_AACDECODER)), libfdkaac);
+ dl_sym(aacDecoder_Close, (void (*)(HANDLE_AACDECODER)), libfdkaac);
+ return 0;
+error:
+ av_log(avctx, AV_LOG_FATAL, "libfdk-aac: Missing symbols in %s: %s\n"
+ "libfdk-aac support disabled\n", FDKAAC_LIB, err);
+ dlclose(libfdkaac);
+ return 1;
+}
+#endif
+
enum ConcealMethod {
CONCEAL_METHOD_SPECTRAL_MUTING = 0,
CONCEAL_METHOD_NOISE_SUBSTITUTION = 1,
@@ -244,6 +292,11 @@ static av_cold int fdk_aac_decode_init(A
FDKAACDecContext *s = avctx->priv_data;
AAC_DECODER_ERROR err;
+#ifdef CONFIG_LIBFDK_AAC_DLOPEN
+ if (loadLibFdkAac(avctx))
+ return -1;
+#endif
+
s->handle = aacDecoder_Open(avctx->extradata_size ? TT_MP4_RAW : TT_MP4_ADTS, 1);
if (!s->handle) {
av_log(avctx, AV_LOG_ERROR, "Error opening decoder\n");
Index: ffmpeg-5.1/libavcodec/libfdk-aacenc.c
===================================================================
--- ffmpeg-5.1.orig/libavcodec/libfdk-aacenc.c
+++ ffmpeg-5.1/libavcodec/libfdk-aacenc.c
@@ -36,6 +36,48 @@
#define FDKENC_VER_AT_LEAST(vl0, vl1) 0
#endif
+#ifdef CONFIG_LIBFDK_AAC_DLOPEN
+#include "dlopen.h"
+#include <fdk-aac/aacdecoder_lib.h>
+AACENC_ERROR (*dl_aacEncOpen)(HANDLE_AACENCODER*, const UINT, const UINT);
+AACENC_ERROR (*dl_aacEncoder_SetParam)(const HANDLE_AACENCODER, const AACENC_PARAM, const UINT);
+AACENC_ERROR (*dl_aacEncEncode)(const HANDLE_AACENCODER, const AACENC_BufDesc*, const AACENC_BufDesc*, const AACENC_InArgs*, AACENC_OutArgs*);
+AACENC_ERROR (*dl_aacEncInfo)(const HANDLE_AACENCODER, AACENC_InfoStruct*);
+AACENC_ERROR (*dl_aacEncClose)(HANDLE_AACENCODER*);
+
+#define aacEncOpen dl_aacEncOpen
+#define aacEncoder_SetParam dl_aacEncoder_SetParam
+#define aacEncEncode dl_aacEncEncode
+#define aacEncInfo dl_aacEncInfo
+#define aacEncClose dl_aacEncClose
+#define FDKAAC_LIB "libfdk-aac.so.2"
+
+static int loadLibFdkAac(AVCodecContext *avctx);
+static int loadLibFdkAac(AVCodecContext *avctx) {
+ void *libfdkaac = NULL;
+ const char *err = NULL;
+
+ libfdkaac = dlopen(FDKAAC_LIB, RTLD_LAZY);
+ if(err = dlerror()) {
+ av_log(avctx, AV_LOG_FATAL, "%s\n%s is missing, libfdk-aac support will be disabled\n", err, FDKAAC_LIB);
+ if(libfdkaac)
+ dlclose(libfdkaac);
+ return 1;
+ }
+ dl_sym(aacEncOpen, (AACENC_ERROR (*)(HANDLE_AACENCODER*, const UINT, const UINT)), libfdkaac);
+ dl_sym(aacEncoder_SetParam, (AACENC_ERROR (*)(const HANDLE_AACENCODER, const AACENC_PARAM, const UINT)), libfdkaac);
+ dl_sym(aacEncEncode, (AACENC_ERROR (*)(const HANDLE_AACENCODER, const AACENC_BufDesc*, const AACENC_BufDesc*, const AACENC_InArgs*, AACENC_OutArgs*)), libfdkaac);
+ dl_sym(aacEncInfo, (AACENC_ERROR (*)(const HANDLE_AACENCODER, AACENC_InfoStruct*)), libfdkaac);
+ dl_sym(aacEncClose, (AACENC_ERROR (*)(HANDLE_AACENCODER*)), libfdkaac);
+ return 0;
+error:
+ av_log(avctx, AV_LOG_FATAL, "libfdk-aac: Missing symbols in %s: %s\n"
+ "libfdk-aac support disabled\n", FDKAAC_LIB, err);
+ dlclose(libfdkaac);
+ return 1;
+}
+#endif
+
typedef struct AACContext {
const AVClass *class;
HANDLE_AACENCODER handle;
@@ -128,6 +170,11 @@ static av_cold int aac_encode_init(AVCod
int aot = FF_PROFILE_AAC_LOW + 1;
int sce = 0, cpe = 0;
+#ifdef CONFIG_LIBFDK_AAC_DLOPEN
+ if (loadLibFdkAac(avctx))
+ return -1;
+#endif
+
if ((err = aacEncOpen(&s->handle, 0, avctx->ch_layout.nb_channels)) != AACENC_OK) {
av_log(avctx, AV_LOG_ERROR, "Unable to open the encoder: %s\n",
aac_get_error(err));

View File

@ -0,0 +1,26 @@
From 097c917c147661f5378dae8fe3f7e46f43236426 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Date: Thu, 17 Oct 2019 11:11:55 +0200
Subject: [PATCH] avcodec/ac3enc: Fix memleak
Fixes ticket #8294.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
libavcodec/ac3enc.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Index: ffmpeg-5.1.3/libavcodec/ac3enc.c
===================================================================
--- ffmpeg-5.1.3.orig/libavcodec/ac3enc.c
+++ ffmpeg-5.1.3/libavcodec/ac3enc.c
@@ -2204,7 +2204,8 @@ av_cold int ff_ac3_encode_close(AVCodecC
av_freep(&block->cpl_coord_mant);
}
- s->mdct_end(s);
+ if (s->mdct_end)
+ s->mdct_end(s);
return 0;
}

1
ffmpeg-5-rpmlintrc Normal file
View File

@ -0,0 +1 @@
addFilter("shlib-fixed-dependency")

BIN
ffmpeg-5.1.4.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

11
ffmpeg-5.1.4.tar.xz.asc Normal file
View File

@ -0,0 +1,11 @@
-----BEGIN PGP SIGNATURE-----
iQFMBAABCAA2FiEE/PmG6hXm4pOlZE8QtDIvBNZ2WNgFAmVNbhEYHGZmbXBlZy1k
ZXZlbEBmZm1wZWcub3JnAAoJELQyLwTWdljYdNMIAI+dP+nDw3YxOpr4H7ACcmpD
mfKku9WKbrp648wqWDeB2jEFEe4F2Wh1hViGBoMs0bZ6ZnZY37SbvOAAGSP5aMNM
DTxspAf5VwoBGWRFcx8ljSZImozwfDQuXL2DjxVA71s+7v47b8ww1flGIveIxnJG
uFAZ0MUR6CN3NHMAjbpro+pZRam4hSA3UzNCgLF00iqzksOm9WxZqbOL0AJoH+en
6wTqH+29BZhfY+zICyZnknYla3PcKxvO73grSY+dlpmleQEE2HIsmu0/b+v6CCeI
qXoGEFF5PazrCW4JLuCXDOQmcxLreesCSdCsdHxPg8pU4zj3jQpO2UV6r/YdAE0=
=LL3G
-----END PGP SIGNATURE-----

490
ffmpeg-5.changes Normal file
View File

@ -0,0 +1,490 @@
-------------------------------------------------------------------
Tue Apr 27 11:38:35 UTC 2024 - Cliff Zhao <qzhao@suse.com>
- Add ffmpeg-CVE-2023-50010.patch:
Backporting e4d2666b from upstream, fixes the out of array access.
(CVE-2023-50010 bsc#1223256)
-------------------------------------------------------------------
Fri Apr 26 22:16:48 UTC 2024 - Jan Engelhardt <jengelh@inai.de>
- Add 0001-avfilter-af_stereowiden-Check-length.patch
[boo#1223437, CVE-2023-51794]
-------------------------------------------------------------------
Tue Apr 26 12:18:26 UTC 2024 - Cliff Zhao <qzhao@suse.com>
- Add ffmpeg-CVE-2023-50009.patch:
Backporting c443658d from upstream, Fix small inputs with
gaussian_blur().
(CVE-2023-50009 bsc#1223255)
-------------------------------------------------------------------
Tue Apr 24 10:48:32 UTC 2024 - Cliff Zhao <qzhao@suse.com>
- Add ffmpeg-Templatify-ff_gaussian_blur-and-ff-function.patch:
Backporting cf1f5744 from upstream, Templatify function
ff_gaussian_blur and ff_sobel to prepare fix support for CVE-2023-50009.
(CVE-2023-50009 bsc#1223255)
-------------------------------------------------------------------
Thu Apr 23 16:14:18 UTC 2024 - Cliff Zhao <qzhao@suse.com>
- Add ffmpeg-CVE-2023-51793.patch:
Backporting 0ecc1f0e from upstream, Fix odd height handling.
(CVE-2023-51793 bsc#1223272)
-------------------------------------------------------------------
Thu Apr 23 15:35:32 UTC 2024 - Cliff Zhao <qzhao@suse.com>
- Add ffmpeg-CVE-2023-49502.patch:
Backporting 737ede40 from upstream, account for chroma sub-sampling
in min size calculation.
(CVE-2023-49502 bsc#1223235)
-------------------------------------------------------------------
Thu Apr 23 14:05:28 UTC 2024 - Cliff Zhao <qzhao@suse.com>
- Add ffmpeg-CVE-2023-50008.patch:
Backporting 5f87a68c from upstream, Fix memory leaks.
(CVE-2023-50008 bsc#1223254)
-------------------------------------------------------------------
Thu Apr 23 12:22:53 UTC 2024 - Cliff Zhao <qzhao@suse.com>
- Add ffmpeg-CVE-2023-50007.patch:
Backporting b1942734 from upstream, Fix crash with EOF handling.
(CVE-2023-50007 bsc#1223253)
-------------------------------------------------------------------
Mon Apr 22 23:10:31 UTC 2024 - Jan Engelhardt <jengelh@inai.de>
- Address boo#1223274/CVE-2023-51796: add patch
0001-avfilter-f_reverse-Apply-PTS-compensation-only-when-.patch
-------------------------------------------------------------------
Mon Apr 22 12:41:55 UTC 2024 - Jan Engelhardt <jengelh@inai.de>
- Address boo#1222730/CVE-2023-49528: add patches
0001-avfilter-af_dialoguenhance-fix-overreads.patch,
0001-avfilter-af_dialoguenhance-simplify-channels-copy.patch,
0001-avfilter-af_dialoguenhance-do-output-scaling-once.patch
- Address boo#1223070/CVE-2024-31578: add patch
0001-avutil-hwcontext-Don-t-assume-frames_uninit-is-reent.patch
- Address boo#1223085/CVE-2024-31582: add patch
0001-avfilter-vf_codecview-fix-heap-buffer-overflow.patch
- Address boo#1223087/CVE-2024-31585, boo#1223273/CVE-2023-51795:
add patch
0001-avfilter-avf_showspectrum-fix-off-by-1-error.patch
-------------------------------------------------------------------
Fri Feb 2 09:44:11 UTC 2024 - Stefan Dirsch <sndirsch@suse.com>
- drop support for libmfx, which is no longer supported upstream
at all (boo#1219494)
-------------------------------------------------------------------
Fri Jan 19 21:31:35 UTC 2024 - Jan Engelhardt <jengelh@inai.de>
- Disable libjxl integration as ffmpeg-5 cannot handle libjxl>=0.9.
-------------------------------------------------------------------
Wed Dec 6 08:50:00 UTC 2023 - Jan Engelhardt <jengelh@inai.de>
- Copy codec list from ffmpeg-6
-------------------------------------------------------------------
Fri Nov 10 11:19:52 UTC 2023 - Bjørn Lie <bjorn.lie@gmail.com>
- Update to version 5.1.4:
* Updates and bugfixes to avcodecs, avformat and avfilters
mainly.
- Drop patches fixed upstream:
* 0001-avcodec-libsvtav1-replace-vbv_bufsize-with-maximum_b.patch
* 0002-avcodec-libsvtav1-remove-compressed_ten_bit_format-a.patch
* 0003-avcodec-libsvtav1-only-set-max_buf_sz-if-both-bitrat.patch
* 0004-avcodec-libsvtav1-use-larger-of-bit-rate-and-max-rat.patch
* 0001-avcodec-x86-mathops-clip-constants-used-with-shift-i.patch
-------------------------------------------------------------------
Wed Oct 4 07:59:01 UTC 2023 - Manfred Hollstein <manfred.h@gmx.net>
- Add 0001-avcodec-x86-mathops-clip-constants-used-with-shift-i.patch
to resolve a build failure on 15.4/15.5.
-------------------------------------------------------------------
Thu Jun 29 12:26:41 UTC 2023 - Jan Engelhardt <jengelh@inai.de>
- Add 0001-avcodec-libsvtav1-replace-vbv_bufsize-with-maximum_b.patch,
0002-avcodec-libsvtav1-remove-compressed_ten_bit_format-a.patch,
0003-avcodec-libsvtav1-only-set-max_buf_sz-if-both-bitrat.patch,
0004-avcodec-libsvtav1-use-larger-of-bit-rate-and-max-rat.patch
-------------------------------------------------------------------
Wed Apr 19 20:09:16 UTC 2023 - Bjørn Lie <bjorn.lie@gmail.com>
- Update to version 5.1.3:
* avcodec/012v: Order operations for odd size handling
* avcodec/alsdec:
- Check bits left before block decoding in non multi channel
coding loop
- The minimal block is at least 7 bits
* avcodec/atrac3plus: reorder channels to match the output layout
* avcodec/audiotoolboxenc: return AVERROR_EXTERNAL immediately
when encode error
* avcodec/bink:
- Avoid undefined out of array end pointers in
binkb_decode_plane()
- Fix off by 1 error in ref end
* avcodec/eac3dec: avoid float noise in fixed mode addition to
overflow
* avcodec/eatgq: : Check index increments in tgq_decode_block()
* avcodec/escape124:
- Fix signdness of end of input check
- Fix some return codes
* avcodec/ffv1dec:
- Check that num h/v slices is supported
- Fail earlier if prior context is corrupted
* avcodec/ffv1dec: restructure slice coordinate reading a bit
* avcodec/h274: fix include
* avcodec/libjxldec:
- Fix gamma22 and gamma28 recognition
- Avoid hard failure with unspecified primaries
* avcodec/mjpegenc: take into account component count when
writing the SOF header size
* avcodec/mlpdec: Check max matrix instead of max channel in
noise check
* avcodec/motionpixels: Mask pixels to valid values
* avcodec/mpeg12dec:
- Check input size
- Use init_get_bits8 and check the return value
* avcodec/nvenc: fix vbv buffer size in cq mode
* avcodec/pictordec: Remove mid exit branch
* avcodec/pngdec:
- Check deloco index more exactly
- Dont skip/read chunk twice
* avcodec/rpzaenc: stop accessing out of bounds frame
* avcodec/scpr3: Check bx
* avcodec/scpr: Test bx before use
* avcodec/smcenc: stop accessing out of bounds frame
* avcodec/snowenc: Fix visual weight calculation
* avcodec/speedhq: Check buf_size to be big enough for DC
* avcodec/speexdec: Check channels > 2
* avcodec/sunrast: Fix maplength check
* avcodec/tests/snowenc:
- Fix 2nd test
- Return a failure if DWT/IDWT mismatches
- Unbreak DWT tests
* avcodec/tiff: Ignore tile_count
* avcodec/utils:
- Allocate a line more for VC1 and WMV3
- Ensure linesize for SVQ3
- Use 32pixel alignment for bink
* avcodec/videodsp_template: Adjust pointers to avoid undefined
pointer things
* avcodec/wavpack:
- Avoid undefined shift in get_tail()
- Check for end of input in wv_unpack_dsd_high()
* avcodec/xpmdec: Check size before allocation to avoid
truncation
* avcodec/aacdec: fix parsing streams with channel configuration
11
* avformat/id3v2: Check taglen in read_uslt()
* avformat/mov: Check samplesize and offset to avoid integer
overflow
* avformat/mxfdec: Use 64bit in remainder
* avformat/replaygain: avoid undefined / negative abs
* avformat/vividas: Check packet size
* avutil/tx: Use unsigned in ff_tx_fft_sr_combine() to avoid
undefined behavior
* hwcontext_vulkan: remove optional encode/decode extensions from
the list
* lavf/async: Fix ring_write return value
* lavu/vulkan: fix handle type for 32-bit targets
* libswscale: force a minimum size of the slide for bayer sources
* swscale/input: Use more unsigned intermediates
* swscale/output:
- Bias 16bps output calculations to improve non overflowing
range
- Bias 16bps output calculations to improve non overflowing
range for GBRP16/GBRPF32
* swscale: aarch64: Fix yuv2rgb with negative strides
* Use https for repository links
* vulkan: Fix win/i386 calling convention
- Rebase patches with quilt.
- Drop ffmpeg-CVE-2022-3964.patch: Fixed upstream.
- Drop no-vk-video-decoding.patch: Upstream removed this optional
code.
- Use ldconfig_scriptlets macro.
-------------------------------------------------------------------
Thu Mar 16 18:11:17 UTC 2023 - Callum Farmer <gmbr3@opensuse.org>
- Obsolete old FFmpeg 5 libswresample4, otherwise they'll conflict
-------------------------------------------------------------------
Thu Mar 16 17:55:37 UTC 2023 - Jan Engelhardt <jengelh@inai.de>
- Conflict with otherproviders(ffmpeg-tools).
-------------------------------------------------------------------
Mon Mar 13 11:54:15 UTC 2023 - Jan Engelhardt <jengelh@inai.de>
- Add soname.diff to get libswresample4 nonconflicting with ffmpeg-6.
-------------------------------------------------------------------
Thu Mar 9 09:48:42 UTC 2023 - Jan Engelhardt <jengelh@inai.de>
- Actually enable libjxl backend
-------------------------------------------------------------------
Mon Feb 27 09:44:58 UTC 2023 - Jan Engelhardt <jengelh@inai.de>
- Add ``Requires: this-is-only-for-build-envs`` [boo#1208652]
-------------------------------------------------------------------
Tue Jan 31 16:03:09 UTC 2023 - Jan Engelhardt <jengelh@inai.de>
- Add no-vk-video-decoding.patch to resolve build failure
with Vulkan 1.3.239
-------------------------------------------------------------------
Fri Jan 17 11:01:25 UTC 2023 - Manfred Hollstein <manfred.h@gmx.net>
- Merge ffmpeg-5-mini.spec with the main .spec file in order to
make building the _multibuild packages easier for the case the
package is named to be built for a specific distribution; an
example would be "A_tw-ffmpeg-5" in Packman.
-------------------------------------------------------------------
Thu Jan 5 12:57:10 UTC 2023 - Jan Engelhardt <jengelh@inai.de>
- Provide a ffmpeg-5-mini-devel build recipe to help split
anticipated build cycles.
- Reenable SDL2 for ffmpeg-5.spec. ffplay and -vf sdl should be
back. [boo#1206505]
-------------------------------------------------------------------
Mon Dec 12 21:18:30 UTC 2022 - Dirk Müller <dmueller@suse.com>
- build for x86_64 subarchs the same way like for baseline
-------------------------------------------------------------------
Thu Dec 8 11:27:56 UTC 2022 - Callum Farmer <gmbr3@opensuse.org>
- Enable librist support on TW: enables usage of RIST encoded MPEG-TS
streams and is used by OBS Studio
-------------------------------------------------------------------
Tue Dec 6 16:01:30 UTC 2022 - Jan Engelhardt <jengelh@inai.de>
- Drop BuildRequire on SDL2 to break a dependency loop; with this,
/usr/bin/ffplay is no longer built.
-------------------------------------------------------------------
Wed Nov 16 01:32:19 UTC 2022 - Alynx Zhou <alynx.zhou@suse.com>
- Add ffmpeg-CVE-2022-3964.patch: Backport from upstream to fix
out of bounds read in update_block_in_prev_frame() (bsc#1205388).
-------------------------------------------------------------------
Sat Oct 15 17:22:52 UTC 2022 - Neal Gompa <ngompa@opensuse.org>
- Refresh Fedora OpenH264 dlopen patch and sources for OpenH264 2.3.1
* Patch: ffmpeg-dlopen-openh264.patch
* Source: ffmpeg-dlopen-headers.tar.xz
* Source: ffmpeg_get_dlopen_headers.sh
-------------------------------------------------------------------
Wed Oct 5 17:00:38 UTC 2022 - Luigi Baldoni <aloisio@gmx.com>
- Enable AMF conditionally
-------------------------------------------------------------------
Mon Sep 26 18:44:55 UTC 2022 - C J <c.j@tuta.io>
- Update to release 5.1.2
* Add more field checks, add checks against overflows,
or outright use larger integer types.
* avformat/dashdec: Fix crash on invalid input/ENOMEM, fix leak
* lavc/videotoolbox: do not pass AVCodecContext to decoder
output callback
* lavc/pthread_frame: always transfer stashed hwaccel state
* avcodec/arm/sbcenc: avoid callee preserved vfp registers
* avformat/riffdec: don't unconditionally overwrite
WAVEFORMATEXTENSIBLE layout
* avfilter/vf_scale: overwrite the width and height expressions
with the original values
* lavc/pthread_frame: avoid leaving stale hwaccel state in
worker threads
-------------------------------------------------------------------
Sun Sep 4 11:45:19 UTC 2022 - Jan Engelhardt <jengelh@inai.de>
- Update to release 5.1.1
* avformat/asfdec_o: limit recursion depth in asf_read_unknown()
* libavformat/iff: Check for overflow in body_end calculation
* avformat/avidec: Prevent entity expansion attacks
* avcodec/h263dec: Sanity check against minimal I/P frame size
* avcodec/libvpx: fix assembling vp9 packets with alpha channel
* avcodec/libspeexdec: Fix use of uninitialized value
* avcodec/alac: don't fail if channels aren't set during init()
when extradata is valid
* avformat/mov: Check count sums in build_open_gop_key_points()
[CVE-2022-2566] [boo#1203441]
-------------------------------------------------------------------
Tue Jul 26 18:55:46 UTC 2022 - Jan Engelhardt <jengelh@inai.de>
- Enable libjxl
-------------------------------------------------------------------
Sat Jul 23 15:29:58 UTC 2022 - Callum Farmer <gmbr3@opensuse.org>
- Update ffmpeg-chromium.patch from upstream
-------------------------------------------------------------------
Sat Jul 23 08:35:20 UTC 2022 - Jan Engelhardt <jengelh@inai.de>
- Update to release 5.1
* AVIF image muxer support for the AV1-based image format
* JPEG-XL image support
* Removed the X-Video Motion Compensation (XvMC) hardware
acceleration
* IPFS/IPNS protocol support
* PCM-Bluray encoder support
- Drop vmaf-trim-usr-local.patch (obsolete),
ffmpeg-openh264-averr-on-bad-version.patch (merged)
- Add work-around-abi-break.patch
-------------------------------------------------------------------
Sat Apr 9 22:36:13 UTC 2022 - Dirk Müller <dmueller@suse.com>
- update to 5.0.1:
* avcodec/exr: Avoid signed overflow in displayWindow
* avcodec/diracdec: avoid signed integer overflow in global mv
* avcodec/takdsp: Fix integer overflow in decorrelate_sf()
* avcodec/apedec: fix a integer overflow in long_filter_high_3800()
* avdevice/dshow: fix regression
* avfilter/vf_subtitles: pass storage size to libass
* avcodec/vp9_superframe_split_bsf: Don't read inexistent data
* avcodec/vp9_superframe_split_bsf: Discard invalid zero-sized frames
* avcodec/vp9_superframe_bsf: Check for existence of data before reading it
* avcodec/vp9_raw_reorder_bsf: Check for existence of data before reading it
* avformat/imf: fix packet pts, dts and muxing
* avformat/imf: open resources only when first needed
* avformat/imf: cosmetics
* avformat/imf_cpl: do not use filesize when reading XML file
* avformat/imfdec: Use proper logcontext
* avformat/imfdec: do not use filesize when reading XML file
* doc/utils: add missing 22.2 layout entry
* avcodec/av1: only set the private context pix_fmt field if get_pixel_format() succeeds
* avformat/aqtitledec: Skip unrepresentable durations
* avformat/cafdec: Do not store empty keys in read_info_chunk()
* avformat/mxfdec: Do not clear array in mxf_read_strong_ref_array() before writing
* avformat/mxfdec: Check for avio_read() failure in mxf_read_strong_ref_array()
* avformat/mxfdec: Check count in mxf_read_strong_ref_array()
* avformat/hls: Check target_duration
* avcodec/pixlet: Avoid signed integer overflow in scaling in filterfn()
* avformat/matroskadec: Check pre_ns
* avcodec/sonic: Use unsigned for predictor_k to avoid undefined behavior
* avcodec/libuavs3d: Check ff_set_dimensions() for failure
* avcodec/speexdec: Align some comments
* avcodec/speexdec: Use correct doxygen comments
* avcodec/mjpegbdec: Set buf_size
* avformat/matroskadec: Use rounded down duration in get_cue_desc() check
* avcodec/argo: Check packet size
* avcodec/g729_parser: Check channels
* avformat/avidec: Check height
* avformat/rmdec: Better duplicate tags check
* avformat/mov: Disallow empty sidx
* avformat/argo_cvg:: Fix order of operations in error check in argo_cvg_write_trailer()
* avformat/argo_asf: Fix order of operations in error check in argo_asf_write_trailer()
* avcodec/movtextdec: add () to CMP() macro to avoid unexpected behavior
* avformat/matroskadec: Check duration
* avformat/mov: Corner case encryption error cleanup in mov_read_senc()
* avcodec/jpeglsdec: Fix if( code style
* avcodec/jpeglsdec: Check get_ur_golomb_jpegls() for error
* avcodec/motion_est: fix indention of ff_get_best_fcode()
* avcodec/motion_est: Fix xy indexing on range violation in ff_get_best_fcode()
* avformat/hls: Use unsigned for iv computation
* avcodec/jpeglsdec: Increase range for N in ls_get_code_runterm() by using unsigned
* avformat/matroskadec: Check desc_bytes
* avformat/utils: Fix invalid NULL pointer operation in ff_parse_key_value()
* avformat/matroskadec: Fix infinite loop with bz decompression
* avformat/utils: keep chapter monotonicity on chapter updates
* avformat/mov: Check size before subtraction
* avcodec/cfhd: Avoid signed integer overflow in coeff
* avcodec/libdav1d: free the Dav1dData packet on dav1d_send_data() failure
* avcodec/h264_parser: don't alter decoder private data
* configure: link to libatomic when it's present
* fate/ffmpeg: add missing samples dependency to fate-shortest
-------------------------------------------------------------------
Thu Mar 10 13:37:06 UTC 2022 - Bjørn Lie <bjorn.lie@gmail.com>
- Drop pkgconfig(celt) BuildRequires and stop passing
--enable-libcelt to configure and drop celt from enable_decoders,
abandoned upstream for opus.
- Drop pkgconfig(libv4l2) BuildRequires and stop passing
--enable-libv4l2 to configure, only needed very old devices and
may cause problems for others for those needing it, use
LD_PRELOAD pointing on libv4l2.
- Drop pkgconfig(librtmp) BuildRequires and stop passing
conditional --enable-librtmp to configure, built-in RTMP support
is better, and has listen mode.
- Drop bcond conditionals for libaom, srt, lv2, soxr,
zmq, zimg and openmpt, build unconditionally for all supported
versions of openSUSE.
- Drop pkgconfig(enca) BuildRequires: Seems unused.
-------------------------------------------------------------------
Sat Feb 19 13:26:41 UTC 2022 - Enrico Belleri <idesmi@protonmail.com>
- Use Shaderc instead of separate glslang/SPIRV-Tools for Vulkan support
-------------------------------------------------------------------
Fri Feb 18 22:32:41 UTC 2022 - Neal Gompa <ngompa@opensuse.org>
- Add patch to fix error returned with bad versions of OpenH264
* Patch: ffmpeg-openh264-averr-on-bad-version.patch
- Enable OpenH264 as an H.264 codec via dlopen using patch from Fedora
* Patch: ffmpeg-dlopen-openh264.patch
- Add source and script for headers for dlopening OpenH264
* Source: ffmpeg-dlopen-headers.tar.xz
* Source: ffmpeg_get_dlopen_headers.sh
-------------------------------------------------------------------
Wed Feb 16 18:46:55 UTC 2022 - Dominique Leuenberger <dimstar@opensuse.org>
- Disamble libsmbclient usage (can always be built with
--with-smbclient): the usecase of ffmpeg directly accessing
smb:// shares is quite constructed (most users will have their
smb shares mounted).
-------------------------------------------------------------------
Sun Jan 30 20:07:03 UTC 2022 - Jan Engelhardt <jengelh@inai.de>
- Enable building with glslang. (Should enable video blending
with GLSL.)
- Unconditionalize ffnvcodec (like vmaf already is).
-------------------------------------------------------------------
Sun Jan 16 12:09:57 UTC 2022 - Callum Farmer <gmbr3@opensuse.org>
- Add ffmpeg-chromium.patch: allows Chromium to use the now
internalised field first_dts
-------------------------------------------------------------------
Fri Jan 14 23:16:18 UTC 2022 - Jan Engelhardt <jengelh@inai.de>
- Based on ffmpeg-4.0.spec, update to 5.0
* New Vulkan-powered filters for video horizontal/vertical
flipping.
* Speex decoder.
* Various new muxers/demuxers.
* An AV1 low-overhead bitstream format muxer is added.
* Swscale slice threading support.
* New audio and video filters.
- Drop soversion.diff (for now; it may very well be reintroduced,
depending on how 5.1 is released).

30
ffmpeg-5.keyring Normal file
View File

@ -0,0 +1,30 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQENBE22rV0BCAC3DzRmA2XlhrqYv9HKoEvNHHf+PzosmCTHmYhWHDqvBxPkSvCl
ipkbvJ4pBnVvcX6mW5QyKhspHm5j1X5ibe9Bt9/chS/obnIobmvF8shSUgjQ0qRW
9c1aWOjvT26SxYQ1y9TmYCFwixeydGFHYKjAim+evGUccni5KMlfPoT3VTPtim78
ufkr3E9Nco/Mobn/8APO0NmLEGWAM6ln/8J/c9h6a1QKnQyBqWfT0YnAaebafFaZ
YwOtRdDG54VbJ4xwcHbCj5cKhTABk/QtBzDvnW4bG+uSpqdHbFZEY2JpURDuj/T3
NudKQGzn0bYNpY1XY2l0pqs/btKHnBW0fVMjABEBAAG0NEZGbXBlZyByZWxlYXNl
IHNpZ25pbmcga2V5IDxmZm1wZWctZGV2ZWxAZmZtcGVnLm9yZz6JATgEEwECACIF
Ak22rV0CGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJELQyLwTWdljYKxUH
/1fqzl7SKie2g4t4PJbqUbkLuMsC+CP6gp0dcVZOHkuUYAoD3PM3iVxpLBVyKIXI
g7wMSTAtlIcYnzhWIpnoCBes6/O2Mrq6xHgGeTp6CDcm3LmmSYR1f5KdD8KUaA+l
c/M/1fEnwrSs/UGDk6R6iUmbqwxPsbozlOvmUHOLbDZBnKrk9XfAJdUhAuFACrSA
T+KF1jniz0OfNGd23SaHWRCphoRW9pXDc5FfkdaueBUvBvGv19ZNcDhcxT3/u6z2
DaUFC0rLWqk8obo951jVvi/zOhB94Pw6u1SLvcTq3V1q5URWJtgSbpih9VRqxUbQ
NbXduKGzbHz6Vwpkupz4JRe5AQ0ETbatXQEIANjYrygJi/fn1nlSg5Mz0l9KHDm4
yfWtaOrXUjJcyiGe4G0XXJLGh45qxJ0DOKzi9id+9W4jby+kKuzG9O6Vn0iDeODO
aOGnz4ua7Vu6d0AbYfNXZPWge/GCodo/ZD/qri1tPkLmRtT/sniahwy6LruPNHfF
SRoNIjwbcD/IL+EbY1pL1/IFSzEAA1ZZamgmHgB7o9pwDIkK6HuvHMR/Y5MsoMfV
fWV3ZGtA6v9z51CvnHsHPsADRSnUp7aYtR412SiAO4XodMLTA92L3LxgYhI4ma7D
XZ8jgKg4JkKO+DXmoU63HtRdq/HZjeXJKk1JGJF3zCvP3DyIzZ8LWIjN8t0AEQEA
AYkBHwQYAQIACQUCTbatXQIbDAAKCRC0Mi8E1nZY2LS8B/0bMoUAl4X9D0WQbL4l
U0czCIOKOsvbHpIxivjCnOQxU23+PV5WZdoCCpSuAHGv+2OHzhNrij++P9BNTJeQ
skxdS9FH4MZwy1IRSPrxegSxbCUpBI1rd0Zf7qb9BNPrHPTueWFV1uExOSB2Apsv
WrKo2D8mR0uZAPYfYl2ToFVoa5PR7/+ii9WiJr/flF6qm7hoLpI5Bm4VcZh2GPsJ
9Vo/8x/qOGwtdWHqBykYloKsrwD4U69rjn+d9feLoPBRgoVroXWQttt0sUnyoudz
+x8ETJgPoNK3kQoDagApj4qAt83Ayac3HzNIuEJ7LdvfINIOprujnJ9vH4n04XLg
I4EZ
=Rjbw
-----END PGP PUBLIC KEY BLOCK-----

967
ffmpeg-5.spec Normal file
View File

@ -0,0 +1,967 @@
#
# spec file for package ffmpeg-5
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define flavor @BUILD_FLAVOR@%{nil}
#
# preamble is present twice, watch out
#
%if "%{flavor}" != "ffmpeg-5-mini"
# Create proper conflicts to make sure we require all from one version
# p: Conflict string, eg if you need them all for requires instead
# Default value Conflicts:
# c: copmare string ie "<" or ">=", must be defined
# v: version string ie. "< 42.3.4" or ">= 15.0.2.1", must be defined
%define devel_conflicts(p:c:v:) \
%define preamble_string %{-p:%{-p*}}%{!-p:Conflicts:} \
%define comparator %{-c:%{-c*}}%{!-c:%{error:Comparator not defined}} \
%define conflicts_version %{-v:%{-v*}}%{!-v:%{error:Version not defined}} \
\
%preamble_string libavcodec-devel %comparator %conflicts_version \
%preamble_string libavdevice-devel %comparator %conflicts_version \
%preamble_string libavfilter-devel %comparator %conflicts_version \
%preamble_string libavformat-devel %comparator %conflicts_version \
%preamble_string libavutil-devel %comparator %conflicts_version \
%preamble_string libpostproc-devel %comparator %conflicts_version \
%preamble_string libswresample-devel %comparator %conflicts_version \
%preamble_string libswscale-devel %comparator %conflicts_version \
%preamble_string ffmpeg-private-devel %comparator %conflicts_version \
%nil
%if 0%{?BUILD_ORIG}
%bcond_without amf_sdk
%bcond_without cuda_sdk
%else
# If software H264 is disabled, the hw driver must be as well:
# HW drivers can fail to initialize, namely when the hardware is absent.
# Browsers choose video formats on sites like youtube based on `ffmpeg
# -codecs` rather than the success/failure status of libav* initialization.
# This becomes a problem when a format only has a HW driver;
# the browser thinks it can do H264 but never succeeds.
%bcond_with amf_sdk
%bcond_with cuda_sdk
%endif
%bcond_with amrwb
%bcond_with fdk_aac_dlopen
%bcond_with opencore
%bcond_with smbclient
%bcond_with x264
%bcond_with x265
%bcond_with xvid
%if 0%{?suse_version} > 1500
%bcond_without mysofa
%bcond_without vidstab
%bcond_without codec2
%bcond_without rubberband
%bcond_without vulkan
%bcond_without amrwb
%bcond_without opencore
%bcond_without xvid
%else
%bcond_with mysofa
%bcond_with vidstab
%bcond_with codec2
%bcond_with rubberband
%bcond_with vulkan
%endif
%define _name ffmpeg
%define _major_version 5
%define _major_expected 6
Name: ffmpeg-5
Version: 5.1.4
Release: 0
Summary: Set of libraries for working with various multimedia formats
License: GPL-3.0-or-later
Group: Productivity/Multimedia/Video/Editors and Convertors
URL: https://ffmpeg.org/
#Freshcode-URL: http://freshcode.club/projects/ffmpeg
#Git-Clone: git://source.ffmpeg.org/ffmpeg
Source: https://www.ffmpeg.org/releases/%_name-%version.tar.xz
Source2: https://www.ffmpeg.org/releases/%_name-%version.tar.xz.asc
Source3: ffmpeg-5-rpmlintrc
Source4: enable_decoders
Source5: enable_encoders
Source6: ffmpeg-dlopen-headers.tar.xz
Source92: ffmpeg_get_dlopen_headers.sh
Source98: http://ffmpeg.org/ffmpeg-devel.asc#/ffmpeg-5.keyring
Source99: baselibs.conf
Patch1: ffmpeg-arm6l.diff
Patch2: ffmpeg-new-coder-errors.diff
Patch3: ffmpeg-codec-choice.diff
Patch4: ffmpeg-4.2-dlopen-fdk_aac.patch
Patch5: work-around-abi-break.patch
Patch9: ffmpeg-4.4-CVE-2020-22046.patch
Patch10: 0001-avfilter-af_dialoguenhance-fix-overreads.patch
Patch11: 0001-avfilter-af_dialoguenhance-simplify-channels-copy.patch
Patch12: 0001-avfilter-af_dialoguenhance-do-output-scaling-once.patch
Patch13: 0001-avutil-hwcontext-Don-t-assume-frames_uninit-is-reent.patch
Patch14: 0001-avfilter-avf_showspectrum-fix-off-by-1-error.patch
Patch15: 0001-avfilter-vf_codecview-fix-heap-buffer-overflow.patch
Patch16: 0001-avfilter-f_reverse-Apply-PTS-compensation-only-when-.patch
Patch17: 0001-avfilter-af_stereowiden-Check-length.patch
Patch90: ffmpeg-chromium.patch
Patch91: ffmpeg-dlopen-openh264.patch
Patch93: soname.diff
Patch94: ffmpeg-CVE-2023-50007.patch
Patch95: ffmpeg-CVE-2023-50008.patch
Patch96: ffmpeg-CVE-2023-49502.patch
Patch97: ffmpeg-CVE-2023-51793.patch
Patch98: ffmpeg-Templatify-ff_gaussian_blur-and-ff-function.patch
Patch99: ffmpeg-CVE-2023-50009.patch
Patch100: ffmpeg-CVE-2023-50010.patch
%if %{with amf_sdk}
BuildRequires: AMF-devel
%endif
BuildRequires: ladspa-devel
BuildRequires: libgsm-devel
BuildRequires: libmp3lame-devel
%if %{with mysofa}
BuildRequires: libmysofa-devel
%endif
BuildRequires: nasm
BuildRequires: pkg-config
%ifarch x86_64 %x86_64
%if 0%{?suse_version} >= 1550
BuildRequires: pkgconfig(SvtAv1Enc) >= 0.8.4
%endif
%endif
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(aom)
BuildRequires: pkgconfig(bzip2)
%if %{with codec2}
BuildRequires: pkgconfig(codec2)
%endif
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150200
BuildRequires: pkgconfig(dav1d)
%endif
BuildRequires: pkgconfig(ffnvcodec)
BuildRequires: pkgconfig(fontconfig) >= 2.4.2
BuildRequires: pkgconfig(freetype2)
BuildRequires: pkgconfig(fribidi) >= 0.19.0
BuildRequires: pkgconfig(gnutls)
BuildRequires: pkgconfig(jack)
BuildRequires: pkgconfig(libass)
BuildRequires: pkgconfig(libbluray)
BuildRequires: pkgconfig(libbs2b)
BuildRequires: pkgconfig(libcdio)
BuildRequires: pkgconfig(libcdio_paranoia)
BuildRequires: pkgconfig(libdc1394-2)
BuildRequires: pkgconfig(libdrm)
BuildRequires: pkgconfig(libgme)
BuildRequires: pkgconfig(libopenjp2) >= 2.1.0
BuildRequires: pkgconfig(libopenmpt)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(libpulse)
BuildRequires: pkgconfig(libraw1394)
BuildRequires: pkgconfig(libssh)
BuildRequires: pkgconfig(libva) >= 0.35.0
BuildRequires: pkgconfig(libva-drm)
BuildRequires: pkgconfig(libva-x11)
BuildRequires: pkgconfig(libvmaf) >= 1.3.9
BuildRequires: pkgconfig(libwebp) >= 0.4
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(libzmq)
BuildRequires: pkgconfig(lilv-0)
BuildRequires: pkgconfig(ogg)
BuildRequires: pkgconfig(opus)
%if 0%{?suse_version} >= 1550
BuildRequires: pkgconfig(librist)
%endif
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150400
BuildRequires: pkgconfig(rav1e)
%endif
%if %{with rubberband}
BuildRequires: pkgconfig(rubberband)
%endif
BuildRequires: pkgconfig(sdl2)
%if %{with smbclient}
BuildRequires: pkgconfig(smbclient)
%endif
BuildRequires: pkgconfig(soxr)
BuildRequires: pkgconfig(speex)
BuildRequires: pkgconfig(srt)
BuildRequires: pkgconfig(theora) >= 1.1
BuildRequires: pkgconfig(twolame)
BuildRequires: pkgconfig(vdpau)
%if %{with vidstab}
BuildRequires: pkgconfig(vidstab) >= 0.98
%endif
%if %{with vulkan}
BuildRequires: pkgconfig(shaderc)
BuildRequires: pkgconfig(vulkan)
%endif
BuildRequires: pkgconfig(vorbis)
BuildRequires: pkgconfig(vpx) >= 1.4.0
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xcb)
BuildRequires: pkgconfig(xcb-render)
BuildRequires: pkgconfig(xcb-shape)
BuildRequires: pkgconfig(xcb-shm)
BuildRequires: pkgconfig(xcb-xfixes)
BuildRequires: pkgconfig(xext)
BuildRequires: pkgconfig(xfixes)
BuildRequires: pkgconfig(zimg)
BuildRequires: pkgconfig(zlib)
BuildRequires: pkgconfig(zvbi-0.2) >= 0.2.28
%if %{with fdk_aac_dlopen}
BuildRequires: pkgconfig(fdk-aac)
%endif
%if %{with xvid}
BuildRequires: libxvidcore-devel
%endif
%if %{with opencore}
BuildRequires: pkgconfig(opencore-amrnb)
%endif
%if %{with amrwb}
BuildRequires: pkgconfig(vo-amrwbenc)
%endif
%if %{with x264}
BuildRequires: pkgconfig(x264)
%endif
%if %{with x265}
BuildRequires: pkgconfig(x265)
%endif
Provides: ffmpeg-tools = %version
Conflicts: ffmpeg-tools
Provides: ffmpeg = %version
Obsoletes: ffmpeg < %version
Requires: libavcodec59 = %version-%release
Requires: libavdevice59 = %version-%release
Requires: libavfilter8 = %version-%release
Requires: libavformat59 = %version-%release
Requires: libavutil57 = %version-%release
Requires: libpostproc56 = %version-%release
Requires: libswresample4_ff5 = %version-%release
Requires: libswscale6 = %version-%release
%description
FFmpeg is a multimedia framework, able to decode, encode,
transcode, mux, demux, stream, filter and play several formats
that humans and machines have created.
%if !0%{?BUILD_ORIG}
This build of ffmpeg is limited in the number of codecs supported.
%endif
%package -n libavcodec59
Summary: FFmpeg codec library
Group: System/Libraries
Requires: libavutil57 = %version-%release
Requires: libswresample4_ff5 = %version-%release
%if 0%{?BUILD_ORIG}
Provides: libavcodec-full = %version-%release
# This can be (and is) required by packages like vlc-codecs -
# do follow the shlib name to not get random lib providers
Provides: libavcodec59(unrestricted)
%endif
# For mozillas
Provides: libavcodec = %version-%release
%description -n libavcodec59
The libavcodec library provides a generic encoding/decoding framework
and contains multiple decoders and encoders for audio, video and
subtitle streams, and several bitstream filters.
%if !0%{?BUILD_ORIG}
This build of ffmpeg is limited in the number of codecs supported.
%endif
%package libavcodec-devel
Summary: Development files for FFmpeg's codec library
Group: Development/Libraries/C and C++
Provides: libavcodec-devel = %version-%release
Obsoletes: libavcodec-devel < %version-%release
Requires: %name-libavutil-devel = %version-%release
Requires: libavcodec59 = %version-%release
%devel_conflicts -c < -v %_major_version
%devel_conflicts -c >= -v %_major_expected
%description libavcodec-devel
The libavcodec library provides a generic encoding/decoding framework
and contains multiple decoders and encoders for audio, video and
subtitle streams, and several bitstream filters.
This subpackage contains the headers for FFmpeg libavcodec.
%package -n libavdevice59
Summary: FFmpeg device library
Group: System/Libraries
Requires: libavcodec59 = %version-%release
Requires: libavfilter8 = %version-%release
Requires: libavformat59 = %version-%release
Requires: libavutil57 = %version-%release
%description -n libavdevice59
The libavdevice library provides a generic framework for grabbing from
and rendering to many common multimedia input/output devices, and
supports several input and output devices, including Video4Linux2, VfW,
DShow, and ALSA.
%package libavdevice-devel
Summary: Development files for FFmpeg's device library
Group: Development/Libraries/C and C++
Provides: ffmpeg-devel = %version-%release
Conflicts: ffmpeg-devel
Provides: libavdevice-devel = %version-%release
Obsoletes: libavdevice-devel < %version-%release
Requires: %name-libavcodec-devel = %version-%release
Requires: %name-libavfilter-devel = %version-%release
Requires: %name-libavformat-devel = %version-%release
Requires: %name-libavutil-devel = %version-%release
Requires: %name-libpostproc-devel = %version-%release
Requires: %name-libswresample-devel = %version-%release
Requires: %name-libswscale-devel = %version-%release
Requires: libavdevice59 = %version-%release
%devel_conflicts -c < -v %_major_version
%devel_conflicts -c >= -v %_major_expected
%description libavdevice-devel
The libavdevice library provides a generic framework for grabbing from
and rendering to many common multimedia input/output devices, and
supports several input and output devices, including Video4Linux2, VfW,
DShow, and ALSA.
This subpackage contains the headers for FFmpeg libavcodec.
%package -n libavfilter8
Summary: FFmpeg audio and video filtering library
Group: System/Libraries
Requires: libavcodec59 = %version-%release
Requires: libavformat59 = %version-%release
Requires: libavutil57 = %version-%release
Requires: libpostproc56 = %version-%release
Requires: libswresample4_ff5 = %version-%release
Requires: libswscale6 = %version-%release
%description -n libavfilter8
The libavfilter library provides a generic audio/video filtering
framework containing several filters, sources and sinks.
%package libavfilter-devel
Summary: Development files for FFmpeg's audio/video filter library
Group: Development/Libraries/C and C++
Provides: libavfilter-devel = %version-%release
Obsoletes: libavfilter-devel < %version-%release
Requires: %name-libavcodec-devel = %version-%release
Requires: %name-libavformat-devel = %version-%release
Requires: %name-libavutil-devel = %version-%release
Requires: %name-libpostproc-devel = %version-%release
Requires: %name-libswresample-devel = %version-%release
Requires: %name-libswscale-devel = %version-%release
Requires: libavfilter8 = %version-%release
%devel_conflicts -c < -v %_major_version
%devel_conflicts -c >= -v %_major_expected
%description libavfilter-devel
The libavfilter library provides a generic audio/video filtering
framework containing several filters, sources and sinks.
This subpackage contains the headers for FFmpeg libavfilter.
%package -n libavformat59
Summary: FFmpeg's stream format library
Group: System/Libraries
Requires: libavcodec59 = %version-%release
Requires: libavutil57 = %version-%release
%description -n libavformat59
The libavformat library provides a generic framework for multiplexing
and demultiplexing (muxing and demuxing) audio, video and subtitle
streams. It encompasses multiple muxers and demuxers for multimedia
container formats.
%if !0%{?BUILD_ORIG}
This build of ffmpeg is limited in the number of codecs supported.
%endif
%package libavformat-devel
Summary: Development files for FFmpeg's stream format library
Group: Development/Libraries/C and C++
Provides: libavformat-devel = %version-%release
Obsoletes: libavformat-devel < %version-%release
Requires: %name-libavcodec-devel = %version-%release
Requires: %name-libavutil-devel = %version-%release
Requires: %name-libswresample-devel = %version-%release
Requires: libavformat59 = %version-%release
%devel_conflicts -c < -v %_major_version
%devel_conflicts -c >= -v %_major_expected
%description libavformat-devel
The libavformat library provides a generic framework for multiplexing
and demultiplexing (muxing and demuxing) audio, video and subtitle
streams. It encompasses multiple muxers and demuxers for multimedia
container formats.
This subpackage contains the headers for FFmpeg libavformat.
%package -n libavutil57
Summary: FFmpeg's utility library
Group: System/Libraries
%description -n libavutil57
The libavutil library is a utility library to aid portable multimedia
programming. It contains safe portable string functions, random
number generators, data structures, additional mathematics functions,
cryptography and multimedia related functionality (like enumerations
for pixel and sample formats).
%package libavutil-devel
Summary: Development files for FFmpeg's utility library
Group: Development/Libraries/C and C++
Provides: libavutil-devel = %version-%release
Obsoletes: libavutil-devel < %version-%release
Requires: libavutil57 = %version-%release
%devel_conflicts -c < -v %_major_version
%devel_conflicts -c >= -v %_major_expected
%description libavutil-devel
The libavutil library is a utility library to aid portable multimedia
programming. It contains safe portable string functions, random
number generators, data structures, additional mathematics functions,
cryptography and multimedia related functionality (like enumerations
for pixel and sample formats).
This subpackage contains the headers for FFmpeg libavutil.
%package -n libpostproc56
Summary: FFmpeg post-processing library
Group: System/Libraries
Requires: libavutil57 = %version-%release
%description -n libpostproc56
A library with video postprocessing filters, such as deblocking and
deringing filters, noise reduction, automatic contrast and brightness
correction, linear/cubic interpolating deinterlacing.
%package libpostproc-devel
Summary: Development files for the FFmpeg post-processing library
Group: Development/Libraries/C and C++
Provides: libpostproc-devel = %version-%release
Obsoletes: libpostproc-devel < %version-%release
Requires: %name-libavutil-devel = %version-%release
Requires: libpostproc56 = %version-%release
%devel_conflicts -c < -v %_major_version
%devel_conflicts -c >= -v %_major_expected
%description libpostproc-devel
A library with video postprocessing filters, such as deblocking and
deringing filters, noise reduction, automatic contrast and brightness
correction, linear/cubic interpolating deinterlacing.
This subpackage contains the headers for FFmpeg libpostproc.
%package -n libswresample4_ff5
Summary: FFmpeg software resampling library
Group: System/Libraries
Requires: libavutil57 = %version-%release
Obsoletes: libswresample4 < %version-%release
%description -n libswresample4_ff5
The libswresample library performs audio conversion between different
sample rates, channel layout and channel formats.
%package libswresample-devel
Summary: Development files for the FFmpeg software resampling library
Group: Development/Libraries/C and C++
Provides: libswresample-devel = %version-%release
Obsoletes: libswresample-devel < %version-%release
Requires: %name-libavutil-devel = %version-%release
Requires: libswresample4_ff5 = %version-%release
%devel_conflicts -c < -v %_major_version
%devel_conflicts -c >= -v %_major_expected
%description libswresample-devel
The libswresample library performs audio conversion between different
sample rates, channel layout and channel formats.
This subpackage contains the headers for FFmpeg libswresample.
%package -n libswscale6
Summary: FFmpeg image scaling and colorspace/pixel conversion library
Group: System/Libraries
Requires: libavutil57 = %version-%release
%description -n libswscale6
The libswscale library performs image scaling and colorspace and
pixel format conversion operations.
%package libswscale-devel
Summary: Development files for FFmpeg's image scaling and colorspace library
Group: Development/Libraries/C and C++
Provides: libswscale-devel = %version-%release
Conflicts: libswscale-devel
Requires: %name-libavutil-devel = %version-%release
Requires: libswscale6 = %version-%release
%devel_conflicts -c < -v %_major_version
%devel_conflicts -c >= -v %_major_expected
%description libswscale-devel
The libswscale library performs image scaling and colorspace and
pixel format conversion operations.
This subpackage contains the headers for FFmpeg libswscale.
%package private-devel
Summary: Some FFmpeg private headers
Group: Development/Libraries/C and C++
Requires: %name-libavcodec-devel = %version-%release
Requires: %name-libavformat-devel = %version-%release
Requires: %name-libavutil-devel = %version-%release
Provides: ffmpeg-private-devel = %version
Obsoletes: ffmpeg-private-devel < %version
%devel_conflicts -c < -v %_major_version
%devel_conflicts -c >= -v %_major_expected
%description private-devel
FFmpeg is a multimedia framework, able to decode, encode,
transcode, mux, demux, stream, filter and play several formats
that humans and machines have created.
This package contains some private headers for libavformat, libavcodec and
libavutil which are needed by libav-tools to build. No other package apart
from libav should depend on these private headers which are expected to
break compatibility without any notice.
%prep
%autosetup -a6 -p1 -n %_name-%version
%build
%ifarch %ix86 %arm
%define _lto_cflags %nil
%endif
%if "%_lto_cflags" != ""
%global _lto_cflags %_lto_cflags -ffat-lto-objects
%endif
CFLAGS="%optflags" \
%if %suse_version > 1500
%ifarch %ix86
%else
LDFLAGS="%_lto_cflags" \
%endif
%endif
./configure \
--prefix="%_prefix" \
--libdir="%_libdir" \
--shlibdir="%_libdir" \
--incdir="%_includedir/ffmpeg" \
--extra-cflags="%optflags" \
--optflags="%optflags" \
--disable-htmlpages \
--enable-pic \
--disable-stripping \
--enable-shared \
--disable-static \
--enable-gpl \
--enable-version3 \
%if %{with smbclient}
--enable-libsmbclient \
%endif
--disable-openssl \
--enable-gnutls \
--enable-ladspa \
%if %{with vulkan}
--enable-libshaderc --enable-vulkan \
%endif
%if %{with amf}
--enable-amf \
%endif
%if !%{with cuda_sdk}
--disable-cuda-sdk \
%endif
--enable-libaom \
--enable-libass \
--enable-libbluray \
--enable-libbs2b \
--enable-libcdio \
%if %{with codec2}
--enable-libcodec2 \
%endif
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150200
--enable-libdav1d \
%endif
--enable-libdc1394 \
--enable-libdrm \
--enable-libfontconfig \
--enable-libfreetype \
--enable-libfribidi \
--enable-libgsm \
--enable-libjack \
%if 0%{?suse_version} >= 1550
--enable-librist \
%endif
--enable-libmp3lame \
%if %{with mysofa}
--enable-libmysofa \
%endif
--enable-libopenjpeg \
--enable-libopenmpt \
--enable-libopenh264-dlopen \
--enable-libopus \
--enable-libpulse \
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150400
--enable-librav1e \
%endif
%if %{with rubberband}
--enable-librubberband \
%endif
%ifarch x86_64 %x86_64
%if 0%{?suse_version} >= 1550
--enable-libsvtav1 \
%endif
%endif
--enable-libsoxr \
--enable-libspeex \
--enable-libssh \
--enable-libsrt \
--enable-libtheora \
--enable-libtwolame \
%if %{with vidstab}
--enable-libvidstab \
%endif
--enable-libvmaf \
--enable-libvorbis \
--enable-libvpx \
--enable-libwebp \
--enable-libxml2 \
--enable-libzimg \
--enable-libzmq \
--enable-libzvbi \
%if 0%{?suse_version} > 1500
%ifarch %ix86
%else
--enable-lto \
%endif
%endif
--enable-lv2 \
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150200
%endif
--enable-vaapi \
--enable-vdpau \
--enable-version3 \
%if %{with fdk_aac_dlopen}
--enable-libfdk-aac-dlopen \
--enable-nonfree \
%endif
%if %{with opencore}
--enable-libopencore-amrnb \
--enable-libopencore-amrwb \
%endif
%if %{with amrwb}
--enable-libvo-amrwbenc \
%endif
%if %{with x264}
--enable-libx264 \
%endif
%if %{with x265}
--enable-libx265 \
%endif
%if %{with xvid}
--enable-libxvid \
%endif
%if !0%{?BUILD_ORIG}
--enable-muxers \
--enable-demuxers \
--disable-encoders \
--disable-decoders \
--disable-decoder=h264,hevc,vc1 \
--enable-encoder="$(perl -pe 's{^(\w*).*}{$1,}gs' <%_sourcedir/enable_encoders)" \
--enable-decoder="$(perl -pe 's{^(\w*).*}{$1,}gs' <%_sourcedir/enable_decoders)" \
for i in H264 HEVC VC1; do
grep -q "#define CONFIG_${i}_DECODER 0" config_components.h
done
%endif
cat config.h
%make_build
%global extratools aviocat cws2fws ffescape ffeval ffhash fourcc2pixfmt graph2dot ismindex pktdumper probetest qt-faststart seek_print sidxindex trasher
for i in %extratools; do
%make_build "tools/$i"
done
%install
b="%buildroot"
%make_install install-man
rm -Rf "$b/%_datadir/ffmpeg/examples"
for i in %extratools; do
cp -a "tools/$i" "$b/%_bindir/"
done
# Install private headers required by libav-tools
for i in libavformat/options_table.h libavformat/os_support.h \
libavformat/internal.h libavcodec/options_table.h libavutil/libm.h \
libavutil/internal.h libavutil/colorspace.h libavutil/timer.h \
libavutil/x86/emms.h libavutil/aarch64/timer.h libavutil/arm/timer.h \
libavutil/bfin/timer.h libavutil/ppc/timer.h libavutil/x86/timer.h; do
mkdir -p "$b/%_includedir/ffmpeg/private/"`dirname $i`
cp -a $i "$b/%_includedir/ffmpeg/private/$i"
done
%ldconfig_scriptlets -n libavcodec59
%ldconfig_scriptlets -n libavdevice59
%ldconfig_scriptlets -n libavfilter8
%ldconfig_scriptlets -n libavformat59
%ldconfig_scriptlets -n libavutil57
%ldconfig_scriptlets -n libpostproc56
%ldconfig_scriptlets -n libswresample4_ff5
%ldconfig_scriptlets -n libswscale6
%files
%doc Changelog CREDITS README.md
%_bindir/*
%_mandir/man1/ff*.1*
%_datadir/ffmpeg/
%files -n libavcodec59
%license COPYING.GPLv2 LICENSE.md
%_libdir/libavcodec.so.*
%files -n libavdevice59
%license COPYING.GPLv2 LICENSE.md
%_libdir/libavdevice.so.*
%files -n libavfilter8
%license COPYING.GPLv2 LICENSE.md
%_libdir/libavfilter.so.*
%files -n libavformat59
%license COPYING.GPLv2 LICENSE.md
%_libdir/libavformat.so.*
%files -n libavutil57
%license COPYING.GPLv2 LICENSE.md
%_libdir/libavutil.so.*
%files -n libpostproc56
%license COPYING.GPLv2 LICENSE.md
%_libdir/libpostproc.so.*
%files -n libswresample4_ff5
%license COPYING.GPLv2 LICENSE.md
%_libdir/libswresample.so.*
%files -n libswscale6
%license COPYING.GPLv2 LICENSE.md
%_libdir/libswscale.so.*
%files libavcodec-devel
%dir %_includedir/ffmpeg/
%_includedir/ffmpeg/libavcodec/
%_libdir/libavcodec.so
%_libdir/pkgconfig/libavcodec.pc
%_mandir/man3/libavcodec.3*
%files libavdevice-devel
%dir %_includedir/ffmpeg/
%_includedir/ffmpeg/libavdevice/
%_libdir/libavdevice.so
%_libdir/pkgconfig/libavdevice.pc
%_mandir/man3/libavdevice.3*
%files libavfilter-devel
%dir %_includedir/ffmpeg/
%_includedir/ffmpeg/libavfilter/
%_libdir/libavfilter.so
%_libdir/pkgconfig/libavfilter.pc
%_mandir/man3/libavfilter.3*
%files libavformat-devel
%dir %_includedir/ffmpeg/
%_includedir/ffmpeg/libavformat/
%_libdir/libavformat.so
%_libdir/pkgconfig/libavformat.pc
%_mandir/man3/libavformat.3*
%files libavutil-devel
%dir %_includedir/ffmpeg/
%_includedir/ffmpeg/libavutil/
%_libdir/libavutil.so
%_libdir/pkgconfig/libavutil.pc
%_mandir/man3/libavutil.3*
%files libpostproc-devel
%dir %_includedir/ffmpeg/
%_includedir/ffmpeg/libpostproc/
%_libdir/libpostproc.so
%_libdir/pkgconfig/libpostproc.pc
%files libswresample-devel
%dir %_includedir/ffmpeg/
%_includedir/ffmpeg/libswresample/
%_libdir/libswresample.so
%_libdir/pkgconfig/libswresample.pc
%_mandir/man3/libswresample.3*
%files libswscale-devel
%dir %_includedir/ffmpeg/
%_includedir/ffmpeg/libswscale/
%_libdir/libswscale.so
%_libdir/pkgconfig/libswscale.pc
%_mandir/man3/libswscale.3*
%files private-devel
%_includedir/ffmpeg/private/
%else
%define _name ffmpeg
Name: ffmpeg-5-mini
Version: 5.1.4
Release: 0
Summary: Set of libraries for working with various multimedia formats
License: GPL-3.0-or-later
URL: https://ffmpeg.org/
#Git-Clone: git://source.ffmpeg.org/ffmpeg
Source: https://www.ffmpeg.org/releases/%_name-%version.tar.xz
Source2: https://www.ffmpeg.org/releases/%_name-%version.tar.xz.asc
Source3: ffmpeg-5-rpmlintrc
Source98: http://ffmpeg.org/ffmpeg-devel.asc#/ffmpeg-5.keyring
Patch1: ffmpeg-arm6l.diff
Patch2: ffmpeg-new-coder-errors.diff
Patch3: ffmpeg-codec-choice.diff
Patch4: ffmpeg-4.2-dlopen-fdk_aac.patch
Patch5: work-around-abi-break.patch
Patch9: ffmpeg-4.4-CVE-2020-22046.patch
Patch10: 0001-avfilter-af_dialoguenhance-fix-overreads.patch
Patch11: 0001-avfilter-af_dialoguenhance-simplify-channels-copy.patch
Patch12: 0001-avfilter-af_dialoguenhance-do-output-scaling-once.patch
Patch13: 0001-avutil-hwcontext-Don-t-assume-frames_uninit-is-reent.patch
Patch14: 0001-avfilter-avf_showspectrum-fix-off-by-1-error.patch
Patch15: 0001-avfilter-vf_codecview-fix-heap-buffer-overflow.patch
Patch16: 0001-avfilter-f_reverse-Apply-PTS-compensation-only-when-.patch
Patch17: 0001-avfilter-af_stereowiden-Check-length.patch
Patch90: ffmpeg-chromium.patch
Patch91: ffmpeg-dlopen-openh264.patch
Patch93: soname.diff
# PATCH-FIX-UPSTREAM ffmpeg-CVE-2023-50007.patch CVE-2023-50007 bsc#1223253 qzhao@suse.com -- Fix crash with EOF handling.
Patch94: ffmpeg-CVE-2023-50007.patch
# PATCH-FIX-UPSTREAM ffmpeg-CVE-2023-50008.patch CVE-2023-50008 bsc#1223254 qzhao@suse.com -- Fix memory leaks.
Patch95: ffmpeg-CVE-2023-50008.patch
# PATCH-FIX-UPSTREAM ffmpeg-CVE-2023-49502.patch CVE-2023-49502 bsc#1223235 qzhao@suse.com -- Account for chroma sub-sampling in min size calculation.
Patch96: ffmpeg-CVE-2023-49502.patch
# PATCH-FIX-UPSTREAM ffmpeg-CVE-2023-51793.patch CVE-2023-51793 bsc#1223272 qzhao@suse.com -- Fix odd height handling.
Patch97: ffmpeg-CVE-2023-51793.patch
BuildRequires: c_compiler
Requires: this-is-only-for-build-envs
%description
FFmpeg is a multimedia framework.
This package merely builds the API for the sake of other packages.
%package libs
# Even with mini, we want ff5 libs to be coinstallable to ff4-devel(!),
# hence mini-libs and mini-devel are still separated.
Summary: Feature-reduced build of FFmpeg, a multimedia framework
Conflicts: libavcodec59
Conflicts: libavdevice59
Conflicts: libavfilter8
Conflicts: libavformat59
Conflicts: libavutil57
Conflicts: libpostproc56
Conflicts: libswresample4_ff5
Conflicts: libswscale6
Requires: this-is-only-for-build-envs
%description libs
FFmpeg is a multimedia framework.
This package contains a cut-down version for building other packages.
%package devel
Summary: Header files for feature-reduced FFmpeg build
Provides: libavcodec-devel = %version-%release
Conflicts: libavcodec-devel
Provides: libavdevice-devel = %version-%release
Conflicts: libavdevice-devel
Provides: libavfilter-devel = %version-%release
Conflicts: libavfilter-devel
Provides: libavformat-devel = %version-%release
Conflicts: libavformat-devel
Provides: libavutil-devel = %version-%release
Conflicts: libavutil-devel
Provides: libpostproc-devel = %version-%release
Conflicts: libpostproc-devel
Provides: libswresample-devel = %version-%release
Conflicts: libswresample-devel
Provides: libswscale-devel = %version-%release
Conflicts: libswscale-devel
Requires: %name-libs = %version-%release
Requires: this-is-only-for-build-envs
%description devel
FFmpeg is a multimedia framework.
This package contains the headers accompanying %name.
%prep
%autosetup -p1 -n %_name-%version
%build
%define _lto_cflags %nil
CFLAGS="%optflags" \
./configure \
--prefix="%_prefix" \
--libdir="%_libdir" \
--shlibdir="%_libdir" \
--incdir="%_includedir/ffmpeg" \
--extra-cflags="%optflags" \
--optflags="%optflags" \
--disable-htmlpages --disable-stripping --disable-x86asm \
--disable-static --enable-shared --enable-pic \
--enable-gpl --enable-version3 \
--disable-muxers --disable-demuxers \
--disable-encoders --disable-decoders \
--disable-programs --disable-doc
for i in H264 HEVC VC1; do
grep -q "#define CONFIG_${i}_DECODER 0" config_components.h
done
cat config.h
%make_build
%install
b="%buildroot"
%make_install
rm -Rf "$b/%_datadir/ffmpeg/examples"
%ldconfig_scriptlets libs
%files libs
%_libdir/libavcodec.so.*
%_libdir/libavdevice.so.*
%_libdir/libavfilter.so.*
%_libdir/libavformat.so.*
%_libdir/libavutil.so.*
%_libdir/libpostproc.so.*
%_libdir/libswresample.so.*
%_libdir/libswscale.so.*
%files devel
%license COPYING.GPLv2 LICENSE.md
%_libdir/*.so
%_libdir/pkgconfig/*.pc
%_includedir/ffmpeg/
%endif
%changelog

View File

@ -0,0 +1,43 @@
From 737ede405b11a37fdd61d19cf25df296a0cb0b75
From: Cosmin Stejerean <cosmin@cosmin.at>
Date: Wed Dec 6 18:39:32 2023 +0800
Subject: avfilter/bwdif: account for chroma sub-sampling in min size calculation
References: https://bugzilla.opensuse.org/1223235
References: CVE-2023-49502
The current logic for detecting frames that are too small for the
algorithm does not account for chroma sub-sampling, and so a sample
where the luma plane is large enough, but the chroma planes are not
will not be rejected. In that event, a heap overflow will occur.
This change adjusts the logic to consider the chroma planes and makes
the change to all three bwdif implementations.
Fixes #10688
Signed-off-by: Cosmin Stejerean <cosmin@cosmin.at>
Reviewed-by: Thomas Mundt <tmundt75@gmail.com>
Signed-off-by: Philip Langdale <philipl@overt.org>
diff -Nura ffmpeg-5.1.4/libavfilter/vf_bwdif.c ffmpeg-5.1.4_new/libavfilter/vf_bwdif.c
--- ffmpeg-5.1.4/libavfilter/vf_bwdif.c 2023-11-10 07:38:51.000000000 +0800
+++ ffmpeg-5.1.4_new/libavfilter/vf_bwdif.c 2024-04-26 01:26:15.539021242 +0800
@@ -333,13 +333,14 @@
if(yadif->mode&1)
link->frame_rate = av_mul_q(link->src->inputs[0]->frame_rate, (AVRational){2,1});
- if (link->w < 3 || link->h < 4) {
- av_log(ctx, AV_LOG_ERROR, "Video of less than 3 columns or 4 lines is not supported\n");
+ yadif->csp = av_pix_fmt_desc_get(link->format);
+ yadif->filter = filter;
+
+ if (AV_CEIL_RSHIFT(link->w, yadif->csp->log2_chroma_w) < 3 || AV_CEIL_RSHIFT(link->h, yadif->csp->log2_chroma_h) < 4) {
+ av_log(ctx, AV_LOG_ERROR, "Video with planes less than 3 columns or 4 lines is not supported\n");
return AVERROR(EINVAL);
}
- yadif->csp = av_pix_fmt_desc_get(link->format);
- yadif->filter = filter;
if (yadif->csp->comp[0].depth > 8) {
s->filter_intra = filter_intra_16bit;
s->filter_line = filter_line_c_16bit;

View File

@ -0,0 +1,68 @@
From b1942734c7cbcdc9034034373abcc9ecb9644c47
From: Paul B Mahol <onemda@gmail.com>
Date: Mon Nov 27 11:45:34 2023 +0100
Subject: avfilter/af_afwtdn: fix crash with EOF handling
References: https://bugzilla.opensuse.org/1223253
References: CVE-2023-50007
diff -Nura ffmpeg-5.1.4/libavfilter/af_afwtdn.c ffmpeg-5.1.4_new/libavfilter/af_afwtdn.c
--- ffmpeg-5.1.4/libavfilter/af_afwtdn.c 2023-11-10 07:38:51.000000000 +0800
+++ ffmpeg-5.1.4_new/libavfilter/af_afwtdn.c 2024-04-25 16:14:12.016919074 +0800
@@ -410,6 +410,7 @@
uint64_t sn;
int64_t eof_pts;
+ int eof;
int wavelet_type;
int channels;
@@ -1071,7 +1072,7 @@
s->drop_samples = 0;
} else {
if (s->padd_samples < 0 && eof) {
- out->nb_samples += s->padd_samples;
+ out->nb_samples = FFMAX(0, out->nb_samples + s->padd_samples);
s->padd_samples = 0;
}
if (!eof)
@@ -1210,23 +1211,26 @@
FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
- ret = ff_inlink_consume_samples(inlink, s->nb_samples, s->nb_samples, &in);
- if (ret < 0)
- return ret;
- if (ret > 0)
- return filter_frame(inlink, in);
+ if (!s->eof) {
+ ret = ff_inlink_consume_samples(inlink, s->nb_samples, s->nb_samples, &in);
+ if (ret < 0)
+ return ret;
+ if (ret > 0)
+ return filter_frame(inlink, in);
+ }
if (ff_inlink_acknowledge_status(inlink, &status, &pts)) {
- if (status == AVERROR_EOF) {
- while (s->padd_samples != 0) {
- ret = filter_frame(inlink, NULL);
- if (ret < 0)
- return ret;
- }
- ff_outlink_set_status(outlink, status, pts);
- return ret;
- }
+ if (status == AVERROR_EOF)
+ s->eof = 1;
}
+
+ if (s->eof && s->padd_samples != 0) {
+ return filter_frame(inlink, NULL);
+ } else if (s->eof) {
+ ff_outlink_set_status(outlink, AVERROR_EOF, s->eof_pts);
+ return 0;
+ }
+
FF_FILTER_FORWARD_WANTED(outlink, inlink);
return FFERROR_NOT_READY;

View File

@ -0,0 +1,19 @@
From 5f87a68cf70dafeab2fb89b42e41a4c29053b89b
From: Paul B Mahol <onemda@gmail.com>
Date: Mon Nov 27 12:08:20 2023 +0100
Subject: avfilter/vf_colorcorrect: fix memory leaks
References: https://bugzilla.opensuse.org/1223254
References: CVE-2023-50008
diff -Nura ffmpeg-5.1.4/libavfilter/vf_colorcorrect.c ffmpeg-5.1.4_new/libavfilter/vf_colorcorrect.c
--- ffmpeg-5.1.4/libavfilter/vf_colorcorrect.c 2023-11-10 07:38:51.000000000 +0800
+++ ffmpeg-5.1.4_new/libavfilter/vf_colorcorrect.c 2024-04-25 16:21:53.290363296 +0800
@@ -498,6 +498,8 @@
ColorCorrectContext *s = ctx->priv;
av_freep(&s->analyzeret);
+ av_freep(&s->uhistogram);
+ av_freep(&s->vhistogram);
}
static const AVFilterPad colorcorrect_inputs[] = {

View File

@ -0,0 +1,74 @@
commit c443658d26d2b8e19901f9507a890e0efca79056 (HEAD -> 20231222_CVE-2023-50009_c443658d26d2b8e19901f9507a890e0efca79056)
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Fri Dec 22 11:54:24 2023 +0100
References: CVE-2023-50009
References: https://bugzilla.opensuse.org/1172423
avfilter/edge_template: Fix small inputs with gaussian_blur()
Fixes: out of array access
Fixes: Ticket10699
Fixes: poc5ffmpeg
Found-by: Zeng Yunxiang
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
diff --git a/libavfilter/edge_template.c b/libavfilter/edge_template.c
index 14635c25af..ce45e579db 100644
--- a/libavfilter/edge_template.c
+++ b/libavfilter/edge_template.c
@@ -74,6 +74,7 @@ void fn(gaussian_blur)(int w, int h,
uint8_t *dst, int dst_linesize,
const uint8_t *src, int src_linesize, int src_stride)
{
+ int j;
pixel *srcp = (pixel *)src;
pixel *dstp = (pixel *)dst;
@@ -81,12 +82,17 @@ void fn(gaussian_blur)(int w, int h,
src_linesize /= sizeof(pixel);
dst_linesize /= sizeof(pixel);
- memcpy(dstp, srcp, w*sizeof(pixel)); dstp += dst_linesize; srcp += src_linesize;
- memcpy(dstp, srcp, w*sizeof(pixel)); dstp += dst_linesize; srcp += src_linesize;
- for (int j = 2; j < h - 2; j++) {
- dstp[0] = srcp[(0)*src_stride];
- dstp[1] = srcp[(1)*src_stride];
- for (int i = 2; i < w - 2; i++) {
+ for (j = 0; j < FFMIN(h, 2); j++) {
+ memcpy(dstp, srcp, w*sizeof(pixel));
+ dstp += dst_linesize;
+ srcp += src_linesize;
+ }
+
+ for (; j < h - 2; j++) {
+ int i;
+ for (i = 0; i < FFMIN(w, 2); i++)
+ dstp[i] = srcp[i*src_stride];
+ for (; i < w - 2; i++) {
/* Gaussian mask of size 5x5 with sigma = 1.4 */
dstp[i] = ((srcp[-2*src_linesize + (i-2)*src_stride] + srcp[2*src_linesize + (i-2)*src_stride]) * 2
+ (srcp[-2*src_linesize + (i-1)*src_stride] + srcp[2*src_linesize + (i-1)*src_stride]) * 4
@@ -106,12 +112,15 @@ void fn(gaussian_blur)(int w, int h,
+ srcp[(i+1)*src_stride] * 12
+ srcp[(i+2)*src_stride] * 5) / 159;
}
- dstp[w - 2] = srcp[(w - 2)*src_stride];
- dstp[w - 1] = srcp[(w - 1)*src_stride];
+ for (; i < w; i++)
+ dstp[i] = srcp[i*src_stride];
dstp += dst_linesize;
srcp += src_linesize;
}
- memcpy(dstp, srcp, w*sizeof(pixel)); dstp += dst_linesize; srcp += src_linesize;
- memcpy(dstp, srcp, w*sizeof(pixel));
+ for (; j < h; j++) {
+ memcpy(dstp, srcp, w*sizeof(pixel));
+ dstp += dst_linesize;
+ srcp += src_linesize;
+ }
}
--
2.41.0

View File

@ -0,0 +1,30 @@
commit e4d2666bdc3dbd177a81bbf428654a5f2fa3787a (20231224_CVE-2023-50010_e4d2666bdc3dbd177a81bbf428654a5f2fa3787a)
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Sun Dec 24 20:50:51 2023 +0100
References: CVE-2023-50009
References: https://bugzilla.opensuse.org/1172423
avfilter/vf_gradfun: Do not overread last line
The code works in steps of 2 lines and lacks support for odd height
Implementing odd height support is better but for now this fixes the
out of array access
Fixes: out of array access
Fixes: tickets/10702/poc6ffmpe
Found-by: Zeng Yunxiang
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
diff -Nura ffmpeg-5.1.4/libavfilter/vf_gradfun.c ffmpeg-5.1.4_new/libavfilter/vf_gradfun.c
--- ffmpeg-5.1.4/libavfilter/vf_gradfun.c 2023-11-10 07:38:51.000000000 +0800
+++ ffmpeg-5.1.4_new/libavfilter/vf_gradfun.c 2024-05-07 19:36:59.563277057 +0800
@@ -92,7 +92,7 @@
for (y = 0; y < r; y++)
ctx->blur_line(dc, buf + y * bstride, buf + (y - 1) * bstride, src + 2 * y * src_linesize, src_linesize, width / 2);
for (;;) {
- if (y < height - r) {
+ if (y + 1 < height - r) {
int mod = ((y + r) / 2) % r;
uint16_t *buf0 = buf + mod * bstride;
uint16_t *buf1 = buf + (mod ? mod - 1 : r - 1) * bstride;

View File

@ -0,0 +1,57 @@
From 0ecc1f0e48930723d7a467761b66850811c23e62
From: Michael Niedermayer <michael@niedermayer.cc>
Date: Fri Dec 22 12:31:35 2023 +0100
Subject: avfilter/vf_weave: Fix odd height handling
References: https://bugzilla.opensuse.org/1223272
References: CVE-2023-51793
Fixes: out of array access
Fixes: tickets/10743/poc10ffmpeg
Found-by: Zeng Yunxiang and Li Zeyuan
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
diff -Nura ffmpeg-5.1.4/libavfilter/vf_weave.c ffmpeg-5.1.4_new/libavfilter/vf_weave.c
--- ffmpeg-5.1.4/libavfilter/vf_weave.c 2023-11-10 07:38:51.000000000 +0800
+++ ffmpeg-5.1.4_new/libavfilter/vf_weave.c 2024-04-26 01:39:00.742700759 +0800
@@ -30,6 +30,7 @@
int double_weave;
int nb_planes;
int planeheight[4];
+ int outheight[4];
int linesize[4];
AVFrame *prev;
@@ -79,6 +80,9 @@
s->planeheight[1] = s->planeheight[2] = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
s->planeheight[0] = s->planeheight[3] = inlink->h;
+ s->outheight[1] = s->outheight[2] = AV_CEIL_RSHIFT(2*inlink->h, desc->log2_chroma_h);
+ s->outheight[0] = s->outheight[3] = 2*inlink->h;
+
s->nb_planes = av_pix_fmt_count_planes(inlink->format);
return 0;
@@ -104,19 +108,20 @@
const int height = s->planeheight[i];
const int start = (height * jobnr) / nb_jobs;
const int end = (height * (jobnr+1)) / nb_jobs;
+ const int compensation = 2*end > s->outheight[i];
av_image_copy_plane(out->data[i] + out->linesize[i] * field1 +
out->linesize[i] * start * 2,
out->linesize[i] * 2,
in->data[i] + start * in->linesize[i],
in->linesize[i],
- s->linesize[i], end - start);
+ s->linesize[i], end - start - compensation * field1);
av_image_copy_plane(out->data[i] + out->linesize[i] * field2 +
out->linesize[i] * start * 2,
out->linesize[i] * 2,
s->prev->data[i] + start * s->prev->linesize[i],
s->prev->linesize[i],
- s->linesize[i], end - start);
+ s->linesize[i], end - start - compensation * field2);
}
return 0;

View File

@ -0,0 +1,315 @@
commit cf1f57443158bcbe84a213e8dc631a302993f9a2
Author: Thilo Borgmann <thilo.borgmann@mail.de>
Date: Mon Jul 18 16:09:46 2022 +0200
References: CVE-2023-50009
References: https://bugzilla.opensuse.org/1172423
lavfi/edge_common: Templatify ff_gaussian_blur and ff_sobel
[Backport cf1f5744 from upstream, Templatify function ff_gaussian_blur
and ff_sobel to prepare fix support for CVE-2023-50009. -qzhao]
diff --git a/libavfilter/edge_common.c b/libavfilter/edge_common.c
index d72e8521cd..ebd47d7c53 100644
--- a/libavfilter/edge_common.c
+++ b/libavfilter/edge_common.c
@@ -46,33 +46,13 @@ static int get_rounded_direction(int gx, int gy)
return DIRECTION_VERTICAL;
}
-// Simple sobel operator to get rounded gradients
-void ff_sobel(int w, int h,
- uint16_t *dst, int dst_linesize,
- int8_t *dir, int dir_linesize,
- const uint8_t *src, int src_linesize)
-{
- int i, j;
-
- for (j = 1; j < h - 1; j++) {
- dst += dst_linesize;
- dir += dir_linesize;
- src += src_linesize;
- for (i = 1; i < w - 1; i++) {
- const int gx =
- -1*src[-src_linesize + i-1] + 1*src[-src_linesize + i+1]
- -2*src[ i-1] + 2*src[ i+1]
- -1*src[ src_linesize + i-1] + 1*src[ src_linesize + i+1];
- const int gy =
- -1*src[-src_linesize + i-1] + 1*src[ src_linesize + i-1]
- -2*src[-src_linesize + i ] + 2*src[ src_linesize + i ]
- -1*src[-src_linesize + i+1] + 1*src[ src_linesize + i+1];
+#undef DEPTH
+#define DEPTH 8
+#include "edge_template.c"
- dst[i] = FFABS(gx) + FFABS(gy);
- dir[i] = get_rounded_direction(gx, gy);
- }
- }
-}
+#undef DEPTH
+#define DEPTH 16
+#include "edge_template.c"
// Filters rounded gradients to drop all non-maxima
// Expects gradients generated by ff_sobel()
@@ -137,45 +117,3 @@ void ff_double_threshold(int low, int high, int w, int h,
src += src_linesize;
}
}
-
-// Applies gaussian blur, using 5x5 kernels, sigma = 1.4
-void ff_gaussian_blur(int w, int h,
- uint8_t *dst, int dst_linesize,
- const uint8_t *src, int src_linesize)
-{
- int i, j;
-
- memcpy(dst, src, w); dst += dst_linesize; src += src_linesize;
- memcpy(dst, src, w); dst += dst_linesize; src += src_linesize;
- for (j = 2; j < h - 2; j++) {
- dst[0] = src[0];
- dst[1] = src[1];
- for (i = 2; i < w - 2; i++) {
- /* Gaussian mask of size 5x5 with sigma = 1.4 */
- dst[i] = ((src[-2*src_linesize + i-2] + src[2*src_linesize + i-2]) * 2
- + (src[-2*src_linesize + i-1] + src[2*src_linesize + i-1]) * 4
- + (src[-2*src_linesize + i ] + src[2*src_linesize + i ]) * 5
- + (src[-2*src_linesize + i+1] + src[2*src_linesize + i+1]) * 4
- + (src[-2*src_linesize + i+2] + src[2*src_linesize + i+2]) * 2
-
- + (src[ -src_linesize + i-2] + src[ src_linesize + i-2]) * 4
- + (src[ -src_linesize + i-1] + src[ src_linesize + i-1]) * 9
- + (src[ -src_linesize + i ] + src[ src_linesize + i ]) * 12
- + (src[ -src_linesize + i+1] + src[ src_linesize + i+1]) * 9
- + (src[ -src_linesize + i+2] + src[ src_linesize + i+2]) * 4
-
- + src[i-2] * 5
- + src[i-1] * 12
- + src[i ] * 15
- + src[i+1] * 12
- + src[i+2] * 5) / 159;
- }
- dst[i ] = src[i ];
- dst[i + 1] = src[i + 1];
-
- dst += dst_linesize;
- src += src_linesize;
- }
- memcpy(dst, src, w); dst += dst_linesize; src += src_linesize;
- memcpy(dst, src, w);
-}
diff --git a/libavfilter/edge_common.h b/libavfilter/edge_common.h
index 87c143f2b8..cff4febd70 100644
--- a/libavfilter/edge_common.h
+++ b/libavfilter/edge_common.h
@@ -48,10 +48,14 @@ enum AVRoundedDirection {
* @param src data pointers to source image
* @param src_linesize linesizes for the source image
*/
-void ff_sobel(int w, int h,
- uint16_t *dst, int dst_linesize,
- int8_t *dir, int dir_linesize,
- const uint8_t *src, int src_linesize);
+#define PROTO_SOBEL(depth) \
+void ff_sobel_##depth(int w, int h, \
+ uint16_t *dst, int dst_linesize, \
+ int8_t *dir, int dir_linesize, \
+ const uint8_t *src, int src_linesize, int src_stride);
+
+PROTO_SOBEL(8)
+PROTO_SOBEL(16)
/**
* Filters rounded gradients to drop all non-maxima pixels in the magnitude image
@@ -100,8 +104,12 @@ void ff_double_threshold(int low, int high, int w, int h,
* @param src data pointers to source image
* @param src_linesize linesizes for the source image
*/
-void ff_gaussian_blur(int w, int h,
- uint8_t *dst, int dst_linesize,
- const uint8_t *src, int src_linesize);
+#define PROTO_GAUSSIAN_BLUR(depth) \
+void ff_gaussian_blur_##depth(int w, int h, \
+ uint8_t *dst, int dst_linesize, \
+ const uint8_t *src, int src_linesize, int src_stride);
+
+PROTO_GAUSSIAN_BLUR(8)
+PROTO_GAUSSIAN_BLUR(16)
#endif
diff --git a/libavfilter/edge_template.c b/libavfilter/edge_template.c
new file mode 100644
index 0000000000..af33c178af
--- /dev/null
+++ b/libavfilter/edge_template.c
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2022 Thilo Borgmann <thilo.borgmann _at_ mail.de>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ */
+
+#include "libavutil/avassert.h"
+#include "avfilter.h"
+#include "formats.h"
+#include "internal.h"
+#include "video.h"
+
+#undef pixel
+#if DEPTH == 8
+#define pixel uint8_t
+#else
+#define pixel uint16_t
+#endif
+
+#undef fn
+#undef fn2
+#undef fn3
+#define fn3(a,b) ff_##a##_##b
+#define fn2(a,b) fn3(a,b)
+#define fn(a) fn2(a, DEPTH)
+
+void fn(sobel)(int w, int h,
+ uint16_t *dst, int dst_linesize,
+ int8_t *dir, int dir_linesize,
+ const uint8_t *src, int src_linesize, int src_stride)
+{
+ pixel *srcp = (pixel *)src;
+
+ src_stride /= sizeof(pixel);
+ src_linesize /= sizeof(pixel);
+ dst_linesize /= sizeof(pixel);
+
+ for (int j = 1; j < h - 1; j++) {
+ dst += dst_linesize;
+ dir += dir_linesize;
+ srcp += src_linesize;
+ for (int i = 1; i < w - 1; i++) {
+ const int gx =
+ -1*srcp[-src_linesize + (i-1)*src_stride] + 1*srcp[-src_linesize + (i+1)*src_stride]
+ -2*srcp[ (i-1)*src_stride] + 2*srcp[ (i+1)*src_stride]
+ -1*srcp[ src_linesize + (i-1)*src_stride] + 1*srcp[ src_linesize + (i+1)*src_stride];
+ const int gy =
+ -1*srcp[-src_linesize + (i-1)*src_stride] + 1*srcp[ src_linesize + (i-1)*src_stride]
+ -2*srcp[-src_linesize + (i )*src_stride] + 2*srcp[ src_linesize + (i )*src_stride]
+ -1*srcp[-src_linesize + (i+1)*src_stride] + 1*srcp[ src_linesize + (i+1)*src_stride];
+
+ dst[i] = FFABS(gx) + FFABS(gy);
+ dir[i] = get_rounded_direction(gx, gy);
+ }
+ }
+}
+
+void fn(gaussian_blur)(int w, int h,
+ uint8_t *dst, int dst_linesize,
+ const uint8_t *src, int src_linesize, int src_stride)
+{
+ pixel *srcp = (pixel *)src;
+ pixel *dstp = (pixel *)dst;
+
+ src_stride /= sizeof(pixel);
+ src_linesize /= sizeof(pixel);
+ dst_linesize /= sizeof(pixel);
+
+ memcpy(dstp, srcp, w*sizeof(pixel)); dstp += dst_linesize; srcp += src_linesize;
+ memcpy(dstp, srcp, w*sizeof(pixel)); dstp += dst_linesize; srcp += src_linesize;
+ for (int j = 2; j < h - 2; j++) {
+ dstp[0] = srcp[(0)*src_stride];
+ dstp[1] = srcp[(1)*src_stride];
+ for (int i = 2; i < w - 2; i++) {
+ /* Gaussian mask of size 5x5 with sigma = 1.4 */
+ dstp[i] = ((srcp[-2*src_linesize + (i-2)*src_stride] + srcp[2*src_linesize + (i-2)*src_stride]) * 2
+ + (srcp[-2*src_linesize + (i-1)*src_stride] + srcp[2*src_linesize + (i-1)*src_stride]) * 4
+ + (srcp[-2*src_linesize + (i )*src_stride] + srcp[2*src_linesize + (i )*src_stride]) * 5
+ + (srcp[-2*src_linesize + (i+1)*src_stride] + srcp[2*src_linesize + (i+1)*src_stride]) * 4
+ + (srcp[-2*src_linesize + (i+2)*src_stride] + srcp[2*src_linesize + (i+2)*src_stride]) * 2
+
+ + (srcp[ -src_linesize + (i-2)*src_stride] + srcp[ src_linesize + (i-2)*src_stride]) * 4
+ + (srcp[ -src_linesize + (i-1)*src_stride] + srcp[ src_linesize + (i-1)*src_stride]) * 9
+ + (srcp[ -src_linesize + (i )*src_stride] + srcp[ src_linesize + (i )*src_stride]) * 12
+ + (srcp[ -src_linesize + (i+1)*src_stride] + srcp[ src_linesize + (i+1)*src_stride]) * 9
+ + (srcp[ -src_linesize + (i+2)*src_stride] + srcp[ src_linesize + (i+2)*src_stride]) * 4
+
+ + srcp[(i-2)*src_stride] * 5
+ + srcp[(i-1)*src_stride] * 12
+ + srcp[(i )*src_stride] * 15
+ + srcp[(i+1)*src_stride] * 12
+ + srcp[(i+2)*src_stride] * 5) / 159;
+ }
+ dstp[w - 2] = srcp[(w - 2)*src_stride];
+ dstp[w - 1] = srcp[(w - 1)*src_stride];
+
+ dstp += dst_linesize;
+ srcp += src_linesize;
+ }
+ memcpy(dstp, srcp, w*sizeof(pixel)); dstp += dst_linesize; srcp += src_linesize;
+ memcpy(dstp, srcp, w*sizeof(pixel));
+}
diff --git a/libavfilter/vf_blurdetect.c b/libavfilter/vf_blurdetect.c
index 0e08ba96de..db06efcce7 100644
--- a/libavfilter/vf_blurdetect.c
+++ b/libavfilter/vf_blurdetect.c
@@ -283,12 +283,12 @@ static int blurdetect_filter_frame(AVFilterLink *inlink, AVFrame *in)
nplanes++;
// gaussian filter to reduce noise
- ff_gaussian_blur(w, h,
- filterbuf, w,
- in->data[plane], in->linesize[plane]);
+ ff_gaussian_blur_8(w, h,
+ filterbuf, w,
+ in->data[plane], in->linesize[plane], 1);
// compute the 16-bits gradients and directions for the next step
- ff_sobel(w, h, gradients, w, directions, w, filterbuf, w);
+ ff_sobel_8(w, h, gradients, w, directions, w, filterbuf, w, 1);
// non_maximum_suppression() will actually keep & clip what's necessary and
// ignore the rest, so we need a clean output buffer
diff --git a/libavfilter/vf_edgedetect.c b/libavfilter/vf_edgedetect.c
index 90390ceb3e..603f06f141 100644
--- a/libavfilter/vf_edgedetect.c
+++ b/libavfilter/vf_edgedetect.c
@@ -191,15 +191,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
}
/* gaussian filter to reduce noise */
- ff_gaussian_blur(width, height,
- tmpbuf, width,
- in->data[p], in->linesize[p]);
+ ff_gaussian_blur_8(width, height,
+ tmpbuf, width,
+ in->data[p], in->linesize[p], 1);
/* compute the 16-bits gradients and directions for the next step */
- ff_sobel(width, height,
- gradients, width,
- directions,width,
- tmpbuf, width);
+ ff_sobel_8(width, height,
+ gradients, width,
+ directions,width,
+ tmpbuf, width, 1);
/* non_maximum_suppression() will actually keep & clip what's necessary and
* ignore the rest, so we need a clean output buffer */
--
2.41.0

17
ffmpeg-arm6l.diff Normal file
View File

@ -0,0 +1,17 @@
---
libavutil/arm/timer.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: ffmpeg-4.4.1/libavutil/arm/timer.h
===================================================================
--- ffmpeg-4.4.1.orig/libavutil/arm/timer.h
+++ ffmpeg-4.4.1/libavutil/arm/timer.h
@@ -30,7 +30,7 @@
#define AV_READ_TIME mach_absolute_time
-#elif HAVE_INLINE_ASM && defined(__ARM_ARCH_7A__)
+#elif HAVE_INLINE_ASM && defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_6ZK__)
#define AV_READ_TIME read_time

46
ffmpeg-chromium.patch Normal file
View File

@ -0,0 +1,46 @@
commit 95aab0fd83619408995720ce53d7a74790580220
author liberato@chromium.org <liberato@chromium.org> Thu Jul 08 02:01:22 2021
committer liberato@chromium.org <liberato@chromium.org> Thu Jul 08 02:01:22 2021
tree ac725b5e2c548c8142aa7096d8184d87d3876a49
parent e073b7a22e4993e0a7cab80a42a21524e5349f95
Add av_stream_get_first_dts for Chromium
---
libavformat/avformat.h | 4 ++++
libavformat/utils.c | 7 +++++++
2 files changed, 11 insertions(+)
Index: ffmpeg-5.1.3/libavformat/avformat.h
===================================================================
--- ffmpeg-5.1.3.orig/libavformat/avformat.h
+++ ffmpeg-5.1.3/libavformat/avformat.h
@@ -1128,6 +1128,10 @@ struct AVCodecParserContext *av_stream_g
*/
int64_t av_stream_get_end_pts(const AVStream *st);
+// Chromium: We use the internal field first_dts vvv
+int64_t av_stream_get_first_dts(const AVStream *st);
+// Chromium: We use the internal field first_dts ^^^
+
#define AV_PROGRAM_RUNNING 1
/**
Index: ffmpeg-5.1.3/libavformat/utils.c
===================================================================
--- ffmpeg-5.1.3.orig/libavformat/utils.c
+++ ffmpeg-5.1.3/libavformat/utils.c
@@ -55,6 +55,13 @@ int ff_unlock_avformat(void)
return ff_mutex_unlock(&avformat_mutex) ? -1 : 0;
}
+// Chromium: We use the internal field first_dts vvv
+int64_t av_stream_get_first_dts(const AVStream *st)
+{
+ return cffstream(st)->first_dts;
+}
+// Chromium: We use the internal field first_dts ^^^
+
/* an arbitrarily chosen "sane" max packet size -- 50M */
#define SANE_CHUNK_SIZE (50000000)

57
ffmpeg-codec-choice.diff Normal file
View File

@ -0,0 +1,57 @@
From: Jan Engelhardt <jengelh@inai.de>
Edit the default codec selection such that
ffmpeg -i youtube.blah.webm foobar.mkv
without any further arguments can produce a result even on a
reduced codec selection list.
---
libavformat/matroskaenc.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
Index: ffmpeg-5.1.3/libavformat/matroskaenc.c
===================================================================
--- ffmpeg-5.1.3.orig/libavformat/matroskaenc.c
+++ ffmpeg-5.1.3/libavformat/matroskaenc.c
@@ -3316,16 +3316,25 @@ static int mkv_query_codec(enum AVCodecI
return 0;
}
+#define PREFAUDIO \
+ CONFIG_LIBOPUS_ENCODER ? AV_CODEC_ID_OPUS : \
+ CONFIG_AAC_ENCODER ? AV_CODEC_ID_AAC : \
+ CONFIG_VORBIS_ENCODER ? AV_CODEC_ID_VORBIS : \
+ AV_CODEC_ID_AC3
+
const AVOutputFormat ff_matroska_muxer = {
.name = "matroska",
.long_name = NULL_IF_CONFIG_SMALL("Matroska"),
.mime_type = "video/x-matroska",
.extensions = "mkv",
.priv_data_size = sizeof(MatroskaMuxContext),
- .audio_codec = CONFIG_LIBVORBIS_ENCODER ?
- AV_CODEC_ID_VORBIS : AV_CODEC_ID_AC3,
- .video_codec = CONFIG_LIBX264_ENCODER ?
- AV_CODEC_ID_H264 : AV_CODEC_ID_MPEG4,
+ .audio_codec = PREFAUDIO,
+ .video_codec =
+ CONFIG_LIBVPX_VP9_ENCODER ? AV_CODEC_ID_VP9 : \
+ CONFIG_LIBX264_ENCODER ? AV_CODEC_ID_H264 : \
+ CONFIG_LIBVPX_VP8_ENCODER ? AV_CODEC_ID_VP8 : \
+ CONFIG_MPEG4_ENCODER ? AV_CODEC_ID_MPEG4 : \
+ AV_CODEC_ID_THEORA,
.init = mkv_init,
.deinit = mkv_deinit,
.write_header = mkv_write_header,
@@ -3383,8 +3392,7 @@ const AVOutputFormat ff_matroska_audio_m
.mime_type = "audio/x-matroska",
.extensions = "mka",
.priv_data_size = sizeof(MatroskaMuxContext),
- .audio_codec = CONFIG_LIBVORBIS_ENCODER ?
- AV_CODEC_ID_VORBIS : AV_CODEC_ID_AC3,
+ .audio_codec = PREFAUDIO,
.video_codec = AV_CODEC_ID_NONE,
.init = mkv_init,
.deinit = mkv_deinit,

BIN
ffmpeg-dlopen-headers.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,378 @@
From 4739b0c97b3378bdaf737171777fe9a71a53eff1 Mon Sep 17 00:00:00 2001
From: Neal Gompa <ngompa@fedoraproject.org>
Date: Wed, 12 Oct 2022 09:41:27 -0400
Subject: [PATCH] avcodec/openh264: Add the ability to dlopen() OpenH264
We can't directly depend on OpenH264, but we can weakly link to it
and gracefully expose the capability.
Co-authored-by: Andreas Schneider <asn@cryptomilk.org>
Co-authored-by: Neal Gompa <ngompa@fedoraproject.org>
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Signed-off-by: Neal Gompa <ngompa@fedoraproject.org>
---
configure | 3 +
libavcodec/Makefile | 1 +
libavcodec/libopenh264.c | 18 +++-
libavcodec/libopenh264_dlopen.c | 147 ++++++++++++++++++++++++++++++++
libavcodec/libopenh264_dlopen.h | 58 +++++++++++++
libavcodec/libopenh264dec.c | 10 +++
libavcodec/libopenh264enc.c | 10 +++
7 files changed, 245 insertions(+), 2 deletions(-)
create mode 100644 libavcodec/libopenh264_dlopen.c
create mode 100644 libavcodec/libopenh264_dlopen.h
Index: ffmpeg-5.1.3/configure
===================================================================
--- ffmpeg-5.1.3.orig/configure
+++ ffmpeg-5.1.3/configure
@@ -252,6 +252,7 @@ External library support:
--enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
--enable-libopencv enable video filtering via libopencv [no]
--enable-libopenh264 enable H.264 encoding via OpenH264 [no]
+ --enable-libopenh264-dlopen enable H.264 encoding via dlopen()'ed OpenH264 [no]
--enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no]
--enable-libopenmpt enable decoding tracked files via libopenmpt [no]
--enable-libopenvino enable OpenVINO as a DNN module backend
@@ -1846,6 +1847,7 @@ EXTERNAL_LIBRARY_LIST="
libmysofa
libopencv
libopenh264
+ libopenh264_dlopen
libopenjpeg
libopenmpt
libopenvino
@@ -6599,6 +6601,7 @@ enabled libopencv && { check_hea
require libopencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
require_pkg_config libopencv opencv opencv/cxcore.h cvCreateImageHeader; }
enabled libopenh264 && require_pkg_config libopenh264 openh264 wels/codec_api.h WelsGetCodecVersion
+enabled libopenh264_dlopen && enable libopenh264 && add_cppflags "-I$(dirname `readlink -f $0`)/ffdlopenhdrs/include -DCONFIG_LIBOPENH264_DLOPEN=1"
enabled libopenjpeg && { check_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version ||
{ require_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } }
enabled libopenmpt && require_pkg_config libopenmpt "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create -lstdc++ && append libopenmpt_extralibs "-lstdc++"
Index: ffmpeg-5.1.3/libavcodec/Makefile
===================================================================
--- ffmpeg-5.1.3.orig/libavcodec/Makefile
+++ ffmpeg-5.1.3/libavcodec/Makefile
@@ -1075,6 +1075,7 @@ OBJS-$(CONFIG_LIBMP3LAME_ENCODER)
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_DECODER) += libopencore-amr.o
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_ENCODER) += libopencore-amr.o
OBJS-$(CONFIG_LIBOPENCORE_AMRWB_DECODER) += libopencore-amr.o
+OBJS-$(CONFIG_LIBOPENH264_DLOPEN) += libopenh264_dlopen.o
OBJS-$(CONFIG_LIBOPENH264_DECODER) += libopenh264dec.o libopenh264.o
OBJS-$(CONFIG_LIBOPENH264_ENCODER) += libopenh264enc.o libopenh264.o
OBJS-$(CONFIG_LIBOPENJPEG_DECODER) += libopenjpegdec.o
Index: ffmpeg-5.1.3/libavcodec/libopenh264.c
===================================================================
--- ffmpeg-5.1.3.orig/libavcodec/libopenh264.c
+++ ffmpeg-5.1.3/libavcodec/libopenh264.c
@@ -20,8 +20,13 @@
*/
#include <string.h>
+
+#ifdef CONFIG_LIBOPENH264_DLOPEN
+#include "libopenh264_dlopen.h"
+#else
#include <wels/codec_api.h>
#include <wels/codec_ver.h>
+#endif
#include "libavutil/error.h"
#include "libavutil/log.h"
@@ -52,8 +57,17 @@ int ff_libopenh264_check_version(void *l
// Mingw GCC < 4.7 on x86_32 uses an incorrect/buggy ABI for the WelsGetCodecVersion
// function (for functions returning larger structs), thus skip the check in those
// configurations.
-#if !defined(_WIN32) || !defined(__GNUC__) || !ARCH_X86_32 || AV_GCC_VERSION_AT_LEAST(4, 7)
- OpenH264Version libver = WelsGetCodecVersion();
+ // Also, for dlopened OpenH264, we should not do the version check. It's too punitive.
+#if !defined(_WIN32) || !defined(__GNUC__) || !ARCH_X86_32 || AV_GCC_VERSION_AT_LEAST(4, 7) || !defined(CONFIG_LIBOPENH264_DLOPEN)
+ OpenH264Version libver;
+
+#ifdef CONFIG_LIBOPENH264_DLOPEN
+ if (loadLibOpenH264(logctx)) {
+ return AVERROR_EXTERNAL;
+ }
+#endif
+
+ libver = WelsGetCodecVersion();
if (memcmp(&libver, &g_stCodecVersion, sizeof(libver))) {
av_log(logctx, AV_LOG_ERROR, "Incorrect library version loaded\n");
return AVERROR(EINVAL);
Index: ffmpeg-5.1.3/libavcodec/libopenh264_dlopen.c
===================================================================
--- /dev/null
+++ ffmpeg-5.1.3/libavcodec/libopenh264_dlopen.c
@@ -0,0 +1,147 @@
+/*
+ * OpenH264 dlopen code
+ *
+ * Copyright (C) 2022 Andreas Schneider <asn@cryptomilk.org>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <dlfcn.h>
+
+#include "libopenh264_dlopen.h"
+
+/*
+ * The symbol binding makes sure we do not run into strict aliasing issues which
+ * can lead into segfaults.
+ */
+typedef int (*__oh264_WelsCreateSVCEncoder)(ISVCEncoder **);
+typedef void (*__oh264_WelsDestroySVCEncoder)(ISVCEncoder *);
+typedef int (*__oh264_WelsGetDecoderCapability)(SDecoderCapability *);
+typedef long (*__oh264_WelsCreateDecoder)(ISVCDecoder **);
+typedef void (*__oh264_WelsDestroyDecoder)(ISVCDecoder *);
+typedef OpenH264Version (*__oh264_WelsGetCodecVersion)(void);
+typedef void (*__oh264_WelsGetCodecVersionEx)(OpenH264Version *);
+
+#define OH264_SYMBOL_ENTRY(i) \
+ union { \
+ __oh264_##i f; \
+ void *obj; \
+ } _oh264_##i
+
+struct oh264_symbols {
+ OH264_SYMBOL_ENTRY(WelsCreateSVCEncoder);
+ OH264_SYMBOL_ENTRY(WelsDestroySVCEncoder);
+ OH264_SYMBOL_ENTRY(WelsGetDecoderCapability);
+ OH264_SYMBOL_ENTRY(WelsCreateDecoder);
+ OH264_SYMBOL_ENTRY(WelsDestroyDecoder);
+ OH264_SYMBOL_ENTRY(WelsGetCodecVersion);
+ OH264_SYMBOL_ENTRY(WelsGetCodecVersionEx);
+};
+
+/* Symbols are bound by loadLibOpenH264() */
+static struct oh264_symbols openh264_symbols;
+
+int oh264_WelsCreateSVCEncoder(ISVCEncoder **ppEncoder) {
+ return openh264_symbols._oh264_WelsCreateSVCEncoder.f(ppEncoder);
+}
+
+void oh264_WelsDestroySVCEncoder(ISVCEncoder *pEncoder) {
+ return openh264_symbols._oh264_WelsDestroySVCEncoder.f(pEncoder);
+}
+
+int oh264_WelsGetDecoderCapability(SDecoderCapability *pDecCapability) {
+ return openh264_symbols._oh264_WelsGetDecoderCapability.f(pDecCapability);
+}
+
+long oh264_WelsCreateDecoder(ISVCDecoder **ppDecoder) {
+ return openh264_symbols._oh264_WelsCreateDecoder.f(ppDecoder);
+}
+
+void oh264_WelsDestroyDecoder(ISVCDecoder *pDecoder) {
+ return openh264_symbols._oh264_WelsDestroyDecoder.f(pDecoder);
+}
+
+OpenH264Version oh264_WelsGetCodecVersion(void) {
+ return openh264_symbols._oh264_WelsGetCodecVersion.f();
+}
+
+void oh264_WelsGetCodecVersionEx(OpenH264Version *pVersion) {
+ openh264_symbols._oh264_WelsGetCodecVersionEx.f(pVersion);
+}
+
+static void *_oh264_bind_symbol(AVCodecContext *avctx,
+ void *handle,
+ const char *sym_name) {
+ void *sym = NULL;
+
+ sym = dlsym(handle, sym_name);
+ if (sym == NULL) {
+ const char *err = dlerror();
+ av_log(avctx,
+ AV_LOG_WARNING,
+ "%s: Failed to bind %s\n",
+ err,
+ sym_name);
+ return NULL;
+ }
+
+ return sym;
+}
+
+#define oh264_bind_symbol(avctx, handle, sym_name) \
+ if (openh264_symbols._oh264_##sym_name.obj == NULL) { \
+ openh264_symbols._oh264_##sym_name.obj = _oh264_bind_symbol(avctx, handle, #sym_name); \
+ if (openh264_symbols._oh264_##sym_name.obj == NULL) { \
+ return 1; \
+ } \
+ }
+
+int loadLibOpenH264(AVCodecContext *avctx) {
+ static bool initialized = false;
+ void *libopenh264 = NULL;
+ const char *err = NULL;
+
+ if (initialized) {
+ return 0;
+ }
+
+#define OPENH264_LIB "libopenh264.so.7"
+ libopenh264 = dlopen(OPENH264_LIB, RTLD_LAZY);
+ err = dlerror();
+ if (err != NULL) {
+ av_log(avctx, AV_LOG_WARNING,
+ "%s: %s is missing, openh264 support will be disabled\n", err,
+ OPENH264_LIB);
+
+ if (libopenh264 != NULL) {
+ dlclose(libopenh264);
+ }
+ return 1;
+ }
+
+ oh264_bind_symbol(avctx, libopenh264, WelsCreateSVCEncoder);
+ oh264_bind_symbol(avctx, libopenh264, WelsDestroySVCEncoder);
+ oh264_bind_symbol(avctx, libopenh264, WelsGetDecoderCapability);
+ oh264_bind_symbol(avctx, libopenh264, WelsCreateDecoder);
+ oh264_bind_symbol(avctx, libopenh264, WelsDestroyDecoder);
+ oh264_bind_symbol(avctx, libopenh264, WelsGetCodecVersion);
+ oh264_bind_symbol(avctx, libopenh264, WelsGetCodecVersionEx);
+
+ initialized = true;
+
+ return 0;
+}
Index: ffmpeg-5.1.3/libavcodec/libopenh264_dlopen.h
===================================================================
--- /dev/null
+++ ffmpeg-5.1.3/libavcodec/libopenh264_dlopen.h
@@ -0,0 +1,58 @@
+/*
+ * OpenH264 dlopen code
+ *
+ * Copyright (C) 2022 Andreas Schneider <asn@cryptomilk.org>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef HAVE_LIBOPENH264_DLOPEN_H
+#define HAVE_LIBOPENH264_DLOPEN_H
+
+#ifdef CONFIG_LIBOPENH264_DLOPEN
+
+#include <wels/codec_api.h>
+#include <wels/codec_ver.h>
+
+#include "avcodec.h"
+
+int oh264_WelsCreateSVCEncoder(ISVCEncoder **ppEncoder);
+#define WelsCreateSVCEncoder oh264_WelsCreateSVCEncoder
+
+void oh264_WelsDestroySVCEncoder(ISVCEncoder *pEncoder);
+#define WelsDestroySVCEncoder oh264_WelsDestroySVCEncoder
+
+int oh264_WelsGetDecoderCapability(SDecoderCapability *pDecCapability);
+#define WelsGetDecoderCapability oh264_WelsGetDecoderCapability
+
+long oh264_WelsCreateDecoder(ISVCDecoder **ppDecoder);
+#define WelsCreateDecoder oh264_WelsCreateDecoder
+
+void oh264_WelsDestroyDecoder(ISVCDecoder *pDecoder);
+#define WelsDestroyDecoder oh264_WelsDestroyDecoder
+
+OpenH264Version oh264_WelsGetCodecVersion(void);
+#define WelsGetCodecVersion oh264_WelsGetCodecVersion
+
+void oh264_WelsGetCodecVersionEx(OpenH264Version *pVersion);
+#define WelsGetCodecVersionEx oh264_WelsGetCodecVersionEx
+
+int loadLibOpenH264(AVCodecContext *avctx);
+
+#endif /* CONFIG_LIBOPENH264_DLOPEN */
+
+#endif /* HAVE_LIBOPENH264_DLOPEN_H */
Index: ffmpeg-5.1.3/libavcodec/libopenh264dec.c
===================================================================
--- ffmpeg-5.1.3.orig/libavcodec/libopenh264dec.c
+++ ffmpeg-5.1.3/libavcodec/libopenh264dec.c
@@ -19,8 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef CONFIG_LIBOPENH264_DLOPEN
+#include "libopenh264_dlopen.h"
+#else
#include <wels/codec_api.h>
#include <wels/codec_ver.h>
+#endif
#include "libavutil/common.h"
#include "libavutil/fifo.h"
@@ -56,6 +60,12 @@ static av_cold int svc_decode_init(AVCod
int log_level;
WelsTraceCallback callback_function;
+#ifdef CONFIG_LIBOPENH264_DLOPEN
+ if (loadLibOpenH264(avctx)) {
+ return AVERROR_DECODER_NOT_FOUND;
+ }
+#endif
+
if ((err = ff_libopenh264_check_version(avctx)) < 0)
return AVERROR_DECODER_NOT_FOUND;
Index: ffmpeg-5.1.3/libavcodec/libopenh264enc.c
===================================================================
--- ffmpeg-5.1.3.orig/libavcodec/libopenh264enc.c
+++ ffmpeg-5.1.3/libavcodec/libopenh264enc.c
@@ -19,8 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef CONFIG_LIBOPENH264_DLOPEN
+#include "libopenh264_dlopen.h"
+#else
#include <wels/codec_api.h>
#include <wels/codec_ver.h>
+#endif
#include "libavutil/attributes.h"
#include "libavutil/common.h"
@@ -137,6 +141,12 @@ static av_cold int svc_encode_init(AVCod
WelsTraceCallback callback_function;
AVCPBProperties *props;
+#ifdef CONFIG_LIBOPENH264_DLOPEN
+ if (loadLibOpenH264(avctx)) {
+ return AVERROR_ENCODER_NOT_FOUND;
+ }
+#endif
+
if ((err = ff_libopenh264_check_version(avctx)) < 0)
return AVERROR_ENCODER_NOT_FOUND;

View File

@ -0,0 +1,60 @@
From: Jan Engelhardt <jengelh@inai.de>
Date: 2016-04-10 23:23:53.138440254 +0200
Improve the error messages a bit to say what's really going on
(in light of openSUSE's reduced build).
---
fftools/ffmpeg.c | 2 +-
fftools/ffmpeg_filter.c | 4 ++--
fftools/ffmpeg_opt.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
Index: ffmpeg-5.1.3/fftools/ffmpeg.c
===================================================================
--- ffmpeg-5.1.3.orig/fftools/ffmpeg.c
+++ ffmpeg-5.1.3/fftools/ffmpeg.c
@@ -2606,7 +2606,7 @@ static int init_input_stream(int ist_ind
if (ist->decoding_needed) {
const AVCodec *codec = ist->dec;
if (!codec) {
- snprintf(error, error_len, "Decoder (codec %s) not found for input stream #%d:%d",
+ snprintf(error, error_len, "This build of ffmpeg does not include a \"%s\" decoder needed for input stream #%d:%d.",
avcodec_get_name(ist->dec_ctx->codec_id), ist->file_index, ist->st->index);
return AVERROR(EINVAL);
}
Index: ffmpeg-5.1.3/fftools/ffmpeg_filter.c
===================================================================
--- ffmpeg-5.1.3.orig/fftools/ffmpeg_filter.c
+++ ffmpeg-5.1.3/fftools/ffmpeg_filter.c
@@ -945,7 +945,7 @@ static int configure_input_filter(Filter
{
if (!ifilter->ist->dec) {
av_log(NULL, AV_LOG_ERROR,
- "No decoder for stream #%d:%d, filtering impossible\n",
+ "This build of ffmpeg does not have a suitable decoder for stream #%d:%d enabled, filtering impossible\n",
ifilter->ist->file_index, ifilter->ist->st->index);
return AVERROR_DECODER_NOT_FOUND;
}
@@ -1117,7 +1117,7 @@ int configure_filtergraph(FilterGraph *f
if (!ost->enc) {
/* identical to the same check in ffmpeg.c, needed because
complex filter graphs are initialized earlier */
- av_log(NULL, AV_LOG_ERROR, "Encoder (codec %s) not found for output stream #%d:%d\n",
+ av_log(NULL, AV_LOG_ERROR, "This build of ffmpeg does not include a \"%s\" encoder needed for output stream #%d:%d.\n",
avcodec_get_name(ost->st->codecpar->codec_id), ost->file_index, ost->index);
ret = AVERROR(EINVAL);
goto fail;
Index: ffmpeg-5.1.3/fftools/ffmpeg_opt.c
===================================================================
--- ffmpeg-5.1.3.orig/fftools/ffmpeg_opt.c
+++ ffmpeg-5.1.3/fftools/ffmpeg_opt.c
@@ -1497,7 +1497,7 @@ static int choose_encoder(OptionsContext
if (!ost->enc) {
av_log(NULL, AV_LOG_FATAL, "Automatic encoder selection failed for "
"output stream #%d:%d. Default encoder for format %s (codec %s) is "
- "probably disabled. Please choose an encoder manually.\n",
+ "probably disabled or this build of ffmpeg does not include that codec. Please choose an encoder manually.\n",
ost->file_index, ost->index, s->oformat->name,
avcodec_get_name(ost->st->codecpar->codec_id));
return AVERROR_ENCODER_NOT_FOUND;

View File

@ -0,0 +1,42 @@
#!/bin/bash
# Script to grab headers from existing packages to support dlopen() codec libraries
# Requires: bash, coreutils, curl, bsdtar, dnf, dnf-plugins-core, tar, xz
# Author: Neal Gompa <ngompa@fedoraproject.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
echo "Setting up..."
# Get local directory
LOCALDIR=$(realpath $(dirname $0))
# Create working area
TMPDIR=$(mktemp -d /tmp/mmheadersXXXXXX)
mkdir -pv $TMPDIR
echo "Fetching headers..."
# Get OpenH264 headers
OPENH264_DEVEL=$(dnf -q download --url 'pkgconfig(openh264)')
curl -L $OPENH264_DEVEL | bsdtar -xvf - --include "./usr/include/*" -C $TMPDIR
echo "Generating tarball..."
# Prep tarball tree
mv -v ${TMPDIR}/usr ${TMPDIR}/ffdlopenhdrs
# Generate tarball
tar --transform "s|^${TMPDIR#?}/||" -cJvf ${LOCALDIR}/ffmpeg-dlopen-headers.tar.xz ${TMPDIR}/ffdlopenhdrs
# Clean up
echo "Cleaning up..."
rm -rfv ${TMPDIR}
echo "Tarball created: ${LOCALDIR}/ffmpeg-dlopen-headers.tar.xz"

23
soname.diff Normal file
View File

@ -0,0 +1,23 @@
From: Jan Engelhardt <jengelh@inai.de>
Date: 2023-03-13 12:53:21.732953738 +0100
Move libswresample.so.4 out the way for the benefit of ffmpeg-6
which provides the same library.
---
ffbuild/library.mak | 3 +++
1 file changed, 3 insertions(+)
Index: ffmpeg-5.1.2/ffbuild/library.mak
===================================================================
--- ffmpeg-5.1.2.orig/ffbuild/library.mak
+++ ffmpeg-5.1.2/ffbuild/library.mak
@@ -6,6 +6,9 @@ endif
LIBVERSION := $(lib$(NAME)_VERSION)
LIBMAJOR := $(lib$(NAME)_VERSION_MAJOR)
+ifeq ($(NAME),swresample)
+LIBMAJOR := $(LIBMAJOR).ff5
+endif
LIBMINOR := $(lib$(NAME)_VERSION_MINOR)
INCINSTDIR := $(INCDIR)/lib$(NAME)

View File

@ -0,0 +1,52 @@
From: Jan Engelhardt <jengelh@inai.de>
Date: 2020-07-04 23:56:54.411950316 +0200
References: http://ffmpeg.org/pipermail/ffmpeg-devel/2020-July/265694.html
User frispete wrote on 2020-6-26 22:13+0000 at
https://build.opensuse.org/package/show/multimedia:libs/ffmpeg-4#comment-1257440
: """Unfortunately, this version is binary incompatible to 4.2.3 in some
aspects. [...]"""
Further discussion on the mailing list explored this topic, and
revealed that ELF symbol versioning is lacklusterly implemented in
ffmpeg, which can cause inadvertent mixing of library versions on
openSUSE, and precompiled Linux distributions in general.
Upstream says "we only add new functions" - which is ok in its own
right. verdefs, if you have them, *must*not* change under any
circumstances, but that is what they broke: the set of symbols
included in the "LIBAVFORMAT_59" verdef changed between 5.0 and 5.1.
$ abidiff abidiff /usr/lib64/libavformat.so.59.16.100 usr/lib64/libavformat.so.59.27.100
Functions changes summary: 0 Removed, 0 Changed, 0 Added function
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
Function symbols changes summary: 0 Removed, 1 Added function symbol not referenced by debug info
Variable symbols changes summary: 0 Removed, 0 Added variable symbol not referenced by debug info
1 Added function symbol not referenced by debug info:
[A] avio_vprintf@@LIBAVFORMAT_59
]
Henceforth, we're changing the .v files such that the symbol set in
any one verdef we will ever emit is never modified in future
releases.
---
ffbuild/library.mak | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: ffmpeg-5.1/ffbuild/library.mak
===================================================================
--- ffmpeg-5.1.orig/ffbuild/library.mak
+++ ffmpeg-5.1/ffbuild/library.mak
@@ -59,7 +59,7 @@ $(SUBDIR)lib$(FULLNAME).pc: $(SUBDIR)ver
$$(M) $$(SRC_PATH)/ffbuild/pkgconfig_generate.sh $(NAME) "$(DESC)"
$(SUBDIR)lib$(NAME).ver: $(SUBDIR)lib$(NAME).v $(OBJS)
- $$(M)sed 's/MAJOR/$(lib$(NAME)_VERSION_MAJOR)/' $$< | $(VERSION_SCRIPT_POSTPROCESS_CMD) > $$@
+ $$(M)sed 's/MAJOR/$(lib$(NAME)_VERSION_MAJOR).$(lib$(NAME)_VERSION_MINOR)_SUSE/' $$< | $(VERSION_SCRIPT_POSTPROCESS_CMD) > $$@
$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
$(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)