and binaries will be unredistributable [no]
--disable-doc do not build documentation
--disable-ffmpeg disable ffmpeg build
- --enable-avconv enable avconv build
--disable-ffplay disable ffplay build
--disable-ffprobe disable ffprobe build
--disable-ffserver disable ffserver build
--disable-vda disable VDA code
--enable-runtime-cpudetect detect cpu capabilities at runtime (bigger binary)
--enable-hardcoded-tables use hardcoded tables instead of runtime generation
+ --disable-safe-bitstream-reader
+ disable buffer boundary checking in bitreaders
+ (faster, but may crash)
--enable-memalign-hack emulate memalign, interferes with memory debuggers
--disable-everything disable all components listed below
--disable-encoder=NAME disable encoder NAME
--target-os=OS compiler targets OS [$target_os]
--target-exec=CMD command to run executables on target
--target-path=DIR path to view of build directory on target
- --nm=NM use nm tool
+ --nm=NM use nm tool NM [$nm_default]
--ar=AR use archive tool AR [$ar_default]
--as=AS use assembler AS [$as_default]
+ --yasmexe=EXE use yasm-compatible assembler EXE [$yasmexe_default]
--cc=CC use C compiler CC [$cc_default]
--cxx=CXX use C compiler CXX [$cxx_default]
- --ld=LD use linker LD
+ --ld=LD use linker LD [$ld_default]
--host-cc=HOSTCC use host C compiler HOSTCC
--host-cflags=HCFLAGS use HCFLAGS when compiling for host
--host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
--disable-armvfp disable ARM VFP optimizations
--disable-iwmmxt disable iwmmxt optimizations
--disable-mmi disable MMI optimizations
- --disable-neon disable neon optimizations
+ --disable-neon disable NEON optimizations
--disable-vis disable VIS optimizations
--disable-yasm disable use of yasm assembler
--enable-pic build position-independent code
--enable-sram allow use of on-chip SRAM
--disable-symver disable symbol versioning
--optflags override optimization-related compiler flags
+ --postproc-version=V build libpostproc version V.
+ Where V can be '$ALT_PP_VER_MAJOR.$ALT_PP_VER_MINOR.$ALT_PP_VER_MICRO' or 'current'. [$postproc_version_default]
Developer options (useful when working on FFmpeg itself):
--enable-coverage build with test coverage instrumentation
--disable-optimizations disable compiler optimizations
--enable-extra-warnings enable more compiler warnings
--disable-stripping disable stripping of executables and shared libraries
+ --valgrind=VALGRIND run "make fate" tests through valgrind to detect memory
+ leaks and errors, using the specified valgrind binary.
+ Cannot be combined with --target-exec
--samples=PATH location of test samples for FATE, if not set use
\$FATE_SAMPLES at make invocation time.
}
print_config_asm(){
- enabled $1 && echo "%define $2"
+ enabled $1 && v=1 || v=0
+ echo "%define $2 $v"
}
print_config(){
protocols
"
+PROGRAM_LIST="
+ ffplay
+ ffprobe
+ ffserver
+ ffmpeg
+"
+
CONFIG_LIST="
$COMPONENT_LIST
+ $PROGRAM_LIST
+ avplay
+ avprobe
+ avserver
aandct
ac3dsp
avcodec
dwt
dxva2
fastdiv
- ffmpeg
- avconv
- ffplay
- ffprobe
- ffserver
fft
frei0r
gnutls
golomb
gpl
gray
+ h264chroma
h264dsp
h264pred
hardcoded_tables
rdft
rtpdec
runtime_cpudetect
+ safe_bitstream_reader
shared
sinewin
small
altivec_h
arpa_inet_h
asm_mod_y
+ asm_types_h
attribute_may_alias
attribute_packed
cbrtf
dev_bktr_ioctl_bt848_h
dev_bktr_ioctl_meteor_h
dev_ic_bt8xx_h
- dev_video_meteor_ioctl_meteor_h
dev_video_bktr_ioctl_bt848_h
+ dev_video_meteor_ioctl_meteor_h
dlfcn_h
dlopen
dos_paths
fork
getaddrinfo
gethrtime
+ GetProcessAffinityMask
GetProcessMemoryInfo
GetProcessTimes
getrusage
gnu_as
- struct_rusage_ru_maxrss
ibm_asm
inet_aton
inline_asm
isatty
kbhit
ldbrx
+ libdc1394_1
+ libdc1394_2
llrint
llrintf
local_aligned_16
lzo1x_999_compress
machine_ioctl_bt848_h
machine_ioctl_meteor_h
+ makeinfo
malloc_h
MapViewOfFile
memalign
mkstemp
mmap
PeekNamedPipe
+ poll_h
posix_memalign
round
roundf
+ sched_getaffinity
sdl
sdl_video_size
setmode
+ setrlimit
sndio_h
socklen_t
soundcard_h
- poll_h
- setrlimit
strerror_r
strptime
struct_addrinfo
struct_ipv6_mreq
+ struct_rusage_ru_maxrss
struct_sockaddr_in6
struct_sockaddr_sa_len
struct_sockaddr_storage
+ struct_v4l2_frmivalenum_discrete
symver
- symver_gnu_asm
symver_asm_label
+ symver_gnu_asm
+ sysconf
+ sysctl
sys_mman_h
+ sys_param_h
sys_resource_h
sys_select_h
sys_soundcard_h
target_exec
target_os
target_path
+ postproc_version
+ valgrind
+ yasmexe
"
CMDLINE_APPEND="
fast_clz_if_any="alpha armv5te avr32 mips ppc x86"
fast_unaligned_if_any="armv6 ppc x86"
-need_memalign="altivec neon sse"
inline_asm_deps="!tms470"
+need_memalign="altivec neon sse"
symver_if_any="symver_asm_label symver_gnu_asm"
h263_vaapi_hwaccel_select="vaapi h263_decoder"
h263i_decoder_select="h263_decoder"
h263p_encoder_select="h263_encoder"
-h264_decoder_select="golomb h264dsp h264pred"
h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
+h264_decoder_select="golomb h264chroma h264dsp h264pred"
h264_dxva2_hwaccel_deps="dxva2api_h"
h264_dxva2_hwaccel_select="dxva2 h264_decoder"
h264_vaapi_hwaccel_select="vaapi h264_decoder"
mjpeg_encoder_select="aandct"
mlp_decoder_select="mlp_parser"
mp1_decoder_select="mpegaudiodsp"
-mp2_decoder_select="mpegaudiodsp"
-mp3adu_decoder_select="mpegaudiodsp"
-mp3_decoder_select="mpegaudiodsp"
-mp3on4_decoder_select="mpegaudiodsp"
mp1float_decoder_select="mpegaudiodsp"
+mp2_decoder_select="mpegaudiodsp"
mp2float_decoder_select="mpegaudiodsp"
+mp3_decoder_select="mpegaudiodsp"
+mp3adu_decoder_select="mpegaudiodsp"
mp3adufloat_decoder_select="mpegaudiodsp"
mp3float_decoder_select="mpegaudiodsp"
+mp3on4_decoder_select="mpegaudiodsp"
mp3on4float_decoder_select="mpegaudiodsp"
-mpeg1video_encoder_select="aandct"
-mpeg2video_encoder_select="aandct"
-mpeg4_decoder_select="h263_decoder mpeg4video_parser"
-mpeg4_encoder_select="h263_encoder"
+mpc7_decoder_select="mpegaudiodsp"
+mpc8_decoder_select="mpegaudiodsp"
mpeg_vdpau_decoder_select="vdpau mpegvideo_decoder"
+mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
+mpeg_xvmc_decoder_select="mpegvideo_decoder"
mpeg1_vdpau_decoder_select="vdpau mpeg1video_decoder"
mpeg1_vdpau_hwaccel_select="vdpau mpeg1video_decoder"
+mpeg1video_encoder_select="aandct"
mpeg2_crystalhd_decoder_select="crystalhd"
mpeg2_dxva2_hwaccel_deps="dxva2api_h"
mpeg2_dxva2_hwaccel_select="dxva2 mpeg2video_decoder"
mpeg2_vdpau_hwaccel_select="vdpau mpeg2video_decoder"
mpeg2_vaapi_hwaccel_select="vaapi mpeg2video_decoder"
+mpeg2video_encoder_select="aandct"
mpeg4_crystalhd_decoder_select="crystalhd"
+mpeg4_decoder_select="h263_decoder mpeg4video_parser"
+mpeg4_encoder_select="h263_encoder"
mpeg4_vaapi_hwaccel_select="vaapi mpeg4_decoder"
mpeg4_vdpau_decoder_select="vdpau mpeg4_decoder"
-mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
-mpeg_xvmc_decoder_select="mpegvideo_decoder"
msmpeg4_crystalhd_decoder_select="crystalhd"
msmpeg4v1_decoder_select="h263_decoder"
msmpeg4v1_encoder_select="h263_encoder"
rv10_encoder_select="h263_encoder"
rv20_decoder_select="h263_decoder"
rv20_encoder_select="h263_encoder"
-rv30_decoder_select="golomb h264pred"
-rv40_decoder_select="golomb h264pred"
+rv30_decoder_select="golomb h264chroma h264pred"
+rv40_decoder_select="golomb h264chroma h264pred"
shorten_decoder_select="golomb"
sipr_decoder_select="lsp"
snow_decoder_select="dwt"
sonic_encoder_select="golomb"
sonic_ls_encoder_select="golomb"
svq1_encoder_select="aandct"
-svq3_decoder_select="golomb h264dsp h264pred"
+svq3_decoder_select="golomb h264chroma h264dsp h264pred"
svq3_decoder_suggest="zlib"
theora_decoder_select="vp3_decoder"
tiff_decoder_suggest="zlib"
truehd_decoder_select="mlp_decoder"
tscc_decoder_select="zlib"
twinvq_decoder_select="mdct lsp sinewin"
-vc1_decoder_select="h263_decoder"
vc1_crystalhd_decoder_select="crystalhd"
+vc1_decoder_select="h263_decoder h264chroma"
vc1_dxva2_hwaccel_deps="dxva2api_h"
vc1_dxva2_hwaccel_select="dxva2 vc1_decoder"
vc1_vaapi_hwaccel_select="vaapi vc1_decoder"
vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
# parsers
-h264_parser_select="golomb h264dsp h264pred"
+h264_parser_select="golomb h264chroma h264dsp h264pred"
# external libraries
libaacplus_encoder_deps="libaacplus"
mptestsrc_filter_deps="gpl"
negate_filter_deps="lut_filter"
ocv_filter_deps="libopencv"
+pan_filter_deps="swresample"
scale_filter_deps="swscale"
+tinterlace_filter_deps="gpl"
yadif_filter_deps="gpl"
# libraries
postproc_deps="gpl"
# programs
-ffmpeg_deps="avcodec avformat swscale swresample"
-ffmpeg_select="buffer_filter buffersink_filter"
-avconv_deps="avcodec avformat swscale"
-avconv_select="buffer_filter"
ffplay_deps="avcodec avformat swscale sdl"
ffplay_select="buffersink_filter rdft"
ffprobe_deps="avcodec avformat"
ffserver_deps="avformat ffm_muxer fork rtp_protocol rtsp_demuxer"
ffserver_extralibs='$ldl'
+ffmpeg_deps="avcodec avformat swscale swresample"
+ffmpeg_select="buffersink_filter"
doc_deps="texi2html"
seek_lavf_mxf_d10_test_deps="mxf_d10_test"
test_deps _encoder _decoder \
- adpcm_g726=g726 \
adpcm_ima_qt \
adpcm_ima_wav \
adpcm_ms \
flac \
flashsv \
flv \
+ adpcm_g726=g726 \
gif \
h261 \
h263="h263 h263p" \
libdir_default='${prefix}/lib'
mandir_default='${prefix}/share/man'
shlibdir_default="$libdir_default"
+postproc_version_default="current"
# toolchain
ar_default="ar"
pkg_config_default=pkg-config
ranlib="ranlib"
strip_default="strip"
-yasmexe="yasm"
-nogas=":"
+yasmexe_default="yasm"
nm_opts='-g'
+nogas=":"
# machine
arch_default=$(uname -m)
target_os_default=$(tolower $(uname -s))
host_os=$target_os_default
+# alternative libpostproc version
+ALT_PP_VER_MAJOR=51
+ALT_PP_VER_MINOR=2
+ALT_PP_VER_MICRO=101
+ALT_PP_VER=$ALT_PP_VER_MAJOR.$ALT_PP_VER_MINOR.$ALT_PP_VER_MICRO
+
# configurable options
+enable $PROGRAM_LIST
+
enable avcodec
enable avdevice
enable avfilter
enable avformat
enable avutil
+enable postproc
+enable stripping
+enable swresample
+enable swscale
+
enable asm
enable debug
enable doc
enable fastdiv
-enable ffmpeg
-enable ffplay
-enable ffprobe
-enable ffserver
enable network
enable optimizations
-enable postproc
-enable protocols
+enable safe_bitstream_reader
enable static
-enable stripping
-enable swresample
-enable swscale
enable swscale_alpha
# build settings
PROTOCOL_LIST=$(find_things protocol PROTOCOL libavformat/allformats.c)
FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c)
+ALL_COMPONENTS="
+ $BSF_LIST
+ $DECODER_LIST
+ $DEMUXER_LIST
+ $ENCODER_LIST
+ $FILTER_LIST
+ $HWACCEL_LIST
+ $INDEV_LIST
+ $MUXER_LIST
+ $OUTDEV_LIST
+ $PARSER_LIST
+ $PROTOCOL_LIST
+"
+
find_tests(){
map "echo ${2}\${v}_test" $(ls "$source_path"/tests/ref/$1 | grep -v '[^-a-z0-9_]')
}
LAVFI_TESTS=$(find_tests lavfi)
SEEK_TESTS=$(find_tests seek seek_)
+ALL_TESTS="$ACODEC_TESTS $VCODEC_TESTS $LAVF_TESTS $LAVFI_TESTS $SEEK_TESTS"
+
pcm_test_deps=$(map 'echo ${v%_*}_decoder $v' $(filter pcm_* $ENCODER_LIST))
for n in $COMPONENT_LIST; do
eval ${n}_if_any="\$$v"
done
-enable $ARCH_EXT_LIST $ACODEC_TESTS $VCODEC_TESTS $LAVF_TESTS $LAVFI_TESTS $SEEK_TESTS
+enable $ARCH_EXT_LIST $ALL_TESTS
die_unknown(){
echo "Unknown option \"$1\"."
die "Must specify target arch and OS when cross-compiling"
fi
-set_default arch target_os
+set_default arch target_os postproc_version
+
+# Check if we should build alternative libpostproc version instead of current
+if test "$postproc_version" = $ALT_PP_VER; then
+ LIBPOSTPROC_VERSION=$ALT_PP_VER
+ LIBPOSTPROC_VERSION_MAJOR=$ALT_PP_VER_MAJOR
+ LIBPOSTPROC_VERSION_MINOR=$ALT_PP_VER_MINOR
+ LIBPOSTPROC_VERSION_MICRO=$ALT_PP_VER_MICRO
+elif test "$postproc_version" != current; then
+ die "Invalid argument to --postproc-version. See --help output."
+fi
ar_default="${cross_prefix}${ar_default}"
cc_default="${cross_prefix}${cc_default}"
sysinclude_default="${sysroot}/usr/include"
-set_default cc cxx nm pkg_config strip sysinclude
+set_default cc cxx nm pkg_config strip sysinclude yasmexe
enabled cross_compile || host_cc_default=$cc
set_default host_cc
trap 'rm -f -- $TMPFILES' EXIT
-tmpfile TMPC .c
-tmpfile TMPCPP .cpp
-tmpfile TMPE $EXESUF
-tmpfile TMPH .h
-tmpfile TMPO .o
-tmpfile TMPS .S
-tmpfile TMPV .ver
-tmpfile TMPSH .sh
tmpfile TMPASM .asm
+tmpfile TMPC .c
+tmpfile TMPCPP .cpp
+tmpfile TMPE $EXESUF
+tmpfile TMPH .h
+tmpfile TMPO .o
+tmpfile TMPS .S
+tmpfile TMPSH .sh
+tmpfile TMPV .ver
unset -f mktemp
die "Sanity test failed."
fi
+filter_asflags=echo
filter_cflags=echo
filter_cppflags=echo
-filter_asflags=echo
if $cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
cc_type=llvm_gcc
# Deal with common $arch aliases
case "$arch" in
- arm*)
+ arm*|iPad*)
arch="arm"
;;
mips|mipsel|IP*)
check_func setrlimit
check_func strerror_r
check_func strptime
+check_func sched_getaffinity
+check_func sysconf
+check_func sysctl
check_func_headers conio.h kbhit
check_func_headers windows.h PeekNamedPipe
check_func_headers io.h setmode
check_func_headers lzo/lzo1x.h lzo1x_999_compress
check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
+check_func_headers windows.h GetProcessAffinityMask
check_func_headers windows.h GetProcessTimes
check_func_headers windows.h MapViewOfFile
check_func_headers windows.h VirtualAlloc
check_header malloc.h
check_header poll.h
check_header sys/mman.h
+check_header sys/param.h
check_header sys/resource.h
check_header sys/select.h
check_header termios.h
check_header vdpau/vdpau.h
check_header vdpau/vdpau_x11.h
check_header X11/extensions/XvMClib.h
+check_header asm/types.h
disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
enabled libaacplus && require "libaacplus >= 2.0.0" aacplus.h aacplusEncOpen -laacplus
enabled libass && require_pkg_config libass ass/ass.h ass_library_init
-enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0
-enabled libdc1394 && require_pkg_config libdc1394-2 dc1394/dc1394.h dc1394_new
+enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
+ { check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
+ die "ERROR: libcelt version must be >= 0.11.0."; }
enabled libdirac && require_pkg_config dirac \
"libdirac_decoder/dirac_parser.h libdirac_encoder/dirac_encoder.h" \
"dirac_decoder_init dirac_encoder_init"
check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
die "ERROR: openssl not found"; }
+# libdc1394 check
+if enabled libdc1394; then
+ { check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 &&
+ enable libdc1394_2; } ||
+ { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
+ enable libdc1394_1; } ||
+ die "ERROR: No version of libdc1394 found "
+fi
+
SDL_CONFIG="${cross_prefix}sdl-config"
if check_pkg_config sdl SDL_version.h SDL_Linked_Version; then
check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
enabled sdl && add_cflags $sdl_cflags && add_extralibs $sdl_libs
texi2html -version > /dev/null 2>&1 && enable texi2html || disable texi2html
+makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
check_header linux/fb.h
check_header linux/videodev.h
check_header linux/videodev2.h
+check_struct linux/videodev2.h "struct v4l2_frmivalenum" discrete
+
check_header sys/videoio.h
check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs"
enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
enabled coverage && add_cflags "-fprofile-arcs -ftest-coverage" && add_ldflags "-fprofile-arcs -ftest-coverage"
+test -n "$valgrind" && target_exec="$valgrind --error-exitcode=1 --malloc-fill=0x2a --track-origins=yes --leak-check=full --gen-suppressions=all --suppressions=$source_path/tests/fate-valgrind.supp"
# add some useful compiler flags if supported
check_cflags -Wdeclaration-after-statement
check_deps $CONFIG_LIST \
$CONFIG_EXTRA \
$HAVE_LIST \
- $DECODER_LIST \
- $ENCODER_LIST \
- $HWACCEL_LIST \
- $PARSER_LIST \
- $BSF_LIST \
- $DEMUXER_LIST \
- $MUXER_LIST \
- $FILTER_LIST \
- $INDEV_LIST \
- $OUTDEV_LIST \
- $PROTOCOL_LIST \
- $ACODEC_TESTS \
- $VCODEC_TESTS \
- $LAVF_TESTS \
- $LAVFI_TESTS \
- $SEEK_TESTS \
+ $ALL_COMPONENTS \
+ $ALL_TESTS \
enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
echo "new filter support ${avfilter-no}"
echo "network support ${network-no}"
echo "threading support ${thread_type-no}"
+echo "safe bitstream reader ${safe_bitstream_reader-no}"
echo "SDL support ${sdl-no}"
echo "Sun medialib support ${mlib-no}"
echo "libdxva2 enabled ${dxva2-no}"
get_version(){
name=$1
file=$source_path/$2
+# This condition will be removed when we stop supporting old libpostproc versions
+if ! test "$name" = LIBPOSTPROC || test "$postproc_version" = current; then
eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }')
eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
+fi
lcname=$(tolower $name)
eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
}
-get_version LIBSWSCALE libswscale/swscale.h
-get_version LIBSWRESAMPLE libswresample/swresample.h
-get_version LIBPOSTPROC libpostproc/postprocess.h
get_version LIBAVCODEC libavcodec/version.h
get_version LIBAVDEVICE libavdevice/avdevice.h
+get_version LIBAVFILTER libavfilter/version.h
get_version LIBAVFORMAT libavformat/version.h
get_version LIBAVUTIL libavutil/avutil.h
-get_version LIBAVFILTER libavfilter/avfilter.h
+get_version LIBPOSTPROC libpostproc/postprocess.h
+get_version LIBSWRESAMPLE libswresample/swresample.h
+get_version LIBSWSCALE libswscale/swscale.h
cat > $TMPH <<EOF
/* Automatically generated by configure - do not modify! */
print_config HAVE_ "$config_files" $HAVE_LIST
print_config CONFIG_ "$config_files" $CONFIG_LIST \
$CONFIG_EXTRA \
- $DECODER_LIST \
- $ENCODER_LIST \
- $HWACCEL_LIST \
- $PARSER_LIST \
- $BSF_LIST \
- $DEMUXER_LIST \
- $MUXER_LIST \
- $FILTER_LIST \
- $PROTOCOL_LIST \
- $INDEV_LIST \
- $OUTDEV_LIST \
+ $ALL_COMPONENTS \
cat >>config.mak <<EOF
ACODEC_TESTS=$(print_enabled -n _test $ACODEC_TESTS)
#define AVUTIL_AVCONFIG_H
EOF
+test "$postproc_version" != current && cat >> $TMPH <<EOF
+#define LIBPOSTPROC_VERSION_MAJOR $LIBPOSTPROC_VERSION_MAJOR
+#define LIBPOSTPROC_VERSION_MINOR $LIBPOSTPROC_VERSION_MINOR
+#define LIBPOSTPROC_VERSION_MICRO $LIBPOSTPROC_VERSION_MICRO
+EOF
+
print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH