--enable-filter=NAME enable filter NAME
--disable-filter=NAME disable filter NAME
--disable-filters disable all filters
+ --disable-v4l2_m2m disable V4L2 mem2mem code [autodetect]
External library support:
themselves, not all their features will necessarily be usable by FFmpeg.
--disable-alsa disable ALSA support [autodetect]
+ --disable-appkit disable Apple AppKit framework [autodetect]
--disable-avfoundation disable Apple AVFoundation framework [autodetect]
--enable-avisynth enable reading of AviSynth script files [no]
--disable-bzlib disable bzlib [autodetect]
--enable-libxcb-shape enable X11 grabbing shape rendering [autodetect]
--enable-libxvid enable Xvid encoding via xvidcore,
native MPEG-4/Xvid encoder exists [no]
+ --enable-libxml2 enable XML parsing using the C library libxml2 [no]
--enable-libzimg enable z.lib, needed for zscale filter [no]
--enable-libzmq enable message passing via libzmq [no]
--enable-libzvbi enable teletext support via libzvbi [no]
--disable-cuvid disable Nvidia CUVID support [autodetect]
--disable-d3d11va disable Microsoft Direct3D 11 video acceleration code [autodetect]
--disable-dxva2 disable Microsoft DirectX 9 video acceleration code [autodetect]
+ --enable-libdrm enable DRM code (Linux) [no]
--enable-libmfx enable Intel MediaSDK (AKA Quick Sync Video) code via libmfx [no]
--enable-libnpp enable Nvidia Performance Primitives-based code [no]
--enable-mmal enable Broadcom Multi-Media Abstraction Layer (Raspberry Pi) via MMAL [no]
check_lib_cpp "$headers" "$classes" "$@" || die "ERROR: $name not found"
}
+require_header(){
+ log require "$@"
+ header="$1"
+ shift
+ check_header "$header" "$@" || die "ERROR: $header header not found"
+}
+
+require_cpp_condition(){
+ log require "$@"
+ header="$1"
+ condition="$2"
+ shift 2
+ check_cpp_condition "$header" "$condition" "$@" || die "ERROR: $condition not satisfied"
+}
+
use_pkg_config(){
log use_pkg_config "$@"
pkg="$1"
EXTERNAL_AUTODETECT_LIBRARY_LIST="
alsa
+ appkit
avfoundation
bzlib
coreimage
libcaca
libcelt
libdc1394
+ libdrm
libflite
libfontconfig
libfreetype
libvpx
libwavpack
libwebp
+ libxml2
libzimg
libzmq
libzvbi
openal
opencl
opengl
- videotoolbox
"
HWACCEL_AUTODETECT_LIBRARY_LIST="
vaapi
vda
vdpau
- videotoolbox_hwaccel
+ videotoolbox
+ v4l2_m2m
xvmc
"
vp3dsp
vp56dsp
vp8dsp
- vt_bt2020
wma_freqs
wmv2dsp
"
qsvdec_select="qsv"
qsvenc_select="qsv"
vaapi_encode_deps="vaapi"
+v4l2_m2m_deps_any="linux_videodev2_h"
hwupload_cuda_filter_deps="cuda"
scale_npp_filter_deps="cuda libnpp"
scale_cuda_filter_deps="cuda_sdk"
+thumbnail_cuda_filter_deps="cuda_sdk"
nvenc_deps="cuda"
nvenc_deps_any="dlopen LoadLibrary"
nvenc_encoder_deps="nvenc"
+h263_v4l2m2m_decoder_deps="v4l2_m2m h263_v4l2_m2m"
+h263_v4l2m2m_encoder_deps="v4l2_m2m h263_v4l2_m2m"
h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
h264_cuvid_decoder_deps="cuda cuvid"
h264_cuvid_decoder_select="h264_mp4toannexb_bsf"
h264_vda_decoder_select="h264_decoder"
h264_vdpau_decoder_deps="vdpau"
h264_vdpau_decoder_select="h264_decoder"
+h264_v4l2m2m_decoder_deps="v4l2_m2m h264_v4l2_m2m"
+h264_v4l2m2m_encoder_deps="v4l2_m2m h264_v4l2_m2m"
hevc_cuvid_decoder_deps="cuda cuvid"
hevc_cuvid_decoder_select="hevc_mp4toannexb_bsf"
hevc_mediacodec_decoder_deps="mediacodec"
hevc_qsv_encoder_select="hevcparse qsvenc"
hevc_vaapi_encoder_deps="VAEncPictureParameterBufferHEVC"
hevc_vaapi_encoder_select="vaapi_encode golomb"
+hevc_v4l2m2m_decoder_deps="v4l2_m2m hevc_v4l2_m2m"
+hevc_v4l2m2m_encoder_deps="v4l2_m2m hevc_v4l2_m2m"
mjpeg_cuvid_decoder_deps="cuda cuvid"
mjpeg_vaapi_encoder_deps="VAEncPictureParameterBufferJPEG"
mjpeg_vaapi_encoder_select="vaapi_encode jpegtables"
mpeg1_cuvid_decoder_deps="cuda cuvid"
mpeg1_vdpau_decoder_deps="vdpau"
mpeg1_vdpau_decoder_select="mpeg1video_decoder"
+mpeg1_v4l2m2m_decoder_deps="v4l2_m2m mpeg1_v4l2_m2m"
mpeg2_crystalhd_decoder_select="crystalhd"
mpeg2_cuvid_decoder_deps="cuda cuvid"
mpeg2_mmal_decoder_deps="mmal"
mpeg2_qsv_encoder_select="qsvenc"
mpeg2_vaapi_encoder_deps="VAEncPictureParameterBufferMPEG2"
mpeg2_vaapi_encoder_select="vaapi_encode"
+mpeg2_v4l2m2m_decoder_deps="v4l2_m2m mpeg2_v4l2_m2m"
mpeg4_crystalhd_decoder_select="crystalhd"
mpeg4_cuvid_decoder_deps="cuda cuvid"
mpeg4_mediacodec_decoder_deps="mediacodec"
mpeg4_omx_encoder_deps="omx"
mpeg4_vdpau_decoder_deps="vdpau"
mpeg4_vdpau_decoder_select="mpeg4_decoder"
+mpeg4_v4l2m2m_decoder_deps="v4l2_m2m mpeg4_v4l2_m2m"
+mpeg4_v4l2m2m_encoder_deps="v4l2_m2m mpeg4_v4l2_m2m"
mpeg_vdpau_decoder_deps="vdpau"
mpeg_vdpau_decoder_select="mpeg2video_decoder"
msmpeg4_crystalhd_decoder_select="crystalhd"
vc1_mmal_decoder_deps="mmal"
vc1_vdpau_decoder_deps="vdpau"
vc1_vdpau_decoder_select="vc1_decoder"
+vc1_v4l2m2m_decoder_deps="v4l2_m2m vc1_v4l2_m2m"
vp8_cuvid_decoder_deps="cuda cuvid"
vp8_mediacodec_decoder_deps="mediacodec"
vp8_qsv_decoder_deps="libmfx"
vp8_qsv_decoder_select="qsvdec vp8_qsv_hwaccel vp8_parser"
vp8_vaapi_encoder_deps="VAEncPictureParameterBufferVP8"
vp8_vaapi_encoder_select="vaapi_encode"
+vp8_v4l2m2m_decoder_deps="v4l2_m2m vp8_v4l2_m2m"
+vp8_v4l2m2m_encoder_deps="v4l2_m2m vp8_v4l2_m2m"
vp9_cuvid_decoder_deps="cuda cuvid"
vp9_mediacodec_decoder_deps="mediacodec"
vp9_vaapi_encoder_deps="VAEncPictureParameterBufferVP9"
vp9_vaapi_encoder_select="vaapi_encode"
+vp9_v4l2m2m_decoder_deps="v4l2_m2m vp9_v4l2_m2m"
wmv3_crystalhd_decoder_select="crystalhd"
wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
libxavs_encoder_deps="libxavs"
libxvid_encoder_deps="libxvid"
libzvbi_teletext_decoder_deps="libzvbi"
-videotoolbox_deps="VideoToolbox_VideoToolbox_h"
videotoolbox_extralibs="-framework CoreFoundation -framework VideoToolbox -framework CoreMedia -framework CoreVideo"
videotoolbox_encoder_deps="videotoolbox VTCompressionSessionPrepareToEncodeFrames"
-videotoolbox_encoder_suggest="vda_framework vt_bt2020"
-vt_bt2020_deps="kCVImageBufferColorPrimaries_ITU_R_2020"
+videotoolbox_encoder_suggest="vda_framework"
# demuxers / muxers
ac3_demuxer_select="ac3_parser"
caf_demuxer_select="iso_media riffdec"
caf_muxer_select="iso_media"
dash_muxer_select="mp4_muxer"
+dash_demuxer_deps="libxml2"
dirac_demuxer_select="dirac_parser"
dts_demuxer_select="dca_parser"
dtshd_demuxer_select="dca_parser"
iec61883_indev_deps="libiec61883"
jack_indev_deps="jack"
jack_indev_deps_any="sem_timedwait dispatch_dispatch_h"
+kmsgrab_indev_deps="libdrm"
lavfi_indev_deps="avfilter"
libcdio_indev_deps="libcdio"
libdc1394_indev_deps="libdc1394"
v4l2_outdev_deps_any="linux_videodev2_h sys_videoio_h"
vfwcap_indev_deps="vfw32 vfwcap_defines"
xcbgrab_indev_deps="libxcb"
+xcbgrab_indev_suggest="libxcb_shm libxcb_shape libxcb_xfixes"
xv_outdev_deps="X11_extensions_Xvlib_h XvGetPortAttribute"
xv_outdev_extralibs="-lXv -lX11 -lXext"
boxblur_filter_deps="gpl"
bs2b_filter_deps="libbs2b"
colormatrix_filter_deps="gpl"
-coreimage_filter_deps="coreimage"
-coreimage_filter_extralibs="-framework OpenGL -framework AppKit"
-coreimagesrc_filter_deps="coreimage"
-coreimagesrc_filter_extralibs="-framework OpenGL -framework AppKit"
+coreimage_filter_deps="coreimage appkit"
+coreimage_filter_extralibs="-framework OpenGL"
+coreimagesrc_filter_deps="coreimage appkit"
+coreimagesrc_filter_extralibs="-framework OpenGL"
cover_rect_filter_deps="avcodec avformat gpl"
cropdetect_filter_deps="gpl"
deinterlace_qsv_filter_deps="libmfx"
tinterlace_filter_deps="gpl"
tinterlace_merge_test_deps="tinterlace_filter"
tinterlace_pad_test_deps="tinterlace_filter"
+tonemap_filter_deps="const_nan"
uspp_filter_deps="gpl avcodec"
vaguedenoiser_filter_deps="gpl"
vidstabdetect_filter_deps="libvidstab"
libvmaf_filter_deps="libvmaf"
zmq_filter_deps="libzmq"
zoompan_filter_deps="swscale"
-zscale_filter_deps="libzimg"
+zscale_filter_deps="libzimg const_nan"
scale_vaapi_filter_deps="vaapi VAProcPipelineParameterBuffer"
# examples
avdevice_deps="avformat avcodec avutil"
avfilter_deps="avutil"
avformat_deps="avcodec avutil"
+avformat_suggest="network"
avresample_deps="avutil"
postproc_deps="avutil gpl"
swresample_deps="avutil"
probe_libc host_
test -n "$host_libc_type" && enable host_libc_$host_libc_type
+# hacks for compiler/libc/os combinations
+
case $libc_type in
bionic)
add_compat strtod.o strtod=avpriv_strtod
;;
+ glibc)
+ if enabled tms470; then
+ CPPFLAGS="-I${source_path}/compat/tms470 ${CPPFLAGS}"
+ add_cppflags -D__USER_LABEL_PREFIX__=
+ add_cppflags -D__builtin_memset=memset
+ add_cppflags -D__gnuc_va_list=va_list -D_VA_LIST_DEFINED
+ add_cflags -pds=48 # incompatible redefinition of macro
+ elif enabled ccc; then
+ add_ldflags -Wl,-z,now # calls to libots crash without this
+ fi
+ ;;
esac
-# hacks for compiler/libc/os combinations
-
-if enabled_all tms470 libc_glibc; then
- CPPFLAGS="-I${source_path}/compat/tms470 ${CPPFLAGS}"
- add_cppflags -D__USER_LABEL_PREFIX__=
- add_cppflags -D__builtin_memset=memset
- add_cppflags -D__gnuc_va_list=va_list -D_VA_LIST_DEFINED
- add_cflags -pds=48 # incompatible redefinition of macro
-fi
-
-if enabled_all ccc libc_glibc; then
- add_ldflags -Wl,-z,now # calls to libots crash without this
-fi
-
check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" ||
add_cppflags '-I\$(SRC_PATH)/compat/float'
sym=$($nm $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
extern_prefix=${sym%%ff_extern*}
-check_cc <<EOF && enable_weak inline_asm
-void foo(void) { __asm__ volatile ("" ::); }
-EOF
+check_inline_asm inline_asm '"" ::'
_restrict=
for restrict_keyword in restrict __restrict__ __restrict; do
EOF
od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
+check_cc <<EOF && enable const_nan
+#include <math.h>
+void foo(void) { struct { double d; } static const bar[] = { { NAN } }; }
+EOF
+
if ! enabled ppc64 || enabled bigendian; then
disable vsx
fi
check_header unistd.h
check_header valgrind/valgrind.h
check_header VideoDecodeAcceleration/VDADecoder.h
-check_header VideoToolbox/VideoToolbox.h
check_func_headers VideoToolbox/VTCompressionSession.h VTCompressionSessionPrepareToEncodeFrames -framework VideoToolbox
-enabled videotoolbox && check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferColorPrimaries_ITU_R_2020 -framework CoreVideo
check_header windows.h
check_header X11/extensions/XvMClib.h
check_header asm/types.h
check_lib wincrypt "windows.h wincrypt.h" CryptGenRandom -ladvapi32
check_lib psapi "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
-check_lib coreservices "CoreServices/CoreServices.h" UTGetOSTypeFromString "-framework CoreServices"
-
+enabled appkit && check_apple_framework AppKit
enabled audiotoolbox && check_apple_framework AudioToolbox
enabled avfoundation && check_apple_framework AVFoundation
enabled coreimage && check_apple_framework CoreImage
+enabled videotoolbox && check_apple_framework VideoToolbox
enabled avfoundation && {
check_lib avfoundation CoreGraphics/CoreGraphics.h CGGetActiveDisplayList "-framework CoreGraphics" ||
check_lib avfoundation ApplicationServices/ApplicationServices.h CGGetActiveDisplayList "-framework ApplicationServices"; }
+enabled videotoolbox &&
+ check_lib coreservices CoreServices/CoreServices.h UTGetOSTypeFromString "-framework CoreServices"
check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
enabled cuvid && { enabled cuda ||
die "ERROR: CUVID requires CUDA"; }
enabled chromaprint && require chromaprint chromaprint.h chromaprint_get_version -lchromaprint
-enabled decklink && { { check_header DeckLinkAPI.h || die "ERROR: DeckLinkAPI.h header not found"; } &&
+enabled decklink && { require_header DeckLinkAPI.h &&
{ check_cpp_condition DeckLinkAPIVersion.h "BLACKMAGIC_DECKLINK_API_VERSION >= 0x0a060100" || die "ERROR: Decklink API version must be >= 10.6.1."; } }
-enabled libndi_newtek && { check_header Processing.NDI.Lib.h || die "ERROR: Processing.NDI.Lib.h header not found"; }
-enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
+enabled libndi_newtek && require_header Processing.NDI.Lib.h
+enabled frei0r && require_header frei0r.h
enabled gmp && require gmp gmp.h mpz_export -lgmp
enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
enabled jni && { [ $target_os = "android" ] && check_header jni.h && enabled pthreads || die "ERROR: jni not found"; }
-enabled ladspa && { check_header ladspa.h || die "ERROR: ladspa.h header not found"; }
+enabled ladspa && require_header ladspa.h
enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
enabled libass && require_pkg_config libass ass/ass.h ass_library_init
enabled libbluray && require_pkg_config libbluray libbluray/bluray.h bd_open
die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
enabled libcaca && require_pkg_config caca caca.h caca_create_canvas
enabled libdc1394 && require_pkg_config libdc1394-2 dc1394/dc1394.h dc1394_new
+enabled libdrm && require_pkg_config libdrm xf86drm.h drmGetVersion
enabled libfdk_aac && { use_pkg_config 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 libx264 && { use_pkg_config x264 "stdint.h x264.h" x264_encoder_encode ||
{ require libx264 "stdint.h x264.h" x264_encoder_encode -lx264 &&
warn "using libx264 without pkg-config"; } } &&
- { check_cpp_condition x264.h "X264_BUILD >= 118" ||
- die "ERROR: libx264 must be installed and version must be >= 0.118."; } &&
+ require_cpp_condition x264.h "X264_BUILD >= 118" &&
{ check_cpp_condition x264.h "X264_MPEG2" &&
enable libx262; }
enabled libx265 && require_pkg_config x265 x265.h x265_api_get &&
- { check_cpp_condition x265.h "X265_BUILD >= 68" ||
- die "ERROR: libx265 version must be >= 68."; }
+ require_cpp_condition x265.h "X265_BUILD >= 68"
enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode -lxavs
enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
enabled libzimg && require_pkg_config "zimg >= 2.3.0" zimg.h zimg_get_api_version
enabled libzvbi && require libzvbi libzvbi.h vbi_decoder_new -lzvbi &&
{ check_cpp_condition libzvbi.h "VBI_VERSION_MAJOR > 0 || VBI_VERSION_MINOR > 2 || VBI_VERSION_MINOR == 2 && VBI_VERSION_MICRO >= 28" ||
enabled gpl || die "ERROR: libzvbi requires version 0.2.28 or --enable-gpl."; }
+enabled libxml2 && require_pkg_config libxml-2.0 libxml2/libxml/xmlversion.h xmlCheckVersion
enabled mediacodec && { enabled jni || die "ERROR: mediacodec requires --enable-jni"; }
enabled mmal && { check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ||
{ ! enabled cross_compile &&
enabled omx_rpi && { check_header OMX_Core.h ||
{ ! enabled cross_compile && add_cflags -isystem/opt/vc/include/IL && check_header OMX_Core.h ; } ||
die "ERROR: OpenMAX IL headers not found"; }
-enabled omx && { check_header OMX_Core.h || die "ERROR: OpenMAX IL headers not found"; }
+enabled omx && require_header OMX_Core.h
enabled openssl && { use_pkg_config openssl openssl/ssl.h OPENSSL_init_ssl ||
use_pkg_config openssl openssl/ssl.h SSL_library_init ||
check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto ||
pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout
+# check V4L2 codecs available in the API
check_header linux/fb.h
check_header linux/videodev2.h
check_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
+check_code cc linux/videodev2.h "int i = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_VIDEO_M2M | V4L2_BUF_FLAG_LAST;" || disable v4l2_m2m
+check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_VC1_ANNEX_G;" && enable vc1_v4l2_m2m
+check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG1;" && enable mpeg1_v4l2_m2m
+check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG2;" && enable mpeg2_v4l2_m2m
+check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG4;" && enable mpeg4_v4l2_m2m
+check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_HEVC;" && enable hevc_v4l2_m2m
+check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_H263;" && enable h263_v4l2_m2m
+check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_H264;" && enable h264_v4l2_m2m
+check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_VP8;" && enable vp8_v4l2_m2m
+check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_VP9;" && enable vp9_v4l2_m2m
check_header sys/videoio.h
check_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
struct_name=$2
name=$3
shift 3
- echo "static const $struct_name *$name[] = {" > $TMPH
+ echo "static const $struct_name * const $name[] = {" > $TMPH
for c in $*; do
enabled $c && printf " &ff_%s,\n" $c >> $TMPH
done