Compare commits
83 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62079f0ff3 | ||
|
|
081db52026 | ||
|
|
2cb206c8d5 | ||
|
|
2364ea43f4 | ||
|
|
333dc69736 | ||
|
|
28d758506e | ||
|
|
85d2ac244e | ||
|
|
2db297209f | ||
|
|
7a2902320d | ||
|
|
74bed5df5b | ||
|
|
98124ea009 | ||
|
|
ee4847dda6 | ||
|
|
85181b0920 | ||
|
|
5917b714a1 | ||
|
|
0ba015fad8 | ||
|
|
7396d13cc7 | ||
|
|
0b12983802 | ||
|
|
fab40474b5 | ||
|
|
3c0fb7f11f | ||
|
|
9e25239d79 | ||
|
|
60df3956c6 | ||
|
|
b7a44a0015 | ||
|
|
0d0e82fef2 | ||
|
|
d3e50323a8 | ||
|
|
3dcc47c45b |
||
|
|
4d830a4af8 | ||
|
|
7110fb70e3 | ||
|
|
d2ef10fe0c | ||
|
|
f7cd6c7740 | ||
|
|
54e4bc559d | ||
|
|
e02f9b32c2 | ||
|
|
132d2896b6 | ||
|
|
21b854f6b9 |
||
|
|
14a94115d0 | ||
|
|
cd3c894a26 | ||
|
|
c17bd62a32 | ||
|
|
4084c1116b | ||
|
|
aa1f2113d7 | ||
|
|
b209e71d90 | ||
|
|
8da9f7adde | ||
|
|
24d8902d75 | ||
|
|
d4e890a117 | ||
|
|
a38892833e | ||
|
|
7dc95097f1 | ||
|
|
4fbec760e3 | ||
|
|
9a1dccdbf1 | ||
|
|
0c021328ba | ||
|
|
2612e2ec91 |
||
|
|
69d06fe675 | ||
|
|
805473621e | ||
|
|
51db0dbaf0 | ||
|
|
0179ea0006 | ||
|
|
fe4d7dd258 | ||
|
|
55ef1c245c | ||
|
|
175f57600b | ||
|
|
16078d1d91 | ||
|
|
16bba3567b | ||
|
|
db2acb3681 | ||
|
|
324d6a3037 | ||
|
|
a4fcaad3a2 | ||
|
|
46131eefb0 | ||
|
|
45f69ccd8a | ||
|
|
774d42a007 | ||
|
|
67cc0fa210 | ||
|
|
b58631f030 | ||
|
|
1a68b30970 | ||
|
|
5b76b46070 | ||
|
|
2fe1d67c6d | ||
|
|
bea10e455b | ||
|
|
e4f0babc79 |
||
|
|
b05e4ff557 | ||
|
|
f3982b50da | ||
|
|
37bbe8c93a | ||
|
|
e691a74e2b | ||
|
|
9f0ba814c4 | ||
|
|
cc897ea5ca | ||
|
|
b3cfba90d4 | ||
|
|
d30a3b67b3 | ||
|
|
853aa9d7cf | ||
|
|
8be4d0455d | ||
|
|
0bad397a42 | ||
|
|
60f694e267 | ||
|
|
9bc65b1ebf |
17 changed files with 741 additions and 5120 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -2,3 +2,5 @@ ffmpeg-*.asc
|
|||
ffmpeg-*.rpm
|
||||
ffmpeg-*.tar.xz
|
||||
/ffmpeg.keyring
|
||||
/results_*
|
||||
/*.rpm
|
||||
|
|
|
|||
|
|
@ -1,73 +0,0 @@
|
|||
From 1231003c3c6d4839a9e838d06f8e16ee7690958f Mon Sep 17 00:00:00 2001
|
||||
From: Niklas Haas <git@haasn.dev>
|
||||
Date: Mon, 13 Mar 2023 14:33:16 +0100
|
||||
Subject: [PATCH] avfilter/vf_libplacebo: remove deprecated field
|
||||
|
||||
This has not been functional since a year ago, including in our current
|
||||
minimum dependency of libplacebo (v4.192.0). It also causes build errors
|
||||
against libplacebo v6, so it needs to be removed from the code. We can
|
||||
keep the option around for now, but it should also be removed soon.
|
||||
|
||||
Signed-off-by: Niklas Haas <git@haasn.dev>
|
||||
Signed-off-by: James Almer <jamrial@gmail.com>
|
||||
---
|
||||
doc/filters.texi | 3 ---
|
||||
libavfilter/vf_libplacebo.c | 7 ++++---
|
||||
2 files changed, 4 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/doc/filters.texi b/doc/filters.texi
|
||||
index 7a7b2ba4e79e..77b594f69cb1 100644
|
||||
--- a/doc/filters.texi
|
||||
+++ b/doc/filters.texi
|
||||
@@ -16242,9 +16242,6 @@ Disable linear light scaling.
|
||||
@item disable_builtin
|
||||
Disable built-in GPU sampling (forces LUT).
|
||||
|
||||
-@item force_icc_lut
|
||||
-Force the use of a full ICC 3DLUT for gamut mapping.
|
||||
-
|
||||
@item disable_fbos
|
||||
Forcibly disable FBOs, resulting in loss of almost all functionality, but
|
||||
offering the maximum possible speed.
|
||||
diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c
|
||||
index d75723289069..757dc519e9ad 100644
|
||||
--- a/libavfilter/vf_libplacebo.c
|
||||
+++ b/libavfilter/vf_libplacebo.c
|
||||
@@ -97,7 +97,6 @@ typedef struct LibplaceboContext {
|
||||
float polar_cutoff;
|
||||
int disable_linear;
|
||||
int disable_builtin;
|
||||
- int force_icc_lut;
|
||||
int force_dither;
|
||||
int disable_fbos;
|
||||
|
||||
@@ -139,6 +138,7 @@ typedef struct LibplaceboContext {
|
||||
float desat_exp;
|
||||
int gamut_warning;
|
||||
int gamut_clipping;
|
||||
+ int force_icc_lut;
|
||||
#endif
|
||||
|
||||
/* pl_dither_params */
|
||||
@@ -463,7 +463,6 @@ static int process_frames(AVFilterContext *avctx, AVFrame *out, AVFrame *in)
|
||||
.polar_cutoff = s->polar_cutoff,
|
||||
.disable_linear_scaling = s->disable_linear,
|
||||
.disable_builtin_scalers = s->disable_builtin,
|
||||
- .force_icc_lut = s->force_icc_lut,
|
||||
.force_dither = s->force_dither,
|
||||
.disable_fbos = s->disable_fbos,
|
||||
};
|
||||
@@ -855,7 +854,9 @@ static const AVOption libplacebo_options[] = {
|
||||
{ "polar_cutoff", "Polar LUT cutoff", OFFSET(polar_cutoff), AV_OPT_TYPE_FLOAT, {.dbl = 0}, 0.0, 1.0, DYNAMIC },
|
||||
{ "disable_linear", "Disable linear scaling", OFFSET(disable_linear), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC },
|
||||
{ "disable_builtin", "Disable built-in scalers", OFFSET(disable_builtin), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC },
|
||||
- { "force_icc_lut", "Force the use of a full ICC 3DLUT for color mapping", OFFSET(force_icc_lut), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC },
|
||||
+#if FF_API_LIBPLACEBO_OPTS
|
||||
+ { "force_icc_lut", "Deprecated, does nothing", OFFSET(force_icc_lut), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC | AV_OPT_FLAG_DEPRECATED },
|
||||
+#endif
|
||||
{ "force_dither", "Force dithering", OFFSET(force_dither), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC },
|
||||
{ "disable_fbos", "Force-disable FBOs", OFFSET(disable_fbos), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC },
|
||||
{ NULL },
|
||||
--
|
||||
2.39.2
|
||||
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
From 11eca6018c40f5ebe6af93cbc4b4dce447d8b3bc Mon Sep 17 00:00:00 2001
|
||||
From: Niklas Haas <git@haasn.dev>
|
||||
Date: Mon, 13 Mar 2023 15:10:26 +0100
|
||||
Subject: [PATCH] avfilter/vf_libplacebo: wrap deprecated opts in FF_API define
|
||||
|
||||
Signed-off-by: Niklas Haas <git@haasn.dev>
|
||||
Signed-off-by: James Almer <jamrial@gmail.com>
|
||||
---
|
||||
libavfilter/version_major.h | 2 ++
|
||||
libavfilter/vf_libplacebo.c | 8 ++++++++
|
||||
2 files changed, 10 insertions(+)
|
||||
|
||||
diff --git a/libavfilter/version_major.h b/libavfilter/version_major.h
|
||||
index 899dfdb27dba..1decc4012ee0 100644
|
||||
--- a/libavfilter/version_major.h
|
||||
+++ b/libavfilter/version_major.h
|
||||
@@ -35,4 +35,6 @@
|
||||
* the public API and may change, break or disappear at any time.
|
||||
*/
|
||||
|
||||
+#define FF_API_LIBPLACEBO_OPTS (LIBAVFILTER_VERSION_MAJOR < 10)
|
||||
+
|
||||
#endif /* AVFILTER_VERSION_MAJOR_H */
|
||||
diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c
|
||||
index 7cd495de2619..d75723289069 100644
|
||||
--- a/libavfilter/vf_libplacebo.c
|
||||
+++ b/libavfilter/vf_libplacebo.c
|
||||
@@ -132,11 +132,14 @@ typedef struct LibplaceboContext {
|
||||
int inverse_tonemapping;
|
||||
float crosstalk;
|
||||
int tonemapping_lut_size;
|
||||
+
|
||||
+#if FF_API_LIBPLACEBO_OPTS
|
||||
/* for backwards compatibility */
|
||||
float desat_str;
|
||||
float desat_exp;
|
||||
int gamut_warning;
|
||||
int gamut_clipping;
|
||||
+#endif
|
||||
|
||||
/* pl_dither_params */
|
||||
int dithering;
|
||||
@@ -380,6 +383,7 @@ static int process_frames(AVFilterContext *avctx, AVFrame *out, AVFrame *in)
|
||||
pl_rect2df_aspect_set(&target.crop, aspect, s->pad_crop_ratio);
|
||||
}
|
||||
|
||||
+#if FF_API_LIBPLACEBO_OPTS
|
||||
/* backwards compatibility with older API */
|
||||
if (!tonemapping_mode && (s->desat_str >= 0.0f || s->desat_exp >= 0.0f)) {
|
||||
float str = s->desat_str < 0.0f ? 0.9f : s->desat_str;
|
||||
@@ -397,6 +401,7 @@ static int process_frames(AVFilterContext *avctx, AVFrame *out, AVFrame *in)
|
||||
gamut_mode = PL_GAMUT_WARN;
|
||||
if (s->gamut_clipping)
|
||||
gamut_mode = PL_GAMUT_DESATURATE;
|
||||
+#endif
|
||||
|
||||
/* Update render params */
|
||||
params = (struct pl_render_params) {
|
||||
@@ -818,11 +823,14 @@ static const AVOption libplacebo_options[] = {
|
||||
{ "inverse_tonemapping", "Inverse tone mapping (range expansion)", OFFSET(inverse_tonemapping), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC },
|
||||
{ "tonemapping_crosstalk", "Crosstalk factor for tone-mapping", OFFSET(crosstalk), AV_OPT_TYPE_FLOAT, {.dbl = 0.04}, 0.0, 0.30, DYNAMIC },
|
||||
{ "tonemapping_lut_size", "Tone-mapping LUT size", OFFSET(tonemapping_lut_size), AV_OPT_TYPE_INT, {.i64 = 256}, 2, 1024, DYNAMIC },
|
||||
+
|
||||
+#if FF_API_LIBPLACEBO_OPTS
|
||||
/* deprecated options for backwards compatibility, defaulting to -1 to not override the new defaults */
|
||||
{ "desaturation_strength", "Desaturation strength", OFFSET(desat_str), AV_OPT_TYPE_FLOAT, {.dbl = -1.0}, -1.0, 1.0, DYNAMIC | AV_OPT_FLAG_DEPRECATED },
|
||||
{ "desaturation_exponent", "Desaturation exponent", OFFSET(desat_exp), AV_OPT_TYPE_FLOAT, {.dbl = -1.0}, -1.0, 10.0, DYNAMIC | AV_OPT_FLAG_DEPRECATED },
|
||||
{ "gamut_warning", "Highlight out-of-gamut colors", OFFSET(gamut_warning), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC | AV_OPT_FLAG_DEPRECATED },
|
||||
{ "gamut_clipping", "Enable colorimetric gamut clipping", OFFSET(gamut_clipping), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC | AV_OPT_FLAG_DEPRECATED },
|
||||
+#endif
|
||||
|
||||
{ "dithering", "Dither method to use", OFFSET(dithering), AV_OPT_TYPE_INT, {.i64 = PL_DITHER_BLUE_NOISE}, -1, PL_DITHER_METHOD_COUNT - 1, DYNAMIC, "dither" },
|
||||
{ "none", "Disable dithering", 0, AV_OPT_TYPE_CONST, {.i64 = -1}, 0, 0, STATIC, "dither" },
|
||||
--
|
||||
2.39.2
|
||||
|
||||
21
README.md
21
README.md
|
|
@ -5,24 +5,3 @@ demux, stream, filter and play pretty much anything that humans and machines
|
|||
have created. It supports the most obscure ancient formats up to the cutting
|
||||
edge. No matter if they were designed by some standards committee, the
|
||||
community or a corporation.
|
||||
|
||||
## Creating the 'free' tarball
|
||||
|
||||
1. Update the `Version` in the spec file.
|
||||
2. Set the `Release` to 0 in the spec file.
|
||||
3. Set `pkg_suffix` to `%nil`
|
||||
4. Do a full build locally: `fedpkg mockbuild --with full_build`
|
||||
5. Run `./ffmpeg_update_free_sources.sh results_ffmpeg/5.0/0.fc35/build.log`
|
||||
This will update the `ffmpeg_free_sources` file list.
|
||||
Note that header files will need to be manually added
|
||||
to the `ffmpeg_free_sources` file list.
|
||||
6. Run `./ffmpeg_gen_free_tarball.sh` to create the tarball.
|
||||
7. Set `pkg_suffix` to `-free` again
|
||||
8. Set the `Release` to 1 in the spec file.
|
||||
9. Do a scratch build.
|
||||
|
||||
OR
|
||||
|
||||
1. Edit `ffmpeg_free_sources` and add missing files
|
||||
2. Run `./ffmpeg_gen_free_tarball.sh` to create the tarball.
|
||||
3. Do a scratch build.
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ adpcm_xa
|
|||
adpcm_xmd
|
||||
adpcm_yamaha
|
||||
adpcm_zork
|
||||
aic
|
||||
alac
|
||||
alias_pix
|
||||
amrnb
|
||||
|
|
@ -68,6 +69,7 @@ anull
|
|||
apac
|
||||
ape
|
||||
apng # animated png
|
||||
apv
|
||||
arbc
|
||||
argo
|
||||
ass # trivial
|
||||
|
|
@ -82,7 +84,6 @@ aura
|
|||
aura2
|
||||
av1 # libaom
|
||||
av1_qsv # libaom
|
||||
ayuv # trivial
|
||||
bethsoftvid # trivial
|
||||
bfi # trivial
|
||||
bink
|
||||
|
|
@ -115,6 +116,7 @@ dfa
|
|||
dfpwm
|
||||
dirac # dirac
|
||||
dnxhd
|
||||
dnxhr
|
||||
dolby_e
|
||||
dpx
|
||||
dsd_lsbf
|
||||
|
|
@ -163,7 +165,7 @@ gsm_ms
|
|||
gsm_ms_at
|
||||
h261
|
||||
h263
|
||||
h263_v4l2m2m
|
||||
h263_v4l2m2m # hardware
|
||||
h263i
|
||||
h263p
|
||||
hap
|
||||
|
|
@ -196,6 +198,8 @@ jv
|
|||
kgv1
|
||||
kmvc
|
||||
lagarith
|
||||
libaribb24 # aribb24
|
||||
libaribcaption # libaribcaption
|
||||
libaom # libaom
|
||||
libaom_av1 # libaom
|
||||
libcodec2 # codec2
|
||||
|
|
@ -204,9 +208,10 @@ libgsm # libgsm
|
|||
libgsm_ms # libgsm
|
||||
libilbc # ilbc
|
||||
libjxl # libjxl
|
||||
liblc3 # liblc3
|
||||
libopencore_amrnb # opencore-amr
|
||||
libopencore_amrwb # opencore-amr
|
||||
libopenh264 # openh264_dlopen
|
||||
libopenh264 # openh264
|
||||
libopenjpeg # openjpeg
|
||||
libopus # opus
|
||||
librsvg # librsvg
|
||||
|
|
@ -215,6 +220,7 @@ libspeex # speex
|
|||
libvorbis # libvorbis
|
||||
libvpx_vp8 # libvpx
|
||||
libvpx_vp9 # libvpx
|
||||
libxevd
|
||||
libzvbi_teletext # zvbi
|
||||
loco
|
||||
lscr
|
||||
|
|
@ -245,13 +251,13 @@ mp3on4
|
|||
mp3on4float
|
||||
mpc7
|
||||
mpc8
|
||||
mpeg1video
|
||||
mpeg1_v4l2m2m
|
||||
mpeg2video
|
||||
mpeg1video
|
||||
mpeg2_qsv
|
||||
mpeg2_v4l2m2m
|
||||
mpeg2video
|
||||
mpeg4
|
||||
mpeg4_v4l2m2m
|
||||
mpeg4_v4l2m2m # hardware
|
||||
mpegvideo
|
||||
mpl2
|
||||
msa1
|
||||
|
|
@ -329,6 +335,8 @@ pictor
|
|||
pjs
|
||||
png # libpng
|
||||
ppm # trivial
|
||||
prores
|
||||
prores_raw
|
||||
prosumer
|
||||
psd
|
||||
ptx
|
||||
|
|
@ -336,6 +344,7 @@ qcelp
|
|||
qdm2
|
||||
qdmc
|
||||
qdraw
|
||||
qoa
|
||||
qoi
|
||||
qpeg
|
||||
qtrle
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ asv2
|
|||
av1_amf
|
||||
av1_nvenc
|
||||
av1_qsv
|
||||
ayuv # trival
|
||||
av1_vaapi
|
||||
bitpacked # trivial
|
||||
bmp # trivial
|
||||
cinepak
|
||||
|
|
@ -38,6 +38,7 @@ cljr
|
|||
dca
|
||||
dfpwm
|
||||
dnxhd
|
||||
dnxhr
|
||||
dpx
|
||||
dvbsub
|
||||
dvdsub
|
||||
|
|
@ -69,22 +70,23 @@ hevc_v4l2m2m # hardware
|
|||
hevc_vaapi # hardware
|
||||
huffyuv # trivial+zlib
|
||||
ilbc # ilbc
|
||||
jpegls
|
||||
jpeg2000
|
||||
libaom # libaom
|
||||
jpegls
|
||||
libaom
|
||||
libaom_av1 # libaom
|
||||
libcodec2 # codec2
|
||||
libgsm # libgsm
|
||||
libgsm_ms # libgsm
|
||||
libilbc # ilbc
|
||||
libjxl # libjxl
|
||||
liblc3 # liblc3
|
||||
libmp3lame # lame
|
||||
liboapv
|
||||
libopencore_amrnb
|
||||
libopenh264 # openh264_dlopen
|
||||
libopenh264 # openh264
|
||||
libopenjpeg # openjpeg
|
||||
libopus # opus
|
||||
librav1e # rav1e
|
||||
libschroedinger # schroedinger
|
||||
libspeex # speex
|
||||
libsvtav1
|
||||
libtheora # libtheora
|
||||
|
|
@ -95,6 +97,7 @@ libvpx_vp8 # libvpx
|
|||
libvpx_vp9 # libvpx
|
||||
libwebp # libwebp
|
||||
libwebp_anim # libwebp
|
||||
libxeve
|
||||
libxvid # xvidcore
|
||||
mjpeg # mjpegtools
|
||||
mjpeg_qsv # mjpegtools
|
||||
|
|
@ -103,9 +106,9 @@ mlp
|
|||
mp2 # twolame
|
||||
mp2fixed # twolame
|
||||
mpeg1video
|
||||
mpeg2video
|
||||
mpeg2_qsv
|
||||
mpeg2_vaapi
|
||||
mpeg2video
|
||||
mpeg4
|
||||
mpeg4_v4l2m2m # hardware
|
||||
msmpeg4v2
|
||||
|
|
@ -146,6 +149,9 @@ pgmyuv # trivial
|
|||
phm # trivial
|
||||
png # libpng
|
||||
ppm # trivial
|
||||
prores
|
||||
prores_aw
|
||||
prores_ks
|
||||
qoi
|
||||
qtrle
|
||||
r10k # trivial
|
||||
|
|
|
|||
|
|
@ -1,24 +1,27 @@
|
|||
From: Andreas Schneider <asn@cryptomilk.org>
|
||||
|
||||
fdk-aac-free-devel is GPL compatible
|
||||
|
||||
See https://bugzilla.redhat.com/show_bug.cgi?id=1501522#c112
|
||||
|
||||
Index: ffmpeg-5.0/configure
|
||||
Index: ffmpeg-7.0/configure
|
||||
===================================================================
|
||||
--- ffmpeg-5.0.orig/configure 2022-02-09 20:07:49.490888877 +0100
|
||||
+++ ffmpeg-5.0/configure 2022-02-09 20:08:30.102854308 +0100
|
||||
@@ -1783,7 +1783,6 @@ EXTERNAL_LIBRARY_GPL_LIST="
|
||||
|
||||
--- ffmpeg-7.0.orig/configure 2022-02-09 20:07:49.490888877 +0100
|
||||
+++ ffmpeg-7.0/configure 2022-02-09 20:08:30.102854308 +0100
|
||||
@@ -1872,7 +1872,6 @@ EXTERNAL_LIBRARY_GPL_LIST="
|
||||
|
||||
EXTERNAL_LIBRARY_NONFREE_LIST="
|
||||
decklink
|
||||
- libfdk_aac
|
||||
libtls
|
||||
"
|
||||
|
||||
@@ -1822,6 +1821,7 @@ EXTERNAL_LIBRARY_LIST="
|
||||
|
||||
@@ -1912,6 +1911,7 @@ EXTERNAL_LIBRARY_LIST="
|
||||
libcodec2
|
||||
libdav1d
|
||||
libdc1394
|
||||
libdrm
|
||||
+ libfdk_aac
|
||||
libflite
|
||||
libfontconfig
|
||||
libfreetype
|
||||
|
||||
|
|
|
|||
46
ffmpeg-chromium.patch
Normal file
46
ffmpeg-chromium.patch
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
From d32aacab65a322b66d6a1b48f6cdb03e42bde0f9 Mon Sep 17 00:00:00 2001
|
||||
From: Frank Liberato <liberato@chromium.org>
|
||||
Date: Wed, 7 Jul 2021 19:01:22 -0700
|
||||
Subject: [PATCH] Add av_stream_get_first_dts for Chromium
|
||||
|
||||
---
|
||||
libavformat/avformat.h | 4 ++++
|
||||
libavformat/utils.c | 7 +++++++
|
||||
2 files changed, 11 insertions(+)
|
||||
|
||||
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
|
||||
index 1916aa2dc5..e6682849fa 100644
|
||||
--- a/libavformat/avformat.h
|
||||
+++ b/libavformat/avformat.h
|
||||
@@ -1170,6 +1170,10 @@ typedef struct AVStreamGroup {
|
||||
|
||||
struct AVCodecParserContext *av_stream_get_parser(const AVStream *s);
|
||||
|
||||
+// 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
|
||||
|
||||
/**
|
||||
diff --git a/libavformat/utils.c b/libavformat/utils.c
|
||||
index cf4d68bff9..7d750abf88 100644
|
||||
--- a/libavformat/utils.c
|
||||
+++ b/libavformat/utils.c
|
||||
@@ -56,6 +56,13 @@ int ff_unlock_avformat(void)
|
||||
* various utility functions for use within FFmpeg
|
||||
*/
|
||||
|
||||
+// 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)
|
||||
|
||||
--
|
||||
2.41.0
|
||||
|
||||
|
|
@ -11,19 +11,19 @@ reduced codec selection list.
|
|||
libavformat/matroskaenc.c | 20 ++++++++++++++------
|
||||
1 file changed, 14 insertions(+), 6 deletions(-)
|
||||
|
||||
Index: ffmpeg-6.0/libavformat/matroskaenc.c
|
||||
Index: ffmpeg-7.0/libavformat/matroskaenc.c
|
||||
===================================================================
|
||||
--- ffmpeg-6.0.orig/libavformat/matroskaenc.c
|
||||
+++ ffmpeg-6.0/libavformat/matroskaenc.c
|
||||
@@ -3321,16 +3321,25 @@ static int mkv_query_codec(enum AVCodecI
|
||||
--- ffmpeg-7.0.orig/libavformat/matroskaenc.c
|
||||
+++ ffmpeg-7.0/libavformat/matroskaenc.c
|
||||
@@ -3540,16 +3540,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
|
||||
+ 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 FFOutputFormat ff_matroska_muxer = {
|
||||
.p.name = "matroska",
|
||||
|
|
@ -36,16 +36,16 @@ Index: ffmpeg-6.0/libavformat/matroskaenc.c
|
|||
- .p.video_codec = CONFIG_LIBX264_ENCODER ?
|
||||
- AV_CODEC_ID_H264 : AV_CODEC_ID_MPEG4,
|
||||
+ .p.audio_codec = PREFAUDIO,
|
||||
+ .p.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,
|
||||
+ .p.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,
|
||||
@@ -3388,8 +3397,7 @@ const FFOutputFormat ff_matroska_audio_m
|
||||
@@ -3617,8 +3626,7 @@ const FFOutputFormat ff_matroska_audio_m
|
||||
.p.mime_type = "audio/x-matroska",
|
||||
.p.extensions = "mka",
|
||||
.priv_data_size = sizeof(MatroskaMuxContext),
|
||||
|
|
@ -55,3 +55,4 @@ Index: ffmpeg-6.0/libavformat/matroskaenc.c
|
|||
.p.video_codec = AV_CODEC_ID_NONE,
|
||||
.init = mkv_init,
|
||||
.deinit = mkv_deinit,
|
||||
|
||||
|
|
|
|||
|
|
@ -1,383 +0,0 @@
|
|||
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
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index ba5793b2ff..8855c1a908 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -251,6 +251,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
|
||||
@@ -1844,6 +1845,7 @@ EXTERNAL_LIBRARY_LIST="
|
||||
libmysofa
|
||||
libopencv
|
||||
libopenh264
|
||||
+ libopenh264_dlopen
|
||||
libopenjpeg
|
||||
libopenmpt
|
||||
libopenvino
|
||||
@@ -6596,6 +6598,7 @@ enabled libopencv && { check_headers opencv2/core/core_c.h &&
|
||||
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++"
|
||||
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
|
||||
index 457ec58377..08a26fba5f 100644
|
||||
--- a/libavcodec/Makefile
|
||||
+++ b/libavcodec/Makefile
|
||||
@@ -1075,6 +1075,7 @@ OBJS-$(CONFIG_LIBMP3LAME_ENCODER) += libmp3lame.o
|
||||
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
|
||||
diff --git a/libavcodec/libopenh264.c b/libavcodec/libopenh264.c
|
||||
index 0f6d28ed88..a124c3fa1e 100644
|
||||
--- a/libavcodec/libopenh264.c
|
||||
+++ b/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 *logctx)
|
||||
// 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);
|
||||
diff --git a/libavcodec/libopenh264_dlopen.c b/libavcodec/libopenh264_dlopen.c
|
||||
new file mode 100644
|
||||
index 0000000000..49ea8ff44f
|
||||
--- /dev/null
|
||||
+++ b/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;
|
||||
+}
|
||||
diff --git a/libavcodec/libopenh264_dlopen.h b/libavcodec/libopenh264_dlopen.h
|
||||
new file mode 100644
|
||||
index 0000000000..d7d8bb7cad
|
||||
--- /dev/null
|
||||
+++ b/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 */
|
||||
diff --git a/libavcodec/libopenh264dec.c b/libavcodec/libopenh264dec.c
|
||||
index 007f86b619..57aa3bc1d1 100644
|
||||
--- a/libavcodec/libopenh264dec.c
|
||||
+++ b/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(AVCodecContext *avctx)
|
||||
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;
|
||||
|
||||
diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c
|
||||
index db252aace1..75289678da 100644
|
||||
--- a/libavcodec/libopenh264enc.c
|
||||
+++ b/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(AVCodecContext *avctx)
|
||||
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;
|
||||
|
||||
--
|
||||
2.36.1
|
||||
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
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 a reduced build).
|
||||
|
||||
---
|
||||
fftools/ffmpeg.c | 2 +-
|
||||
fftools/ffmpeg_filter.c | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
Index: ffmpeg-6.0/fftools/ffmpeg.c
|
||||
===================================================================
|
||||
--- ffmpeg-6.0.orig/fftools/ffmpeg.c
|
||||
+++ ffmpeg-6.0/fftools/ffmpeg.c
|
||||
@@ -2797,7 +2797,7 @@ static int init_input_stream(InputStream
|
||||
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-6.0/fftools/ffmpeg_filter.c
|
||||
===================================================================
|
||||
--- ffmpeg-6.0.orig/fftools/ffmpeg_filter.c
|
||||
+++ ffmpeg-6.0/fftools/ffmpeg_filter.c
|
||||
@@ -1064,7 +1064,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;
|
||||
}
|
||||
73
ffmpeg-support-evc-base-libraries.patch
Normal file
73
ffmpeg-support-evc-base-libraries.patch
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
From 80bf83e3099652a3e7f8d1e8b6d902fea1ce4db9 Mon Sep 17 00:00:00 2001
|
||||
From: James Almer <jamrial@gmail.com>
|
||||
Date: Sun, 24 Aug 2025 15:57:16 -0300
|
||||
Subject: [PATCH] configure: support linking to base profile libxev{d,e}
|
||||
|
||||
Addresses issue #20328.
|
||||
|
||||
Signed-off-by: James Almer <jamrial@gmail.com>
|
||||
---
|
||||
configure | 16 ++++++++++++++--
|
||||
1 file changed, 14 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index aa41b2a7b3..5386ae8b9a 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -299,7 +299,9 @@ External library support:
|
||||
--enable-libx264 enable H.264 encoding via x264 [no]
|
||||
--enable-libx265 enable HEVC encoding via x265 [no]
|
||||
--enable-libxeve enable EVC encoding via libxeve [no]
|
||||
+ --enable-libxeveb enable EVC encoding via libxeve (Base profile) [no]
|
||||
--enable-libxevd enable EVC decoding via libxevd [no]
|
||||
+ --enable-libxevdb enable EVC decoding via libxevd (Base profile) [no]
|
||||
--enable-libxavs enable AVS encoding via xavs [no]
|
||||
--enable-libxavs2 enable AVS2 encoding via xavs2 [no]
|
||||
--enable-libxcb enable X11 grabbing using XCB [autodetect]
|
||||
@@ -1992,7 +1994,9 @@ EXTERNAL_LIBRARY_LIST="
|
||||
libvvenc
|
||||
libwebp
|
||||
libxevd
|
||||
+ libxevdb
|
||||
libxeve
|
||||
+ libxeveb
|
||||
libxml2
|
||||
libzimg
|
||||
libzmq
|
||||
@@ -3669,8 +3673,8 @@ libx265_encoder_deps="libx265"
|
||||
libx265_encoder_select="atsc_a53 dovi_rpuenc"
|
||||
libxavs_encoder_deps="libxavs"
|
||||
libxavs2_encoder_deps="libxavs2"
|
||||
-libxevd_decoder_deps="libxevd"
|
||||
-libxeve_encoder_deps="libxeve"
|
||||
+libxevd_decoder_deps_any="libxevd libxevdb"
|
||||
+libxeve_encoder_deps_any="libxeve libxeveb"
|
||||
libxvid_encoder_deps="libxvid"
|
||||
libzvbi_teletext_decoder_deps="libzvbi"
|
||||
vapoursynth_demuxer_deps="vapoursynth"
|
||||
@@ -4615,6 +4619,12 @@ enabled_all gnutls mbedtls &&
|
||||
enabled_all openssl mbedtls &&
|
||||
die "OpenSSL and mbedTLS must not be enabled at the same time."
|
||||
|
||||
+enabled_all libxevd libxevdb &&
|
||||
+ die "libxevd and libxevdb must not be enabled at the same time."
|
||||
+
|
||||
+enabled_all libxeve libxeveb &&
|
||||
+ die "libxeve and libxevdb must not be enabled at the same time."
|
||||
+
|
||||
# Disable all the library-specific components if the library itself
|
||||
# is disabled, see AVCODEC_LIST and following _LIST variables.
|
||||
|
||||
@@ -7204,7 +7214,9 @@ enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get
|
||||
enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
|
||||
enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get
|
||||
enabled libxevd && require_pkg_config libxevd "xevd >= 0.4.1" "xevd.h" xevd_decode
|
||||
+enabled libxevdb && require_pkg_config libxevdb "xevdb >= 0.4.1" "xevd.h" xevd_decode
|
||||
enabled libxeve && require_pkg_config libxeve "xeve >= 0.5.1" "xeve.h" xeve_encode
|
||||
+enabled libxeveb && require_pkg_config libxeveb "xeveb >= 0.5.1" "xeve.h" xeve_encode
|
||||
enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
|
||||
enabled libzimg && require_pkg_config libzimg "zimg >= 2.7.0" zimg.h zimg_get_api_version
|
||||
enabled libzmq && require_pkg_config libzmq "libzmq >= 4.2.1" zmq.h zmq_ctx_new
|
||||
--
|
||||
2.49.1
|
||||
|
||||
813
ffmpeg.spec
813
ffmpeg.spec
File diff suppressed because it is too large
Load diff
4051
ffmpeg_free_sources
4051
ffmpeg_free_sources
File diff suppressed because it is too large
Load diff
|
|
@ -1,130 +0,0 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2022 Andreas Schneider <asn@cryptomilk.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/>.
|
||||
#
|
||||
# shellcheck disable=2181
|
||||
|
||||
export LC_COLLATE="C.UTF-8"
|
||||
|
||||
FF_PKGNAME="ffmpeg"
|
||||
FF_PKGNAME_SUFFIX="-free"
|
||||
FF_VERSION="$(rpmspec -P ./*.spec | grep ^Version | sed -e 's/Version:[ ]*//g')"
|
||||
FF_TARBALL_URL="https://ffmpeg.org/releases/${FF_PKGNAME}-${FF_VERSION}.tar.xz"
|
||||
FF_TARBALL="$(basename "${FF_TARBALL_URL}")"
|
||||
FF_GPG_ARMOR_FILE="${FF_TARBALL}.asc"
|
||||
FF_PKG_DIR="$(pwd)"
|
||||
FF_KEYRING="${FF_PKG_DIR}/ffmpeg.keyring"
|
||||
FF_TMPDIR=$(mktemp --tmpdir -d ffmpeg-XXXXXXXX)
|
||||
FF_PATH="${FF_TMPDIR}/${FF_PKGNAME}-${FF_VERSION}"
|
||||
|
||||
cleanup_tmpdir() {
|
||||
# shellcheck disable=2164
|
||||
popd 2>/dev/null
|
||||
rm -rf "${FF_TMPDIR}"
|
||||
}
|
||||
trap cleanup_tmpdir SIGINT
|
||||
|
||||
cleanup_and_exit()
|
||||
{
|
||||
cleanup_tmpdir
|
||||
|
||||
if test "$1" = 0 -o -z "$1"; then
|
||||
exit 0
|
||||
else
|
||||
# shellcheck disable=2086
|
||||
exit ${1}
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ ! -w "${FF_TARBALL}" ]]; then
|
||||
echo ">>> Downloading tarball"
|
||||
wget "${FF_TARBALL_URL}"
|
||||
fi
|
||||
if [[ ! -w "${FF_TARBALL}.asc" ]]; then
|
||||
echo ">>> Downloading signature"
|
||||
wget "${FF_TARBALL_URL}.asc"
|
||||
fi
|
||||
|
||||
echo ">>> Verifying ${FF_TARBALL} GPG signature"
|
||||
gpgv2 --quiet --keyring "${FF_KEYRING}" "${FF_GPG_ARMOR_FILE}" "${FF_TARBALL}"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: GPG signature verification failed"
|
||||
cleanup_and_exit 1
|
||||
fi
|
||||
echo
|
||||
|
||||
echo ">>> Unpacking ${FF_TARBALL}"
|
||||
|
||||
tar -xf "${FF_TARBALL}" -C "${FF_TMPDIR}"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: Failed to unpack ${FF_TARBALL}"
|
||||
cleanup_and_exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -r ffmpeg_free_sources ]]; then
|
||||
echo "ERROR: ffmpeg_free_sources doesn't exist!"
|
||||
cleanup_and_exit 1
|
||||
fi
|
||||
readarray -t keepfiles < ffmpeg_free_sources
|
||||
|
||||
pushd "${FF_PATH}" || cleanup_and_exit 1
|
||||
|
||||
echo
|
||||
echo ">>> Cleaning up sources for new tarball ..."
|
||||
|
||||
# Get file list from ffmpeg
|
||||
mapfile -d '' filelist < <(find ./ -type f -printf '%P\0')
|
||||
|
||||
# Sort arrays
|
||||
readarray -t keepfiles_sorted < <(printf '%s\0' "${keepfiles[@]}" | sort -z | xargs -0n1)
|
||||
readarray -t filelist_sorted < <(printf '%s\0' "${filelist[@]}" | sort -z | xargs -0n1)
|
||||
|
||||
# Compare arrays and remove files which are left over
|
||||
comm -2 -3 -z <(printf '%s\0' "${filelist_sorted[@]}") <(printf '%s\0' "${keepfiles_sorted[@]}") | xargs -0 rm -f
|
||||
|
||||
readarray -t removed_files < <(comm -1 -3 -z <(printf '%s\0' "${filelist_sorted[@]}") <(printf '%s\0' "${keepfiles_sorted[@]}") | xargs -0n1)
|
||||
if [[ "${#removed_files[@]}" -ge 1 ]]; then
|
||||
if [[ "${#removed_files[@]}" -eq 1 ]] && [[ -z "${removed_files[0]}" ]]; then
|
||||
echo "... done"
|
||||
else
|
||||
echo "File not in upstream tarball anymore (please cleanup 'ffmpeg_free_sources'):"
|
||||
for f in "${removed_files[@]}"; do
|
||||
if [[ -z "${f}" ]]; then
|
||||
continue
|
||||
fi
|
||||
echo " * ${f}"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
echo
|
||||
|
||||
popd || cleanup_and_exit 1 # /FF_PATH
|
||||
|
||||
pushd "${FF_TMPDIR}" || cleanup_and_exit 1
|
||||
|
||||
echo ">>> Create new tarball ${FF_PKGNAME}${FF_PKGNAME_SUFFIX}-${FF_VERSION}.tar.xz ..."
|
||||
tar -cJf "${FF_PKG_DIR}/${FF_PKGNAME}${FF_PKGNAME_SUFFIX}-${FF_VERSION}.tar.xz" "${FF_PKGNAME}-${FF_VERSION}"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: Creating tarball failed"
|
||||
cleanup_and_exit 1
|
||||
fi
|
||||
|
||||
popd || cleanup_and_exit 1 # /FF_TMPDIR
|
||||
|
||||
du -sh "${FF_PKGNAME}${FF_PKGNAME_SUFFIX}-${FF_VERSION}.tar.xz"
|
||||
echo
|
||||
|
||||
cleanup_and_exit 0
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2022 Andreas Schneider <asn@cryptomilk.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/>.
|
||||
#
|
||||
# shellcheck disable=2181
|
||||
|
||||
export LC_COLLATE="C.UTF-8"
|
||||
|
||||
cleanup_and_exit()
|
||||
{
|
||||
if test "$1" = 0 -o -z "$1"; then
|
||||
exit 0
|
||||
else
|
||||
# shellcheck disable=2086
|
||||
exit ${1}
|
||||
fi
|
||||
}
|
||||
|
||||
echo ">>> Collect information from ${1}"
|
||||
build_log="$(readlink -f "${1}")"
|
||||
if [[ -z "${build_log}" ]] || [[ ! -r "${build_log}" ]]; then
|
||||
echo "Build log doesn't exist: %{build_log}"
|
||||
cleanup_and_exit 1
|
||||
fi
|
||||
|
||||
asm_files="$(grep "^gcc.*\.c$" "${build_log}" | awk 'NF>1{print $NF}' | sort)"
|
||||
c_files="$(grep "^nasm.*\.asm$" "${build_log}" | awk 'NF>1{print $NF}' | sort)"
|
||||
|
||||
# shellcheck disable=2206
|
||||
new_sources=(${asm_files}
|
||||
${c_files})
|
||||
|
||||
# Sort arrays
|
||||
readarray -t new_sources_sorted < <(printf '%s\0' "${new_sources[@]}" | sort -z | xargs -0n1)
|
||||
|
||||
# Create a backup for a diff
|
||||
cp -a ffmpeg_free_sources ffmpeg_free_sources.orig
|
||||
cp -a ffmpeg_free_sources ffmpeg_free_sources.new
|
||||
printf "%s\n" "${new_sources_sorted[@]}" >> ffmpeg_free_sources.new
|
||||
# Update ffmpeg_free_sources
|
||||
echo ">>> Updating ffmpeg_free_sources"
|
||||
sort < ffmpeg_free_sources.new | uniq | sed '/^$/d' > ffmpeg_free_sources
|
||||
echo ">>> Differences in file list"
|
||||
diff -u ffmpeg_free_sources.orig ffmpeg_free_sources
|
||||
rm -f ffmpeg_free_sources.new
|
||||
|
||||
cleanup_and_exit 0
|
||||
5
sources
5
sources
|
|
@ -1,4 +1,3 @@
|
|||
SHA512 (ffmpeg-free-6.0.tar.xz) = 5e806529f45311d94a81401d8951135e84361a81d158ed030aeee9812b399dd28b25c5d3e1a4abe0665d5838e0954626de538b10cebf34f8669963b1974a3910
|
||||
SHA512 (ffmpeg-6.0.tar.xz.asc) = a64cd0f8578fcea4537f5a38634c930d66c8ba4abd3e8e9dcffaeb95c3ad2e754d7bc4fbb5272409d4d32abf8180ef83f7204c6a570b52a37e635efd96cb94ed
|
||||
SHA512 (ffmpeg-dlopen-headers.tar.xz) = 97e6986fc2bb9dfa4516135a76b04d27ceb52ff96f0af21a6169919aeefefb4d2e2e24a771959689cdbec385f5d71614ba661223c67c0e94089a6dd823a30099
|
||||
SHA512 (ffmpeg-8.0.1.tar.xz) = 7af5cd1c7ba04f8d7ea1b54b64b9c235f2a606dc0c18d25cfdf20958bcad4851d3265b4894fc6ba5dd205c2309971c7e7fb890ee1d64e0a41a3faf159f77957f
|
||||
SHA512 (ffmpeg-8.0.1.tar.xz.asc) = f56e9e89ecdf9f12e3dae90b52289e5d09bfbfc0f6e13aaf17da9330c138fdb62b132f856c2fd16f5d9f5d6bcf1725602c8781c3e5f07bda6ce1306c379792ab
|
||||
SHA512 (ffmpeg.keyring) = 9b36506835db36f776b7ddb53ad6fa9e915e6ca2f9c7cfebe8eb45513e1036a985283590a840ca313a111bf35dc3731f68885aaafb1fb7011ec433cc119e5165
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue