3 # automatic regression test for libavformat
10 . $(dirname $0)/regression-funcs.sh
14 ENC_OPTS="$ENC_OPTS -metadata title=lavftest"
18 file=${outfile}lavf.$1
19 input="${target_samples}/$2"
20 do_avconv $file $DEC_OPTS -i "$input" $ENC_OPTS -vcodec copy -acodec copy
21 do_avconv_crc $file $DEC_OPTS -i $target_path/$file $3
26 file=${outfile}lavf.$1
27 do_avconv $file $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src $DEC_OPTS -ar 44100 -f s16le $2 -i $pcm_src $ENC_OPTS -b:a 64k -t 1 -qscale:v 10 $3
28 test $5 = "disable_crc" ||
29 do_avconv_crc $file $DEC_OPTS -i $target_path/$file $4
32 do_lavf_timecode_nodrop() { do_lavf $1 "" "$2 -timecode 02:56:14:13"; }
33 do_lavf_timecode_drop() { do_lavf $1 "" "$2 -timecode 02:56:14.13 -r 30000/1001"; }
37 do_lavf_timecode_nodrop "$@"
38 do_lavf_timecode_drop "$@"
42 if [ -n "$do_avi" ] ; then
43 do_lavf avi "" "-acodec mp2 -ar 44100 -ab 64k -threads 1"
46 if [ -n "$do_asf" ] ; then
47 do_lavf asf "" "-acodec mp2 -ar 44100 -ab 64k" "-r 25"
50 if [ -n "$do_rm" ] ; then
51 file=${outfile}lavf.rm
52 # The RealMedia muxer is broken.
53 do_lavf rm "" "-c:a ac3_fixed" "" disable_crc
56 if [ -n "$do_mpg" ] ; then
57 do_lavf_timecode mpg "-ab 64k -ar 44100 -threads 1"
60 if [ -n "$do_mxf" ] ; then
61 do_lavf_timecode mxf "-ar 48000 -bf 2 -threads 1"
64 if [ -n "$do_mxf_d10" ]; then
65 do_lavf mxf_d10 "-ar 48000 -ac 2" "-r 25 -vf scale=720:576,pad=720:608:0:32 -vcodec mpeg2video -g 0 -flags +ildct+low_delay -dc 10 -non_linear_quant 1 -intra_vlc 1 -qscale 1 -ps 1 -qmin 1 -rc_max_vbv_use 1 -rc_min_vbv_use 1 -pix_fmt yuv422p -minrate 30000k -maxrate 30000k -b 30000k -bufsize 1200000 -top 1 -rc_init_occupancy 1200000 -qmax 12 -f mxf_d10"
68 if [ -n "$do_mxf_dv25" ]; then
69 do_lavf mxf_dv25 "-ar 48000 -ac 2" "-r 25 -vf scale=720:576,setdar=4/3 -vcodec dvvideo -pix_fmt yuv420p -b 25000k -top 0 -f mxf"
72 if [ -n "$do_mxf_dvcpro50" ]; then
73 do_lavf mxf_dvcpro50 "-ar 48000 -ac 2" "-r 25 -vf scale=720:576,setdar=16/9 -vcodec dvvideo -pix_fmt yuv422p -b 50000k -top 0 -f mxf"
76 if [ -n "$do_mxf_opatom" ]; then
77 do_lavf mxf_opatom "" "-s 1920x1080 -vcodec dnxhd -pix_fmt yuv422p -vb 36M -f mxf_opatom -map 0"
80 if [ -n "$do_mxf_opatom_audio" ]; then
81 do_lavf mxf_opatom_audio "-ar 48000 -ac 1" "-f mxf_opatom -mxf_audio_edit_rate 25 -map 1"
84 if [ -n "$do_ts" ] ; then
85 do_lavf ts "" "-ab 64k -mpegts_transport_stream_id 42 -ar 44100 -threads 1"
88 if [ -n "$do_swf" ] ; then
92 if [ -n "$do_ffm" ] ; then
93 do_lavf ffm "" "-ar 44100 -threads 1"
96 if [ -n "$do_flm" ] ; then
97 do_lavf flm "" "-pix_fmt rgba"
100 if [ -n "$do_flv_fmt" ] ; then
104 if [ -n "$do_mov" ] ; then
105 mov_common_opt="-acodec pcm_alaw -vcodec mpeg4 -threads 1"
106 do_lavf mov "" "-movflags +rtphint $mov_common_opt"
107 do_lavf_timecode mov "-movflags +faststart $mov_common_opt"
108 do_lavf_timecode mp4 "-vcodec mpeg4 -an -threads 1"
111 if [ -n "$do_ismv" ] ; then
112 do_lavf_timecode ismv "-an -vcodec mpeg4 -threads 1"
115 if [ -n "$do_dv_fmt" ] ; then
116 do_lavf_timecode_nodrop dv "-ar 48000 -r 25 -s pal -ac 2"
117 do_lavf_timecode_drop dv "-ar 48000 -pix_fmt yuv411p -s ntsc -ac 2"
118 do_lavf dv "-ar 48000 -channel_layout stereo" "-r 25 -s pal"
121 if [ -n "$do_gxf" ] ; then
122 do_lavf_timecode_nodrop gxf "-ar 48000 -r 25 -s pal -ac 1 -threads 1"
123 do_lavf_timecode_drop gxf "-ar 48000 -s ntsc -ac 1 -threads 1"
124 do_lavf gxf "-ar 48000" "-r 25 -s pal -ac 1 -threads 1"
127 if [ -n "$do_nut" ] ; then
128 do_lavf nut "" "-acodec mp2 -ab 64k -ar 44100 -threads 1"
131 if [ -n "$do_mkv" ] ; then
132 do_lavf mkv "" "-acodec mp2 -ab 64k -vcodec mpeg4 \
133 -attach ${raw_src%/*}/00.pgm -metadata:s:t mimetype=image/x-portable-greymap -threads 1"
134 do_lavf mkv "" "-acodec mp2 -ab 64k -vcodec mpeg4 -ar 44100 -threads 1"
137 if [ -n "$do_mp3" ] ; then
138 do_lavf_fate mp3 "mp3-conformance/he_32khz.bit" "-acodec copy"
141 if [ -n "$do_latm" ] ; then
142 do_lavf_fate latm "aac/al04_44.mp4" "-acodec copy"
145 if [ -n "$do_ogg_vp3" ] ; then
146 # -idct simple causes different results on different systems
147 DEC_OPTS="$DEC_OPTS -idct auto"
148 do_lavf_fate ogg "vp3/coeff_level64.mkv"
151 if [ -n "$do_ogg_vp8" ] ; then
152 do_lavf_fate ogv "vp8/RRSF49-short.webm" "-acodec copy"
155 if [ -n "$do_mov_qtrle_mace6" ] ; then
156 DEC_OPTS="$DEC_OPTS -idct auto"
157 do_lavf_fate mov "qtrle/Animation-16Greys.mov"
160 if [ -n "$do_avi_cram" ] ; then
161 DEC_OPTS="$DEC_OPTS -idct auto"
162 do_lavf_fate avi "cram/toon.avi"
165 if [ -n "$do_wtv" ] ; then
166 do_lavf wtv "" "-acodec mp2 -threads 1"
172 #file=${outfile}lavf.mjpeg
173 #do_avconv $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src
174 #do_avconv_crc $file -i $target_path/$file
176 if [ -n "$do_gif" ] ; then
177 file=${outfile}lavf.gif
178 do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -t 1 -qscale 10 -pix_fmt rgb24
179 do_avconv_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt rgb24
182 if [ -n "$do_apng" ] ; then
183 file=${outfile}lavf.apng
184 do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -t 1 -pix_fmt rgb24
185 do_avconv_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt rgb24
186 file_copy=${outfile}lavf.copy.apng
187 do_avconv $file_copy $DEC_OPTS -i $file $ENC_OPTS -c copy
188 do_avconv_crc $file_copy $DEC_OPTS -i $target_path/$file_copy
189 file=${outfile}lavf.png
190 do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -pix_fmt rgb24 -frames:v 1 -f apng
191 do_avconv_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt rgb24
194 if [ -n "$do_yuv4mpeg" ] ; then
195 file=${outfile}lavf.y4m
196 do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -t 1 -qscale 10
197 do_avconv_crc $file -i $target_path/$file
200 if [ -n "$do_fits" ] ; then
201 pix_fmts="gray gray16be gbrp gbrap gbrp16be gbrap16be"
202 for pix_fmt in $pix_fmts ; do
203 file=${outfile}${pix_fmt}lavf.fits
204 do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -pix_fmt $pix_fmt
205 do_avconv_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt $pix_fmt
209 if [ -n "$do_smjpeg" ] ; then
210 do_lavf smjpeg "" "-f smjpeg"