summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/ffmpeg/ffmpeg_5.0.3.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-multimedia/ffmpeg/ffmpeg_5.0.3.bb')
-rw-r--r--meta/recipes-multimedia/ffmpeg/ffmpeg_5.0.3.bb228
1 files changed, 228 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg_5.0.3.bb b/meta/recipes-multimedia/ffmpeg/ffmpeg_5.0.3.bb
new file mode 100644
index 0000000000..127552396d
--- /dev/null
+++ b/meta/recipes-multimedia/ffmpeg/ffmpeg_5.0.3.bb
@@ -0,0 +1,228 @@
1SUMMARY = "A complete, cross-platform solution to record, convert and stream audio and video."
2DESCRIPTION = "FFmpeg is the leading multimedia framework, able to decode, encode, transcode, \
3 mux, demux, stream, filter and play pretty much anything that humans and machines \
4 have created. It supports the most obscure ancient formats up to the cutting edge."
5HOMEPAGE = "https://www.ffmpeg.org/"
6SECTION = "libs"
7
8LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later & ISC & MIT & BSD-2-Clause & BSD-3-Clause & IJG"
9LICENSE:${PN} = "GPL-2.0-or-later"
10LICENSE:libavcodec = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPL-2.0-or-later', 'LGPL-2.1-or-later', d)}"
11LICENSE:libavdevice = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPL-2.0-or-later', 'LGPL-2.1-or-later', d)}"
12LICENSE:libavfilter = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPL-2.0-or-later', 'LGPL-2.1-or-later', d)}"
13LICENSE:libavformat = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPL-2.0-or-later', 'LGPL-2.1-or-later', d)}"
14LICENSE:libavutil = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPL-2.0-or-later', 'LGPL-2.1-or-later', d)}"
15LICENSE:libpostproc = "GPL-2.0-or-later"
16LICENSE:libswresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPL-2.0-or-later', 'LGPL-2.1-or-later', d)}"
17LICENSE:libswscale = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPL-2.0-or-later', 'LGPL-2.1-or-later', d)}"
18LICENSE_FLAGS = "commercial"
19
20LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
21 file://COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
22 file://COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \
23 file://COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02"
24
25SRC_URI = "https://www.ffmpeg.org/releases/${BP}.tar.xz \
26 file://0001-libavutil-include-assembly-with-full-path-from-sourc.patch \
27 file://CVE-2024-32230.patch \
28 file://CVE-2023-51793.patch \
29 file://CVE-2023-50008.patch \
30 file://CVE-2024-31582.patch \
31 file://CVE-2024-31578.patch \
32 file://CVE-2023-51794.patch \
33 file://CVE-2023-51798.patch \
34 file://CVE-2023-47342.patch \
35 file://CVE-2023-50007.patch \
36 file://CVE-2023-51796.patch \
37 file://CVE-2024-7055.patch \
38 file://CVE-2024-35366.patch \
39 file://CVE-2024-35367.patch \
40 file://CVE-2024-35368.patch \
41 file://CVE-2025-0518.patch \
42 file://CVE-2024-36613.patch \
43 file://CVE-2024-36616.patch \
44 file://CVE-2024-36617.patch \
45 file://CVE-2024-36618.patch \
46 file://CVE-2024-28661.patch \
47 file://CVE-2024-35369.patch \
48 file://CVE-2025-25473.patch \
49 "
50
51SRC_URI[sha256sum] = "04c70c377de233a4b217c2fdf76b19aeb225a287daeb2348bccd978c47b1a1db"
52
53# CVE-2023-39018 issue belongs to ffmpeg-cli-wrapper (Java wrapper around the FFmpeg CLI)
54# and not ffmepg itself.
55# https://security-tracker.debian.org/tracker/CVE-2023-39018
56# https://bugzilla.suse.com/show_bug.cgi?id=CVE-2023-39018
57CVE_CHECK_IGNORE += "CVE-2023-39018"
58
59# There is no release which is vulnerable to these CVEs
60# These vulnerabilities are in new features being developed and fixed before releasing them
61# feature (jpeg xl): https://github.com/FFmpeg/FFmpeg/commit/0c0dd23fe1102313742092c4760596971755814e
62# bugfix: https://github.com/FFmpeg/FFmpeg/commit/bf814387f42e9b0dea9d75c03db4723c88e7d962
63CVE_CHECK_IGNORE += "CVE-2023-46407"
64# feature (evc parser): https://github.com/FFmpeg/FFmpeg/commit/34e4f18360c4ecb8e5979cab8f389478d8cd7819
65# bugfix: https://github.com/FFmpeg/FFmpeg/commit/4565747056a11356210ed8edcecb920105e40b60
66CVE_CHECK_IGNORE += "CVE-2023-47470"
67# feature (jpeg xl): https://github.com/FFmpeg/FFmpeg/commit/0c0dd23fe1102313742092c4760596971755814e
68# bugfix: https://github.com/FFmpeg/FFmpeg/commit/d2e8974699a9e35cc1a926bf74a972300d629cd5
69CVE_CHECK_IGNORE += "CVE-2024-22860"
70# feature (oqs audio decoder): https://github.com/FFmpeg/FFmpeg/commit/7ef9d31071021c05e6b792af3f25b7b9ceaa9258
71# bugfix: https://github.com/FFmpeg/FFmpeg/commit/87b8c1081959e45ffdcbabb3d53ac9882ef2b5ce
72CVE_CHECK_IGNORE += "CVE-2024-22861"
73# feature (jpeg xl): https://github.com/FFmpeg/FFmpeg/commit/0c0dd23fe1102313742092c4760596971755814e
74# bugfix: https://github.com/FFmpeg/FFmpeg/commit/ca09d8a0dcd82e3128e62463231296aaf63ae6f7
75CVE_CHECK_IGNORE += "CVE-2024-22862"
76
77# This vulnerability was introduced in 5.1 and fixed in 5.2 (backported also to 5.1.6), so 5.0.x is not affected
78# introduced: https://github.com/FFmpeg/FFmpeg/commit/8a5896ec1f635ccf0d726f7ba7a06649ebeebf25
79# bugfix: https://github.com/FFmpeg/FFmpeg/commit/9903ba28c28ab18dc7b7b6fb8571cc8b5caae1a6
80CVE_CHECK_IGNORE += "CVE-2024-7272"
81
82# Build fails when thumb is enabled: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7717
83ARM_INSTRUCTION_SET:armv4 = "arm"
84ARM_INSTRUCTION_SET:armv5 = "arm"
85ARM_INSTRUCTION_SET:armv6 = "arm"
86
87# Should be API compatible with libav (which was a fork of ffmpeg)
88# libpostproc was previously packaged from a separate recipe
89PROVIDES = "libav libpostproc"
90
91DEPENDS = "nasm-native"
92
93inherit autotools pkgconfig
94
95PACKAGECONFIG ??= "avdevice avfilter avcodec avformat swresample swscale postproc \
96 alsa bzlib lzma pic pthreads shared theora zlib \
97 ${@bb.utils.contains('AVAILTUNES', 'mips32r2', 'mips32r2', '', d)} \
98 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xv xcb', '', d)}"
99
100# libraries to build in addition to avutil
101PACKAGECONFIG[avdevice] = "--enable-avdevice,--disable-avdevice"
102PACKAGECONFIG[avfilter] = "--enable-avfilter,--disable-avfilter"
103PACKAGECONFIG[avcodec] = "--enable-avcodec,--disable-avcodec"
104PACKAGECONFIG[avformat] = "--enable-avformat,--disable-avformat"
105PACKAGECONFIG[swresample] = "--enable-swresample,--disable-swresample"
106PACKAGECONFIG[swscale] = "--enable-swscale,--disable-swscale"
107PACKAGECONFIG[postproc] = "--enable-postproc,--disable-postproc"
108
109# features to support
110PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib"
111PACKAGECONFIG[altivec] = "--enable-altivec,--disable-altivec,"
112PACKAGECONFIG[bzlib] = "--enable-bzlib,--disable-bzlib,bzip2"
113PACKAGECONFIG[fdk-aac] = "--enable-libfdk-aac --enable-nonfree,--disable-libfdk-aac,fdk-aac"
114PACKAGECONFIG[gpl] = "--enable-gpl,--disable-gpl"
115PACKAGECONFIG[gsm] = "--enable-libgsm,--disable-libgsm,libgsm"
116PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack"
117PACKAGECONFIG[libopus] = "--enable-libopus,--disable-libopus,libopus"
118PACKAGECONFIG[libvorbis] = "--enable-libvorbis,--disable-libvorbis,libvorbis"
119PACKAGECONFIG[lzma] = "--enable-lzma,--disable-lzma,xz"
120PACKAGECONFIG[mfx] = "--enable-libmfx,--disable-libmfx,intel-mediasdk"
121PACKAGECONFIG[mp3lame] = "--enable-libmp3lame,--disable-libmp3lame,lame"
122PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl"
123PACKAGECONFIG[sdl2] = "--enable-sdl2,--disable-sdl2,virtual/libsdl2"
124PACKAGECONFIG[speex] = "--enable-libspeex,--disable-libspeex,speex"
125PACKAGECONFIG[srt] = "--enable-libsrt,--disable-libsrt,srt"
126PACKAGECONFIG[theora] = "--enable-libtheora,--disable-libtheora,libtheora libogg"
127PACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva"
128PACKAGECONFIG[vdpau] = "--enable-vdpau,--disable-vdpau,libvdpau"
129PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx"
130PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264"
131PACKAGECONFIG[x265] = "--enable-libx265,--disable-libx265,x265"
132PACKAGECONFIG[xcb] = "--enable-libxcb,--disable-libxcb,libxcb"
133PACKAGECONFIG[xv] = "--enable-outdev=xv,--disable-outdev=xv,libxv"
134PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib"
135
136# other configuration options
137PACKAGECONFIG[mips32r2] = ",--disable-mipsdsp --disable-mipsdspr2"
138PACKAGECONFIG[pic] = "--enable-pic"
139PACKAGECONFIG[pthreads] = "--enable-pthreads,--disable-pthreads"
140PACKAGECONFIG[shared] = "--enable-shared"
141PACKAGECONFIG[strip] = ",--disable-stripping"
142
143# Check codecs that require --enable-nonfree
144USE_NONFREE = "${@bb.utils.contains_any('PACKAGECONFIG', [ 'openssl' ], 'yes', '', d)}"
145
146def cpu(d):
147 for arg in (d.getVar('TUNE_CCARGS') or '').split():
148 if arg.startswith('-mcpu='):
149 return arg[6:]
150 return 'generic'
151
152EXTRA_OECONF = " \
153 ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree', '', d)} \
154 \
155 --cross-prefix=${TARGET_PREFIX} \
156 \
157 --ld='${CCLD}' \
158 --cc='${CC}' \
159 --cxx='${CXX}' \
160 --arch=${TARGET_ARCH} \
161 --target-os='linux' \
162 --enable-cross-compile \
163 --extra-cflags='${CFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}' \
164 --extra-ldflags='${LDFLAGS}' \
165 --sysroot='${STAGING_DIR_TARGET}' \
166 ${EXTRA_FFCONF} \
167 --libdir=${libdir} \
168 --shlibdir=${libdir} \
169 --datadir=${datadir}/ffmpeg \
170 --cpu=${@cpu(d)} \
171 --pkg-config=pkg-config \
172"
173
174EXTRA_OECONF:append:linux-gnux32 = " --disable-asm"
175
176EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'mipsisa64r6', '--disable-mips64r2 --disable-mips32r2', '', d)}"
177EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'mipsisa64r2', '--disable-mips64r6 --disable-mips32r6', '', d)}"
178EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'mips32r2', '--disable-mips64r6 --disable-mips32r6', '', d)}"
179EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'mips32r6', '--disable-mips64r2 --disable-mips32r2', '', d)}"
180EXTRA_OECONF:append:mips = " --extra-libs=-latomic --disable-mips32r5 --disable-mipsdsp --disable-mipsdspr2 \
181 --disable-loongson2 --disable-loongson3 --disable-mmi --disable-msa"
182EXTRA_OECONF:append:riscv32 = " --extra-libs=-latomic"
183EXTRA_OECONF:append:armv5 = " --extra-libs=-latomic"
184EXTRA_OECONF:append:powerpc = " --extra-libs=-latomic"
185
186# gold crashes on x86, another solution is to --disable-asm but thats more hacky
187# ld.gold: internal error in relocate_section, at ../../gold/i386.cc:3684
188
189LDFLAGS:append:x86 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}"
190
191EXTRA_OEMAKE = "V=1"
192
193do_configure() {
194 ${S}/configure ${EXTRA_OECONF}
195}
196
197# patch out build host paths for reproducibility
198do_compile:prepend:class-target() {
199 sed -i -e "s,${WORKDIR},,g" ${B}/config.h
200}
201
202PACKAGES =+ "libavcodec \
203 libavdevice \
204 libavfilter \
205 libavformat \
206 libavutil \
207 libpostproc \
208 libswresample \
209 libswscale"
210
211FILES:libavcodec = "${libdir}/libavcodec${SOLIBS}"
212FILES:libavdevice = "${libdir}/libavdevice${SOLIBS}"
213FILES:libavfilter = "${libdir}/libavfilter${SOLIBS}"
214FILES:libavformat = "${libdir}/libavformat${SOLIBS}"
215FILES:libavutil = "${libdir}/libavutil${SOLIBS}"
216FILES:libpostproc = "${libdir}/libpostproc${SOLIBS}"
217FILES:libswresample = "${libdir}/libswresample${SOLIBS}"
218FILES:libswscale = "${libdir}/libswscale${SOLIBS}"
219
220# ffmpeg disables PIC on some platforms (e.g. x86-32)
221INSANE_SKIP:${MLPREFIX}libavcodec = "textrel"
222INSANE_SKIP:${MLPREFIX}libavdevice = "textrel"
223INSANE_SKIP:${MLPREFIX}libavfilter = "textrel"
224INSANE_SKIP:${MLPREFIX}libavformat = "textrel"
225INSANE_SKIP:${MLPREFIX}libavutil = "textrel"
226INSANE_SKIP:${MLPREFIX}libswscale = "textrel"
227INSANE_SKIP:${MLPREFIX}libswresample = "textrel"
228INSANE_SKIP:${MLPREFIX}libpostproc = "textrel"