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 "$@"
44 outfile="$datadir/images/$1/"
46 file=${outfile}%02d.$1
47 run_avconv $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $2 $ENC_OPTS -frames 13 -y -qscale 10 $target_path/$file
48 do_md5sum ${outfile}02.$1
49 do_avconv_crc $file $DEC_OPTS -i $target_path/$file $3
50 echo $(wc -c ${outfile}02.$1)
53 if [ -n "$do_avi" ] ; then
54 do_lavf avi "" "-acodec mp2 -ar 44100 -ab 64k -threads 1"
57 if [ -n "$do_asf" ] ; then
58 do_lavf asf "" "-acodec mp2 -ar 44100 -ab 64k" "-r 25"
61 if [ -n "$do_rm" ] ; then
62 file=${outfile}lavf.rm
63 # The RealMedia muxer is broken.
64 do_lavf rm "" "-c:a ac3_fixed" "" disable_crc
67 if [ -n "$do_mpg" ] ; then
68 do_lavf_timecode mpg "-ab 64k -ar 44100 -threads 1"
71 if [ -n "$do_mxf" ] ; then
72 do_lavf_timecode mxf "-ar 48000 -bf 2 -threads 1"
75 if [ -n "$do_mxf_d10" ]; then
76 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"
79 if [ -n "$do_mxf_dv25" ]; then
80 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"
83 if [ -n "$do_mxf_dvcpro50" ]; then
84 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"
87 if [ -n "$do_mxf_opatom" ]; then
88 do_lavf mxf_opatom "" "-s 1920x1080 -vcodec dnxhd -pix_fmt yuv422p -vb 36M -f mxf_opatom -map 0"
91 if [ -n "$do_mxf_opatom_audio" ]; then
92 do_lavf mxf_opatom_audio "-ar 48000 -ac 1" "-f mxf_opatom -mxf_audio_edit_rate 25 -map 1"
95 if [ -n "$do_ts" ] ; then
96 do_lavf ts "" "-ab 64k -mpegts_transport_stream_id 42 -ar 44100 -threads 1"
99 if [ -n "$do_swf" ] ; then
103 if [ -n "$do_ffm" ] ; then
104 do_lavf ffm "" "-ar 44100 -threads 1"
107 if [ -n "$do_flm" ] ; then
108 do_lavf flm "" "-pix_fmt rgba"
111 if [ -n "$do_flv_fmt" ] ; then
115 if [ -n "$do_mov" ] ; then
116 mov_common_opt="-acodec pcm_alaw -vcodec mpeg4 -threads 1"
117 do_lavf mov "" "-movflags +rtphint $mov_common_opt"
118 do_lavf_timecode mov "-movflags +faststart $mov_common_opt"
119 do_lavf_timecode mp4 "-vcodec mpeg4 -an -threads 1"
122 if [ -n "$do_ismv" ] ; then
123 do_lavf_timecode ismv "-an -vcodec mpeg4 -threads 1"
126 if [ -n "$do_dv_fmt" ] ; then
127 do_lavf_timecode_nodrop dv "-ar 48000 -r 25 -s pal -ac 2"
128 do_lavf_timecode_drop dv "-ar 48000 -pix_fmt yuv411p -s ntsc -ac 2"
129 do_lavf dv "-ar 48000 -channel_layout stereo" "-r 25 -s pal"
132 if [ -n "$do_gxf" ] ; then
133 do_lavf_timecode_nodrop gxf "-ar 48000 -r 25 -s pal -ac 1 -threads 1"
134 do_lavf_timecode_drop gxf "-ar 48000 -s ntsc -ac 1 -threads 1"
135 do_lavf gxf "-ar 48000" "-r 25 -s pal -ac 1 -threads 1"
138 if [ -n "$do_nut" ] ; then
139 do_lavf nut "" "-acodec mp2 -ab 64k -ar 44100 -threads 1"
142 if [ -n "$do_mkv" ] ; then
143 do_lavf mkv "" "-acodec mp2 -ab 64k -vcodec mpeg4 \
144 -attach ${raw_src%/*}/00.pgm -metadata:s:t mimetype=image/x-portable-greymap -threads 1"
145 do_lavf mkv "" "-acodec mp2 -ab 64k -vcodec mpeg4 -ar 44100 -threads 1"
148 if [ -n "$do_mp3" ] ; then
149 do_lavf_fate mp3 "mp3-conformance/he_32khz.bit" "-acodec copy"
152 if [ -n "$do_latm" ] ; then
153 do_lavf_fate latm "aac/al04_44.mp4" "-acodec copy"
156 if [ -n "$do_ogg_vp3" ] ; then
157 # -idct simple causes different results on different systems
158 DEC_OPTS="$DEC_OPTS -idct auto"
159 do_lavf_fate ogg "vp3/coeff_level64.mkv"
162 if [ -n "$do_ogg_vp8" ] ; then
163 do_lavf_fate ogv "vp8/RRSF49-short.webm" "-acodec copy"
166 if [ -n "$do_mov_qtrle_mace6" ] ; then
167 DEC_OPTS="$DEC_OPTS -idct auto"
168 do_lavf_fate mov "qtrle/Animation-16Greys.mov"
171 if [ -n "$do_avi_cram" ] ; then
172 DEC_OPTS="$DEC_OPTS -idct auto"
173 do_lavf_fate avi "cram/toon.avi"
176 if [ -n "$do_wtv" ] ; then
177 do_lavf wtv "" "-acodec mp2 -threads 1"
183 #file=${outfile}lavf.mjpeg
184 #do_avconv $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src
185 #do_avconv_crc $file -i $target_path/$file
187 if [ -n "$do_gif" ] ; then
188 file=${outfile}lavf.gif
189 do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -t 1 -qscale 10 -pix_fmt rgb24
190 do_avconv_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt rgb24
193 if [ -n "$do_apng" ] ; then
194 file=${outfile}lavf.apng
195 do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -t 1 -pix_fmt rgb24
196 do_avconv_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt rgb24
197 file_copy=${outfile}lavf.copy.apng
198 do_avconv $file_copy $DEC_OPTS -i $file $ENC_OPTS -c copy
199 do_avconv_crc $file_copy $DEC_OPTS -i $target_path/$file_copy
200 file=${outfile}lavf.png
201 do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -pix_fmt rgb24 -frames:v 1 -f apng
202 do_avconv_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt rgb24
205 if [ -n "$do_yuv4mpeg" ] ; then
206 file=${outfile}lavf.y4m
207 do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -t 1 -qscale 10
208 do_avconv_crc $file -i $target_path/$file
211 if [ -n "$do_fits" ] ; then
212 pix_fmts="gray gray16be gbrp gbrap gbrp16be gbrap16be"
213 for pix_fmt in $pix_fmts ; do
214 file=${outfile}${pix_fmt}lavf.fits
215 do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -pix_fmt $pix_fmt
216 do_avconv_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt $pix_fmt
222 if [ -n "$do_pgm" ] ; then
226 if [ -n "$do_ppm" ] ; then
230 if [ -n "$do_png" ] ; then
232 do_image_formats png "-pix_fmt gray16be"
233 do_image_formats png "-pix_fmt rgb48be"
236 if [ -n "$do_xbm" ] ; then
240 if [ -n "$do_bmp" ] ; then
244 if [ -n "$do_tga" ] ; then
248 if [ -n "$do_tiff" ] ; then
249 do_image_formats tiff "-pix_fmt rgb24"
252 if [ -n "$do_sgi" ] ; then
256 if [ -n "$do_jpg" ] ; then
257 do_image_formats jpg "-pix_fmt yuvj420p"
260 if [ -n "$do_pam" ] ; then
262 do_image_formats pam "-pix_fmt rgba"
263 do_image_formats pam "-pix_fmt gray"
264 do_image_formats pam "-pix_fmt gray16be" "-pix_fmt gray16be"
265 do_image_formats pam "-pix_fmt rgb48be" "-pix_fmt rgb48be"
266 do_image_formats pam "-pix_fmt monob"
269 if [ -n "$do_pcx" ] ; then
273 if [ -n "$do_dpx" ] ; then
275 do_image_formats dpx "-pix_fmt gbrp10le" "-pix_fmt gbrp10le"
276 do_image_formats dpx "-pix_fmt gbrp12le" "-pix_fmt gbrp12le"
277 do_image_formats dpx "-pix_fmt rgb48le"
278 do_image_formats dpx "-pix_fmt rgb48le -bits_per_raw_sample 10" "-pix_fmt rgb48le"
279 do_image_formats dpx "-pix_fmt rgba64le"
282 if [ -n "$do_xwd" ] ; then
284 do_image_formats xwd "-pix_fmt rgba"
285 do_image_formats xwd "-pix_fmt rgb565be"
286 do_image_formats xwd "-pix_fmt rgb555be"
287 do_image_formats xwd "-pix_fmt rgb8"
288 do_image_formats xwd "-pix_fmt rgb4_byte"
289 do_image_formats xwd "-pix_fmt gray"
290 do_image_formats xwd "-pix_fmt monow"
293 if [ -n "$do_sunrast" ] ; then
297 if [ -n "$do_smjpeg" ] ; then
298 do_lavf smjpeg "" "-f smjpeg"
301 # pix_fmt conversions
303 if [ -n "$do_pixfmt" ] ; then
304 outfile="$datadir/pixfmt/"
305 conversions="yuv420p yuv422p yuv444p yuyv422 yuv410p yuv411p yuvj420p \
306 yuvj422p yuvj444p rgb24 bgr24 rgb32 rgb565 rgb555 gray monow \
307 monob yuv440p yuvj440p"
308 for pix_fmt in $conversions ; do
309 file=${outfile}${pix_fmt}.yuv
310 run_avconv $DEC_OPTS -r 1 -f image2 -vcodec pgmyuv -i $raw_src \
311 $ENC_OPTS -f rawvideo -t 1 -s 352x288 -pix_fmt $pix_fmt $target_path/$raw_dst
312 do_avconv $file $DEC_OPTS -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $target_path/$raw_dst \
313 $ENC_OPTS -f rawvideo -s 352x288 -pix_fmt yuv444p