diff options
Diffstat (limited to 'meta/recipes-multimedia/ffmpeg/ffmpeg_5.0.3.bb')
| -rw-r--r-- | meta/recipes-multimedia/ffmpeg/ffmpeg_5.0.3.bb | 228 |
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 @@ | |||
| 1 | SUMMARY = "A complete, cross-platform solution to record, convert and stream audio and video." | ||
| 2 | DESCRIPTION = "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." | ||
| 5 | HOMEPAGE = "https://www.ffmpeg.org/" | ||
| 6 | SECTION = "libs" | ||
| 7 | |||
| 8 | LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later & ISC & MIT & BSD-2-Clause & BSD-3-Clause & IJG" | ||
| 9 | LICENSE:${PN} = "GPL-2.0-or-later" | ||
| 10 | LICENSE:libavcodec = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPL-2.0-or-later', 'LGPL-2.1-or-later', d)}" | ||
| 11 | LICENSE:libavdevice = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPL-2.0-or-later', 'LGPL-2.1-or-later', d)}" | ||
| 12 | LICENSE:libavfilter = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPL-2.0-or-later', 'LGPL-2.1-or-later', d)}" | ||
| 13 | LICENSE:libavformat = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPL-2.0-or-later', 'LGPL-2.1-or-later', d)}" | ||
| 14 | LICENSE:libavutil = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPL-2.0-or-later', 'LGPL-2.1-or-later', d)}" | ||
| 15 | LICENSE:libpostproc = "GPL-2.0-or-later" | ||
| 16 | LICENSE:libswresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPL-2.0-or-later', 'LGPL-2.1-or-later', d)}" | ||
| 17 | LICENSE:libswscale = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPL-2.0-or-later', 'LGPL-2.1-or-later', d)}" | ||
| 18 | LICENSE_FLAGS = "commercial" | ||
| 19 | |||
| 20 | LIC_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 | |||
| 25 | SRC_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 | |||
| 51 | SRC_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 | ||
| 57 | CVE_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 | ||
| 63 | CVE_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 | ||
| 66 | CVE_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 | ||
| 69 | CVE_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 | ||
| 72 | CVE_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 | ||
| 75 | CVE_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 | ||
| 80 | CVE_CHECK_IGNORE += "CVE-2024-7272" | ||
| 81 | |||
| 82 | # Build fails when thumb is enabled: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7717 | ||
| 83 | ARM_INSTRUCTION_SET:armv4 = "arm" | ||
| 84 | ARM_INSTRUCTION_SET:armv5 = "arm" | ||
| 85 | ARM_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 | ||
| 89 | PROVIDES = "libav libpostproc" | ||
| 90 | |||
| 91 | DEPENDS = "nasm-native" | ||
| 92 | |||
| 93 | inherit autotools pkgconfig | ||
| 94 | |||
| 95 | PACKAGECONFIG ??= "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 | ||
| 101 | PACKAGECONFIG[avdevice] = "--enable-avdevice,--disable-avdevice" | ||
| 102 | PACKAGECONFIG[avfilter] = "--enable-avfilter,--disable-avfilter" | ||
| 103 | PACKAGECONFIG[avcodec] = "--enable-avcodec,--disable-avcodec" | ||
| 104 | PACKAGECONFIG[avformat] = "--enable-avformat,--disable-avformat" | ||
| 105 | PACKAGECONFIG[swresample] = "--enable-swresample,--disable-swresample" | ||
| 106 | PACKAGECONFIG[swscale] = "--enable-swscale,--disable-swscale" | ||
| 107 | PACKAGECONFIG[postproc] = "--enable-postproc,--disable-postproc" | ||
| 108 | |||
| 109 | # features to support | ||
| 110 | PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib" | ||
| 111 | PACKAGECONFIG[altivec] = "--enable-altivec,--disable-altivec," | ||
| 112 | PACKAGECONFIG[bzlib] = "--enable-bzlib,--disable-bzlib,bzip2" | ||
| 113 | PACKAGECONFIG[fdk-aac] = "--enable-libfdk-aac --enable-nonfree,--disable-libfdk-aac,fdk-aac" | ||
| 114 | PACKAGECONFIG[gpl] = "--enable-gpl,--disable-gpl" | ||
| 115 | PACKAGECONFIG[gsm] = "--enable-libgsm,--disable-libgsm,libgsm" | ||
| 116 | PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack" | ||
| 117 | PACKAGECONFIG[libopus] = "--enable-libopus,--disable-libopus,libopus" | ||
| 118 | PACKAGECONFIG[libvorbis] = "--enable-libvorbis,--disable-libvorbis,libvorbis" | ||
| 119 | PACKAGECONFIG[lzma] = "--enable-lzma,--disable-lzma,xz" | ||
| 120 | PACKAGECONFIG[mfx] = "--enable-libmfx,--disable-libmfx,intel-mediasdk" | ||
| 121 | PACKAGECONFIG[mp3lame] = "--enable-libmp3lame,--disable-libmp3lame,lame" | ||
| 122 | PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl" | ||
| 123 | PACKAGECONFIG[sdl2] = "--enable-sdl2,--disable-sdl2,virtual/libsdl2" | ||
| 124 | PACKAGECONFIG[speex] = "--enable-libspeex,--disable-libspeex,speex" | ||
| 125 | PACKAGECONFIG[srt] = "--enable-libsrt,--disable-libsrt,srt" | ||
| 126 | PACKAGECONFIG[theora] = "--enable-libtheora,--disable-libtheora,libtheora libogg" | ||
| 127 | PACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva" | ||
| 128 | PACKAGECONFIG[vdpau] = "--enable-vdpau,--disable-vdpau,libvdpau" | ||
| 129 | PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx" | ||
| 130 | PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264" | ||
| 131 | PACKAGECONFIG[x265] = "--enable-libx265,--disable-libx265,x265" | ||
| 132 | PACKAGECONFIG[xcb] = "--enable-libxcb,--disable-libxcb,libxcb" | ||
| 133 | PACKAGECONFIG[xv] = "--enable-outdev=xv,--disable-outdev=xv,libxv" | ||
| 134 | PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib" | ||
| 135 | |||
| 136 | # other configuration options | ||
| 137 | PACKAGECONFIG[mips32r2] = ",--disable-mipsdsp --disable-mipsdspr2" | ||
| 138 | PACKAGECONFIG[pic] = "--enable-pic" | ||
| 139 | PACKAGECONFIG[pthreads] = "--enable-pthreads,--disable-pthreads" | ||
| 140 | PACKAGECONFIG[shared] = "--enable-shared" | ||
| 141 | PACKAGECONFIG[strip] = ",--disable-stripping" | ||
| 142 | |||
| 143 | # Check codecs that require --enable-nonfree | ||
| 144 | USE_NONFREE = "${@bb.utils.contains_any('PACKAGECONFIG', [ 'openssl' ], 'yes', '', d)}" | ||
| 145 | |||
| 146 | def 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 | |||
| 152 | EXTRA_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 | |||
| 174 | EXTRA_OECONF:append:linux-gnux32 = " --disable-asm" | ||
| 175 | |||
| 176 | EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'mipsisa64r6', '--disable-mips64r2 --disable-mips32r2', '', d)}" | ||
| 177 | EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'mipsisa64r2', '--disable-mips64r6 --disable-mips32r6', '', d)}" | ||
| 178 | EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'mips32r2', '--disable-mips64r6 --disable-mips32r6', '', d)}" | ||
| 179 | EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'mips32r6', '--disable-mips64r2 --disable-mips32r2', '', d)}" | ||
| 180 | EXTRA_OECONF:append:mips = " --extra-libs=-latomic --disable-mips32r5 --disable-mipsdsp --disable-mipsdspr2 \ | ||
| 181 | --disable-loongson2 --disable-loongson3 --disable-mmi --disable-msa" | ||
| 182 | EXTRA_OECONF:append:riscv32 = " --extra-libs=-latomic" | ||
| 183 | EXTRA_OECONF:append:armv5 = " --extra-libs=-latomic" | ||
| 184 | EXTRA_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 | |||
| 189 | LDFLAGS:append:x86 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}" | ||
| 190 | |||
| 191 | EXTRA_OEMAKE = "V=1" | ||
| 192 | |||
| 193 | do_configure() { | ||
| 194 | ${S}/configure ${EXTRA_OECONF} | ||
| 195 | } | ||
| 196 | |||
| 197 | # patch out build host paths for reproducibility | ||
| 198 | do_compile:prepend:class-target() { | ||
| 199 | sed -i -e "s,${WORKDIR},,g" ${B}/config.h | ||
| 200 | } | ||
| 201 | |||
| 202 | PACKAGES =+ "libavcodec \ | ||
| 203 | libavdevice \ | ||
| 204 | libavfilter \ | ||
| 205 | libavformat \ | ||
| 206 | libavutil \ | ||
| 207 | libpostproc \ | ||
| 208 | libswresample \ | ||
| 209 | libswscale" | ||
| 210 | |||
| 211 | FILES:libavcodec = "${libdir}/libavcodec${SOLIBS}" | ||
| 212 | FILES:libavdevice = "${libdir}/libavdevice${SOLIBS}" | ||
| 213 | FILES:libavfilter = "${libdir}/libavfilter${SOLIBS}" | ||
| 214 | FILES:libavformat = "${libdir}/libavformat${SOLIBS}" | ||
| 215 | FILES:libavutil = "${libdir}/libavutil${SOLIBS}" | ||
| 216 | FILES:libpostproc = "${libdir}/libpostproc${SOLIBS}" | ||
| 217 | FILES:libswresample = "${libdir}/libswresample${SOLIBS}" | ||
| 218 | FILES:libswscale = "${libdir}/libswscale${SOLIBS}" | ||
| 219 | |||
| 220 | # ffmpeg disables PIC on some platforms (e.g. x86-32) | ||
| 221 | INSANE_SKIP:${MLPREFIX}libavcodec = "textrel" | ||
| 222 | INSANE_SKIP:${MLPREFIX}libavdevice = "textrel" | ||
| 223 | INSANE_SKIP:${MLPREFIX}libavfilter = "textrel" | ||
| 224 | INSANE_SKIP:${MLPREFIX}libavformat = "textrel" | ||
| 225 | INSANE_SKIP:${MLPREFIX}libavutil = "textrel" | ||
| 226 | INSANE_SKIP:${MLPREFIX}libswscale = "textrel" | ||
| 227 | INSANE_SKIP:${MLPREFIX}libswresample = "textrel" | ||
| 228 | INSANE_SKIP:${MLPREFIX}libpostproc = "textrel" | ||
