--enable-gray enable full grayscale support (slower color)
--disable-swscale-alpha disable alpha channel support in swscale
--disable-all disable building components, libraries and programs
- --enable-incompatible-libav-abi enable incompatible Libav fork ABI [no]
--enable-raise-major increase major version numbers in sonames [no]
Program options:
--enable-libcdio enable audio CD grabbing with libcdio [no]
--enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
and libraw1394 [no]
- --enable-libebur128 enable libebur128 for EBU R128 measurement,
- needed for loudnorm filter [no]
--enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
--enable-libflite enable flite (voice synthesis) support via libflite [no]
--enable-libfontconfig enable libfontconfig, useful for drawtext filter [no]
The following libraries provide various hardware acceleration features:
--disable-audiotoolbox disable Apple AudioToolbox code [autodetect]
- --enable-cuda enable dynamically linked Nvidia CUDA code [no]
- --enable-cuvid enable Nvidia CUVID support [autodetect]
+ --disable-cuda disable dynamically linked Nvidia CUDA code [autodetect]
+ --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-libmfx enable Intel MediaSDK (AKA Quick Sync Video) code via libmfx [no]
for hdr in $headers; do
print_include $hdr
done
+ echo "#include <stdint.h>"
for func in $funcs; do
echo "long check_$func(void) { return (long) $func; }"
done
- echo "int main(void) { return 0; }"
+ echo "int main(void) { int ret = 0;"
+ # LTO could optimize out the test functions without this
+ for func in $funcs; do
+ echo " ret |= ((intptr_t)check_$func) & 0xFFFF;"
+ done
+ echo "return ret; }"
} | check_ld "cc" "$@" && enable $funcs && enable_safe $headers
}
EOF
}
+test_cflags_cpp(){
+ log test_cflags_cpp "$@"
+ flags=$1
+ condition=$2
+ shift 2
+ set -- $($cflags_filter "$flags")
+ check_cpp "$@" <<EOF
+#if !($condition)
+#error "unsatisfied condition: $condition"
+#endif
+EOF
+}
+
check_lib(){
log check_lib "$@"
header="$1"
libcdio
libcelt
libdc1394
- libebur128
libfdk_aac
libflite
libfontconfig
$PROGRAM_LIST
$SUBSYSTEM_LIST
fontconfig
- incompatible_libav_abi
memalign_hack
memory_poisoning
neon_clobber_test
HAVE_LIST_PUB="
bigendian
fast_unaligned
- incompatible_libav_abi
"
HEADERS_LIST="
asm_types_h
cdio_paranoia_h
cdio_paranoia_paranoia_h
+ cuda_h
dispatch_dispatch_h
dev_bktr_ioctl_bt848_h
dev_bktr_ioctl_meteor_h
poll_h
sndio_h
soundcard_h
+ stdatomic_h
sys_mman_h
sys_param_h
sys_resource_h
h263dsp
h264chroma
h264dsp
+ h264parse
h264pred
h264qpel
hpeldsp
h263i_decoder_select="h263_decoder"
h263p_decoder_select="h263_decoder"
h263p_encoder_select="h263_encoder"
-h264_decoder_select="cabac golomb h264chroma h264dsp h264pred h264qpel videodsp"
+h264_decoder_select="cabac golomb h264chroma h264dsp h264parse h264pred h264qpel videodsp"
h264_decoder_suggest="error_resilience"
hap_decoder_select="snappy texturedsp"
hap_encoder_deps="libsnappy"
sp5x_decoder_select="mjpeg_decoder"
svq1_decoder_select="hpeldsp"
svq1_encoder_select="aandcttables hpeldsp me_cmp mpegvideoenc"
-svq3_decoder_select="golomb h264dsp h264pred hpeldsp tpeldsp videodsp"
+svq3_decoder_select="golomb h264dsp h264parse h264pred hpeldsp tpeldsp videodsp"
svq3_decoder_suggest="zlib"
tak_decoder_select="audiodsp"
tdsc_decoder_select="zlib mjpeg_decoder"
# hardware accelerators
crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
+cuda_deps_any="dlopen LoadLibrary"
cuvid_deps="cuda"
d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder ID3D11VideoContext"
dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode"
+dxva2_extralibs="-luser32"
vaapi_deps="va_va_h"
vda_framework_deps="VideoDecodeAcceleration_VDADecoder_h"
vda_framework_extralibs="-framework VideoDecodeAcceleration"
videotoolbox_hwaccel_extralibs="-framework QuartzCore"
xvmc_deps="X11_extensions_XvMClib_h"
-h263_cuvid_hwaccel_deps="cuda cuvid"
h263_vaapi_hwaccel_deps="vaapi"
h263_vaapi_hwaccel_select="h263_decoder"
h263_videotoolbox_hwaccel_deps="videotoolbox"
mpeg2_xvmc_hwaccel_select="mpeg2video_decoder"
mpeg4_crystalhd_decoder_select="crystalhd"
mpeg4_cuvid_hwaccel_deps="cuda cuvid"
+mpeg4_mediacodec_decoder_deps="mediacodec"
+mpeg4_mediacodec_hwaccel_deps="mediacodec"
mpeg4_mmal_decoder_deps="mmal"
mpeg4_mmal_decoder_select="mmal"
mpeg4_mmal_hwaccel_deps="mmal"
vc1_vdpau_hwaccel_select="vc1_decoder"
vp8_cuvid_hwaccel_deps="cuda cuvid"
vp9_cuvid_hwaccel_deps="cuda cuvid"
+vp8_mediacodec_decoder_deps="mediacodec"
+vp8_mediacodec_hwaccel_deps="mediacodec"
vp9_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_VP9"
vp9_d3d11va_hwaccel_select="vp9_decoder"
vp9_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_VP9"
vp9_dxva2_hwaccel_select="vp9_decoder"
+vp9_mediacodec_decoder_deps="mediacodec"
+vp9_mediacodec_hwaccel_deps="mediacodec"
vp9_vaapi_hwaccel_deps="vaapi VADecPictureParameterBufferVP9"
vp9_vaapi_hwaccel_select="vp9_decoder"
wmv3_crystalhd_decoder_select="crystalhd"
hwupload_cuda_filter_deps="cuda"
scale_npp_filter_deps="cuda libnpp"
+nvenc_deps="cuda"
nvenc_deps_any="dlopen LoadLibrary"
nvenc_encoder_deps="nvenc"
-h263_cuvid_decoder_deps="cuda cuvid"
-h263_cuvid_decoder_select="h263_cuvid_hwaccel"
h264_cuvid_decoder_deps="cuda cuvid"
h264_cuvid_decoder_select="h264_mp4toannexb_bsf h264_cuvid_hwaccel"
h264_nvenc_encoder_deps="nvenc"
vp9_cuvid_decoder_select="vp9_cuvid_hwaccel"
# parsers
-h264_parser_select="golomb h264dsp"
+h264_parser_select="golomb h264dsp h264parse"
hevc_parser_select="golomb"
mpegvideo_parser_select="mpegvideo"
mpeg4video_parser_select="h263dsp mpegvideo qpeldsp"
adpcm_ima_qt_at_decoder_deps="audiotoolbox"
alac_at_decoder_deps="audiotoolbox"
amr_nb_at_decoder_deps="audiotoolbox"
+avisynth_deps_any="dlopen LoadLibrary"
+avisynth_demuxer_deps="avisynth"
+avisynth_demuxer_select="riffdec"
eac3_at_decoder_deps="audiotoolbox"
eac3_at_decoder_select="ac3_parser"
gsm_ms_at_decoder_deps="audiotoolbox"
asf_stream_muxer_select="asf_muxer"
avi_demuxer_select="iso_media riffdec exif"
avi_muxer_select="riffenc"
-avisynth_demuxer_deps="avisynth"
-avisynth_demuxer_select="riffdec"
caf_demuxer_select="iso_media riffdec"
dash_muxer_select="mp4_muxer"
dirac_demuxer_select="dirac_parser"
delogo_filter_deps="gpl"
deshake_filter_select="pixelutils"
drawtext_filter_deps="libfreetype"
-ebur128_filter_deps="gpl"
eq_filter_deps="gpl"
fftfilt_filter_deps="avcodec"
fftfilt_filter_select="rdft"
interlace_filter_deps="gpl"
kerndeint_filter_deps="gpl"
ladspa_filter_deps="ladspa dlopen"
-loudnorm_filter_deps="libebur128"
mcdeint_filter_deps="avcodec gpl"
movie_filter_deps="avcodec avformat"
mpdecimate_filter_deps="gpl"
filter_audio_example_deps="avfilter avutil"
filtering_audio_example_deps="avfilter avcodec avformat avutil"
filtering_video_example_deps="avfilter avcodec avformat avutil"
-http_multiclient_example_deps="avformat avutil"
+http_multiclient_example_deps="avformat avutil fork"
metadata_example_deps="avformat avutil"
muxing_example_deps="avcodec avformat avutil swscale"
qsvdec_example_deps="avcodec avutil libmfx h264_qsv_decoder vaapi_x11"
enable d3d11va dxva2 vaapi vda vdpau videotoolbox_hwaccel xvmc
enable xlib
-enable nvenc vda_framework videotoolbox videotoolbox_encoder
+enable cuda cuvid nvenc vda_framework videotoolbox videotoolbox_encoder
# build settings
SHFLAGS='-shared -Wl,-soname,$$(@F)'
add_cppflags -D_ISOC99_SOURCE
add_cxxflags -D__STDC_CONSTANT_MACROS
add_cxxflags -std=c++98
-check_cflags -std=c99
+
+# some compilers silently accept -std=c11, so we also need to check that the
+# version macro is defined properly
+if test_cflags_cpp -std=c11 "__STDC_VERSION__ >= 201112L"; then
+ add_cflags -std=c11
+else
+ check_cflags -std=c99
+fi
+
check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
#include <stdlib.h>
EOF
die_license_disabled gpl libxvid
die_license_disabled gpl x11grab
-die_license_disabled nonfree cuda
-die_license_disabled nonfree cuvid
die_license_disabled nonfree libnpp
enabled gpl && die_license_disabled_gpl nonfree libfdk_aac
enabled gpl && die_license_disabled_gpl nonfree openssl
ldl=-ldl
fi
+avisynth_demuxer_extralibs='$ldl'
+cuda_extralibs='$ldl'
decklink_outdev_extralibs="$decklink_outdev_extralibs $ldl"
decklink_indev_extralibs="$decklink_indev_extralibs $ldl"
frei0r_filter_extralibs='$ldl'
check_header X11/extensions/XvMClib.h
check_header asm/types.h
+# it seems there are versions of clang in some distros that try to use the
+# gcc headers, which explodes for stdatomic
+# so we also check that atomics actually work here
+check_builtin stdatomic_h stdatomic.h "atomic_int foo; atomic_store(&foo, 0)"
+
check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32
check_lib2 "windows.h wincrypt.h" CryptGenRandom -ladvapi32
check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
eval check_complexfunc $func \${${func}_args:-1}
done
-# Enable CUVID by default if CUDA is enabled
-if enabled cuda && ! disabled cuvid; then
- enable cuvid
-fi
-
# these are off by default, so fail if requested and not available
enabled avfoundation_indev && { check_header_objcc AVFoundation/AVFoundation.h || disable avfoundation_indev; }
enabled avfoundation_indev && { check_lib2 CoreGraphics/CoreGraphics.h CGGetActiveDisplayList -framework CoreGraphics ||
check_lib2 ApplicationServices/ApplicationServices.h CGGetActiveDisplayList -framework ApplicationServices; }
-enabled avisynth && { { check_lib2 "windows.h" LoadLibrary; } ||
- { check_lib2 "dlfcn.h" dlopen -ldl; } ||
- die "ERROR: LoadLibrary/dlopen not found for avisynth"; }
-enabled cuda && { check_lib cuda.h cuInit -lcuda ||
- die "ERROR: CUDA not found"; }
-enabled cuvid && { add_cflags -I$source_path;
- check_lib "compat/cuda/cuviddec.h" cuvidCreateDecoder -lnvcuvid ||
- die "ERROR: CUVID not found"; } &&
- { enabled cuda ||
+enabled cuda && check_header cuda.h # this is not a dependency
+enabled cuvid && { enabled cuda ||
die "ERROR: CUVID requires CUDA"; }
enabled chromaprint && require chromaprint chromaprint.h chromaprint_get_version -lchromaprint
enabled coreimage_filter && { check_header_objcc QuartzCore/CoreImage.h || disable coreimage_filter; }
{ check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
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 libebur128 && require ebur128 ebur128.h ebur128_relative_threshold -lebur128
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"; } }
die "ERROR: libx265 version must be >= 68."; }
enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs
enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
-enabled libzimg && require_pkg_config zimg zimg.h zimg_get_api_version
+enabled libzimg && require_pkg_config "zimg >= 2.3.0" zimg.h zimg_get_api_version
enabled libzmq && require_pkg_config libzmq zmq.h zmq_ctx_new
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" ||
add_cflags -isystem/opt/vc/include/IL ; }
check_header OMX_Core.h ; } ||
die "ERROR: OpenMAX IL headers not found"; }
-enabled openssl && { use_pkg_config openssl openssl/ssl.h SSL_library_init ||
+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/ssl.h SSL_library_init -lssl -lcrypto ||
check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
mingw32*|mingw64*|win32|win64|linux|cygwin*)
;;
*)
- disable nvenc
+ disable cuda cuvid nvenc
;;
esac
else
- disable nvenc
+ disable cuda cuvid nvenc
fi
enabled nvenc &&
fi
enabled_all dxva2 dxva2api_cobj CoTaskMemFree &&
- prepend ffmpeg_libs $($ldflags_filter "-lole32" "-luser32") &&
+ prepend ffmpeg_libs $($ldflags_filter "-lole32") &&
enable dxva2_lib
! enabled_any memalign posix_memalign aligned_malloc &&
mkdir -p doc/examples/pc-uninstalled
includedir=${source_path}
[ "$includedir" = . ] && includedir="\${pcfiledir}/../../.."
- cat <<EOF > doc/examples/pc-uninstalled/$name.pc
+ cat <<EOF > doc/examples/pc-uninstalled/${name}-uninstalled.pc
prefix=
exec_prefix=
libdir=\${pcfiledir}/../../../$name