]> git.sesse.net Git - ffmpeg/blob - tests/lavf-regression.sh
Merge commit '896fe15dbb7b78de495c4a7dd75e7faec66778da'
[ffmpeg] / tests / lavf-regression.sh
1 #!/bin/sh
2 #
3 # automatic regression test for libavformat
4 #
5 #
6 #set -x
7
8 set -e
9
10 . $(dirname $0)/regression-funcs.sh
11
12 eval do_$test=y
13
14 ENC_OPTS="$ENC_OPTS -metadata title=lavftest"
15
16 do_lavf_fate()
17 {
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
22 }
23
24 do_lavf()
25 {
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
30 }
31
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"; }
34
35 do_lavf_timecode()
36 {
37     do_lavf_timecode_nodrop "$@"
38     do_lavf_timecode_drop "$@"
39     do_lavf $1 "" "$2"
40 }
41
42 if [ -n "$do_avi" ] ; then
43 do_lavf avi "" "-acodec mp2 -ar 44100 -ab 64k -threads 1"
44 fi
45
46 if [ -n "$do_asf" ] ; then
47 do_lavf asf "" "-acodec mp2 -ar 44100 -ab 64k" "-r 25"
48 fi
49
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
54 fi
55
56 if [ -n "$do_mpg" ] ; then
57 do_lavf_timecode mpg "-ab 64k -ar 44100 -threads 1"
58 fi
59
60 if [ -n "$do_mxf" ] ; then
61 do_lavf_timecode mxf "-ar 48000 -bf 2 -threads 1"
62 fi
63
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"
66 fi
67
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"
70 fi
71
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"
74 fi
75
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"
78 fi
79
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"
82 fi
83
84 if [ -n "$do_ts" ] ; then
85 do_lavf ts "" "-ab 64k -mpegts_transport_stream_id 42 -ar 44100 -threads 1"
86 fi
87
88 if [ -n "$do_swf" ] ; then
89 do_lavf swf "" "-an"
90 fi
91
92 if [ -n "$do_ffm" ] ; then
93 do_lavf ffm "" "-ar 44100 -threads 1"
94 fi
95
96 if [ -n "$do_flm" ] ; then
97 do_lavf flm "" "-pix_fmt rgba"
98 fi
99
100 if [ -n "$do_flv_fmt" ] ; then
101 do_lavf flv "" "-an"
102 fi
103
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"
109 fi
110
111 if [ -n "$do_ismv" ] ; then
112 do_lavf_timecode ismv "-an -vcodec mpeg4 -threads 1"
113 fi
114
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"
119 fi
120
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"
125 fi
126
127 if [ -n "$do_nut" ] ; then
128 do_lavf nut "" "-acodec mp2 -ab 64k -ar 44100 -threads 1"
129 fi
130
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"
135 fi
136
137 if [ -n "$do_mp3" ] ; then
138 do_lavf_fate mp3 "mp3-conformance/he_32khz.bit" "-acodec copy"
139 fi
140
141 if [ -n "$do_latm" ] ; then
142 do_lavf_fate latm "aac/al04_44.mp4" "-acodec copy"
143 fi
144
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"
149 fi
150
151 if [ -n "$do_ogg_vp8" ] ; then
152 do_lavf_fate ogv "vp8/RRSF49-short.webm" "-acodec copy"
153 fi
154
155 if [ -n "$do_mov_qtrle_mace6" ] ; then
156 DEC_OPTS="$DEC_OPTS -idct auto"
157 do_lavf_fate mov "qtrle/Animation-16Greys.mov"
158 fi
159
160 if [ -n "$do_avi_cram" ] ; then
161 DEC_OPTS="$DEC_OPTS -idct auto"
162 do_lavf_fate avi "cram/toon.avi"
163 fi
164
165 if [ -n "$do_wtv" ] ; then
166 do_lavf wtv "" "-acodec mp2 -threads 1"
167 fi
168
169
170 # streamed images
171 # mjpeg
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
175
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
180 fi
181
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
192 fi
193
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
198 fi
199
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
206 done
207 fi
208
209 if [ -n "$do_smjpeg" ] ; then
210 do_lavf smjpeg "" "-f smjpeg"
211 fi