3 # automatic regression test for libavfilter
10 . $(dirname $0)/regression-funcs.sh
17 get_common_elements() (
20 [ $elt1 = $elt2 ] && res="$res $elt1 "
27 # Returns the elements present in $1 but not in $2.
28 get_exclusive_elements() (
32 [ $elt1 = $elt2 ] && common="true" && break;
34 [ -z "$common" ] && res="$res $elt1"
41 vfilters="slicify=random,$2"
43 if [ $test = $1 ] ; then
44 do_video_encoding ${test}.nut "" "-vcodec rawvideo -vf $vfilters"
48 do_lavfi "crop" "crop=100:100"
49 do_lavfi "crop_scale" "crop=100:100,scale=400:-1"
50 do_lavfi "crop_scale_vflip" "null,null,crop=200:200,crop=20:20,scale=200:200,scale=250:250,vflip,vflip,null,scale=200:200,crop=100:100,vflip,scale=200:200,null,vflip,crop=100:100,null"
51 do_lavfi "crop_vflip" "crop=100:100,vflip"
52 do_lavfi "null" "null"
53 do_lavfi "scale200" "scale=200:200"
54 do_lavfi "scale500" "scale=500:500"
55 do_lavfi "vflip" "vflip"
56 do_lavfi "vflip_crop" "vflip,crop=100:100"
57 do_lavfi "vflip_vflip" "vflip,vflip"
59 # all these filters have exactly one input and exactly one output
68 if [ -n "$do_pixfmts_be" ] || [ -n "$do_pixfmts_le" ]; then
69 # exclude pixel formats which are not supported as input
70 excluded_pix_fmts="$(ffmpeg -pix_fmts list 2>/dev/null | sed -ne '9,$p' | grep '^\..\.' | cut -d' ' -f2)"
72 scale_out_pix_fmts=$(tools/lavfi-showfiltfmts scale | grep "^OUTPUT" | cut -d: -f2)
73 scale_out_pix_fmts=$(get_exclusive_elements "$scale_out_pix_fmts" "$excluded_pix_fmts")
75 for filter_args in $filters_args; do
76 filter=$(echo $filter_args | sed -e 's/\([^=]\+\)=.*/\1/')
77 in_pix_fmts=$(tools/lavfi-showfiltfmts $filter | grep "^INPUT" | cut -d: -f2)
78 pix_fmts=$(get_common_elements "$in_pix_fmts" "$scale_out_pix_fmts")
80 for pix_fmt in $pix_fmts; do
81 output=pixfmts-${filter}-${pix_fmt}.nut
82 do_video_encoding $output "" \
83 "-vf slicify=random,format=$pix_fmt,$filter_args -vcodec rawvideo -pix_fmt $pix_fmt"
88 if [ -n "$do_pixdesc_be" ] || [ -n "$do_pixdesc_le" ]; then
89 pix_fmts="$($ffmpeg -pix_fmts list 2>/dev/null | sed -ne '9,$p' | grep '^IO' | cut -d' ' -f2)"
90 for pix_fmt in $pix_fmts; do
91 output=lavfi_pixdesc-${pix_fmt}.nut
92 do_video_encoding $output "" \
93 "-vf slicify=random,format=$pix_fmt,pixdesctest -vcodec rawvideo -pix_fmt $pix_fmt"
94 rm ${outfile}${output}
100 # chains with feedback loops