ffmpeg_4.3.1.bb 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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. LICENSE = "BSD & GPLv2+ & LGPLv2.1+ & MIT"
  8. LICENSE:${PN} = "GPLv2+"
  9. LICENSE:libavcodec = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
  10. LICENSE:libavdevice = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
  11. LICENSE:libavfilter = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
  12. LICENSE:libavformat = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
  13. LICENSE:libavresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
  14. LICENSE:libavutil = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
  15. LICENSE:libpostproc = "GPLv2+"
  16. LICENSE:libswresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
  17. LICENSE:libswscale = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
  18. LICENSE_FLAGS = "commercial"
  19. LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
  20. file://COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
  21. file://COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \
  22. file://COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02"
  23. SRC_URI = "https://www.ffmpeg.org/releases/${BP}.tar.xz \
  24. file://mips64_cpu_detection.patch \
  25. "
  26. SRC_URI[sha256sum] = "ad009240d46e307b4e03a213a0f49c11b650e445b1f8be0dda2a9212b34d2ffb"
  27. # Build fails when thumb is enabled: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7717
  28. ARM_INSTRUCTION_SET:armv4 = "arm"
  29. ARM_INSTRUCTION_SET:armv5 = "arm"
  30. ARM_INSTRUCTION_SET:armv6 = "arm"
  31. # Should be API compatible with libav (which was a fork of ffmpeg)
  32. # libpostproc was previously packaged from a separate recipe
  33. PROVIDES = "libav libpostproc"
  34. DEPENDS = "nasm-native"
  35. inherit autotools pkgconfig
  36. PACKAGECONFIG ??= "avdevice avfilter avcodec avformat swresample swscale postproc avresample \
  37. alsa bzlib lzma openh264 theora zlib \
  38. ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xv xcb', '', d)}"
  39. # libraries to build in addition to avutil
  40. PACKAGECONFIG[avdevice] = "--enable-avdevice,--disable-avdevice"
  41. PACKAGECONFIG[avfilter] = "--enable-avfilter,--disable-avfilter"
  42. PACKAGECONFIG[avcodec] = "--enable-avcodec,--disable-avcodec"
  43. PACKAGECONFIG[avformat] = "--enable-avformat,--disable-avformat"
  44. PACKAGECONFIG[swresample] = "--enable-swresample,--disable-swresample"
  45. PACKAGECONFIG[swscale] = "--enable-swscale,--disable-swscale"
  46. PACKAGECONFIG[postproc] = "--enable-postproc,--disable-postproc"
  47. PACKAGECONFIG[avresample] = "--enable-avresample,--disable-avresample"
  48. # features to support
  49. PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib"
  50. PACKAGECONFIG[altivec] = "--enable-altivec,--disable-altivec,"
  51. PACKAGECONFIG[bzlib] = "--enable-bzlib,--disable-bzlib,bzip2"
  52. PACKAGECONFIG[fdk-aac] = "--enable-libfdk-aac --enable-nonfree,--disable-libfdk-aac,fdk-aac"
  53. PACKAGECONFIG[gpl] = "--enable-gpl,--disable-gpl"
  54. PACKAGECONFIG[gsm] = "--enable-libgsm,--disable-libgsm,libgsm"
  55. PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack"
  56. PACKAGECONFIG[libvorbis] = "--enable-libvorbis,--disable-libvorbis,libvorbis"
  57. PACKAGECONFIG[lzma] = "--enable-lzma,--disable-lzma,xz"
  58. PACKAGECONFIG[mfx] = "--enable-libmfx,--disable-libmfx,intel-mediasdk"
  59. PACKAGECONFIG[mp3lame] = "--enable-libmp3lame,--disable-libmp3lame,lame"
  60. PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl"
  61. PACKAGECONFIG[openh264] = "--enable-libopenh264,--disable-libopenh264,openh264"
  62. PACKAGECONFIG[sdl2] = "--enable-sdl2,--disable-sdl2,virtual/libsdl2"
  63. PACKAGECONFIG[speex] = "--enable-libspeex,--disable-libspeex,speex"
  64. PACKAGECONFIG[theora] = "--enable-libtheora,--disable-libtheora,libtheora libogg"
  65. PACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva"
  66. PACKAGECONFIG[vdpau] = "--enable-vdpau,--disable-vdpau,libvdpau"
  67. PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx"
  68. PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264"
  69. PACKAGECONFIG[x265] = "--enable-libx265,--disable-libx265,x265"
  70. PACKAGECONFIG[xcb] = "--enable-libxcb,--disable-libxcb,libxcb"
  71. PACKAGECONFIG[xv] = "--enable-outdev=xv,--disable-outdev=xv,libxv"
  72. PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib"
  73. # Check codecs that require --enable-nonfree
  74. USE_NONFREE = "${@bb.utils.contains_any('PACKAGECONFIG', [ 'openssl' ], 'yes', '', d)}"
  75. def cpu(d):
  76. for arg in (d.getVar('TUNE_CCARGS') or '').split():
  77. if arg.startswith('-mcpu='):
  78. return arg[6:]
  79. return 'generic'
  80. EXTRA_OECONF = " \
  81. --disable-stripping \
  82. --enable-pic \
  83. --enable-shared \
  84. --enable-pthreads \
  85. ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree', '', d)} \
  86. \
  87. --cross-prefix=${TARGET_PREFIX} \
  88. \
  89. --ld="${CCLD}" \
  90. --cc="${CC}" \
  91. --cxx="${CXX}" \
  92. --arch=${TARGET_ARCH} \
  93. --target-os="linux" \
  94. --enable-cross-compile \
  95. --extra-cflags="${CFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" \
  96. --extra-ldflags="${LDFLAGS}" \
  97. --sysroot="${STAGING_DIR_TARGET}" \
  98. ${EXTRA_FFCONF} \
  99. --libdir=${libdir} \
  100. --shlibdir=${libdir} \
  101. --datadir=${datadir}/ffmpeg \
  102. ${@bb.utils.contains('AVAILTUNES', 'mips32r2', '', '--disable-mipsdsp --disable-mipsdspr2', d)} \
  103. --cpu=${@cpu(d)} \
  104. --pkg-config=pkg-config \
  105. "
  106. EXTRA_OECONF:append:linux-gnux32 = " --disable-asm"
  107. # gold crashes on x86, another solution is to --disable-asm but thats more hacky
  108. # ld.gold: internal error in relocate_section, at ../../gold/i386.cc:3684
  109. LDFLAGS:append:x86 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}"
  110. EXTRA_OEMAKE = "V=1"
  111. do_configure() {
  112. ${S}/configure ${EXTRA_OECONF}
  113. }
  114. PACKAGES =+ "libavcodec \
  115. libavdevice \
  116. libavfilter \
  117. libavformat \
  118. libavresample \
  119. libavutil \
  120. libpostproc \
  121. libswresample \
  122. libswscale"
  123. FILES:libavcodec = "${libdir}/libavcodec${SOLIBS}"
  124. FILES:libavdevice = "${libdir}/libavdevice${SOLIBS}"
  125. FILES:libavfilter = "${libdir}/libavfilter${SOLIBS}"
  126. FILES:libavformat = "${libdir}/libavformat${SOLIBS}"
  127. FILES:libavresample = "${libdir}/libavresample${SOLIBS}"
  128. FILES:libavutil = "${libdir}/libavutil${SOLIBS}"
  129. FILES:libpostproc = "${libdir}/libpostproc${SOLIBS}"
  130. FILES:libswresample = "${libdir}/libswresample${SOLIBS}"
  131. FILES:libswscale = "${libdir}/libswscale${SOLIBS}"
  132. # ffmpeg disables PIC on some platforms (e.g. x86-32)
  133. INSANE_SKIP:${MLPREFIX}libavcodec = "textrel"
  134. INSANE_SKIP:${MLPREFIX}libavdevice = "textrel"
  135. INSANE_SKIP:${MLPREFIX}libavfilter = "textrel"
  136. INSANE_SKIP:${MLPREFIX}libavformat = "textrel"
  137. INSANE_SKIP:${MLPREFIX}libavutil = "textrel"
  138. INSANE_SKIP:${MLPREFIX}libavresample = "textrel"
  139. INSANE_SKIP:${MLPREFIX}libswscale = "textrel"
  140. INSANE_SKIP:${MLPREFIX}libswresample = "textrel"
  141. INSANE_SKIP:${MLPREFIX}libpostproc = "textrel"