regression.sh 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. #!/bin/sh
  2. #
  3. # automatic regression test for ffmpeg
  4. #
  5. #
  6. #set -x
  7. set -e
  8. target_exec=$5
  9. target_path=$6
  10. datadir="./tests/data"
  11. target_datadir="${target_path}/${datadir}"
  12. test="${1#regtest-}"
  13. this="$test.$2"
  14. logfile="$datadir/$this.regression"
  15. outfile="$datadir/$4-"
  16. eval do_$test=y
  17. # various files
  18. ffmpeg="$target_exec ${target_path}/ffmpeg_g"
  19. tiny_psnr="tests/tiny_psnr"
  20. benchfile="$datadir/$this.bench"
  21. bench="$datadir/$this.bench.tmp"
  22. bench2="$datadir/$this.bench2.tmp"
  23. raw_src="${target_path}/$3/%02d.pgm"
  24. raw_dst="$datadir/$this.out.yuv"
  25. raw_ref="$datadir/$2.ref.yuv"
  26. pcm_src="${target_path}/tests/asynth1.sw"
  27. pcm_dst="$datadir/$this.out.wav"
  28. pcm_ref="$datadir/$2.ref.wav"
  29. crcfile="$datadir/$this.crc"
  30. target_crcfile="$target_datadir/$this.crc"
  31. if [ X"`echo | md5sum 2> /dev/null`" != X ]; then
  32. do_md5sum() { md5sum -b $1; }
  33. elif [ X"`echo | md5 2> /dev/null`" != X ]; then
  34. do_md5sum() { md5 -r $1 | sed 's# \**\./# *./#'; }
  35. elif [ -x /sbin/md5 ]; then
  36. do_md5sum() { /sbin/md5 -r $1 | sed 's# \**\./# *./#'; }
  37. else
  38. do_md5sum() { echo No md5sum program found; }
  39. fi
  40. # create the data directory if it does not exist
  41. mkdir -p $datadir
  42. FFMPEG_OPTS="-y -flags +bitexact -dct fastint -idct simple -sws_flags +accurate_rnd+bitexact"
  43. do_ffmpeg()
  44. {
  45. f="$1"
  46. shift
  47. set -- $* ${target_path}/$f
  48. echo $ffmpeg $FFMPEG_OPTS $*
  49. $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
  50. egrep -v "^(Stream|Press|Input|Output|frame| Stream| Duration|video:)" /tmp/ffmpeg$$ || true
  51. rm -f /tmp/ffmpeg$$
  52. do_md5sum $f >> $logfile
  53. if [ $f = $raw_dst ] ; then
  54. $tiny_psnr $f $raw_ref >> $logfile
  55. elif [ $f = $pcm_dst ] ; then
  56. $tiny_psnr $f $pcm_ref 2 >> $logfile
  57. else
  58. wc -c $f >> $logfile
  59. fi
  60. expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
  61. echo `cat $bench2` $f >> $benchfile
  62. }
  63. do_ffmpeg_nomd5()
  64. {
  65. f="$1"
  66. shift
  67. set -- $* ${target_path}/$f
  68. echo $ffmpeg $FFMPEG_OPTS $*
  69. $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
  70. egrep -v "^(Stream|Press|Input|Output|frame| Stream| Duration|video:)" /tmp/ffmpeg$$ || true
  71. rm -f /tmp/ffmpeg$$
  72. if [ $f = $raw_dst ] ; then
  73. $tiny_psnr $f $raw_ref >> $logfile
  74. elif [ $f = $pcm_dst ] ; then
  75. $tiny_psnr $f $pcm_ref 2 >> $logfile
  76. else
  77. wc -c $f >> $logfile
  78. fi
  79. expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
  80. echo `cat $bench2` $f >> $benchfile
  81. }
  82. do_ffmpeg_crc()
  83. {
  84. f="$1"
  85. shift
  86. echo $ffmpeg $FFMPEG_OPTS $* -f crc "$target_crcfile"
  87. $ffmpeg $FFMPEG_OPTS $* -f crc "$target_crcfile" > /tmp/ffmpeg$$ 2>&1
  88. egrep -v "^(Stream|Press|Input|Output|frame| Stream| Duration|video:|ffmpeg version| configuration| built)" /tmp/ffmpeg$$ || true
  89. rm -f /tmp/ffmpeg$$
  90. echo "$f `cat $crcfile`" >> $logfile
  91. rm -f "$crcfile"
  92. }
  93. do_ffmpeg_nocheck()
  94. {
  95. f="$1"
  96. shift
  97. echo $ffmpeg $FFMPEG_OPTS $*
  98. $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
  99. egrep -v "^(Stream|Press|Input|Output|frame| Stream| Duration|video:)" /tmp/ffmpeg$$ || true
  100. rm -f /tmp/ffmpeg$$
  101. expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
  102. echo `cat $bench2` $f >> $benchfile
  103. }
  104. do_video_decoding()
  105. {
  106. do_ffmpeg $raw_dst $1 -i $target_path/$file -f rawvideo $2
  107. rm -f $raw_dst
  108. }
  109. do_video_encoding()
  110. {
  111. file=${outfile}$1
  112. do_ffmpeg $file $2 -f image2 -vcodec pgmyuv -i $raw_src $3
  113. }
  114. do_audio_encoding()
  115. {
  116. file=${outfile}$1
  117. do_ffmpeg $file -ab 128k -ac 2 -f s16le -i $pcm_src $3
  118. }
  119. do_audio_decoding()
  120. {
  121. do_ffmpeg $pcm_dst -i $target_path/$file -sample_fmt s16 -f wav
  122. }
  123. do_libav()
  124. {
  125. file=${outfile}libav.$1
  126. do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src $2
  127. do_ffmpeg_crc $file -i $target_path/$file $3
  128. }
  129. do_streamed_images()
  130. {
  131. file=${outfile}${1}pipe.$1
  132. do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f image2pipe
  133. do_ffmpeg_crc $file -f image2pipe -i $target_path/$file
  134. }
  135. do_image_formats()
  136. {
  137. file=${outfile}libav%02d.$1
  138. $ffmpeg -t 0.5 -y -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src $2 $3 -flags +bitexact -sws_flags +accurate_rnd+bitexact $target_path/$file
  139. do_md5sum ${outfile}libav02.$1 >> $logfile
  140. do_ffmpeg_crc $file $3 -i $target_path/$file
  141. wc -c ${outfile}libav02.$1 >> $logfile
  142. }
  143. do_audio_only()
  144. {
  145. file=${outfile}libav.$1
  146. do_ffmpeg $file -t 1 -qscale 10 -f s16le -i $pcm_src
  147. do_ffmpeg_crc $file -i $target_path/$file
  148. }
  149. rm -f "$logfile"
  150. rm -f "$benchfile"
  151. # generate reference for quality check
  152. if [ -n "$do_ref" ]; then
  153. do_ffmpeg_nocheck $raw_ref -f image2 -vcodec pgmyuv -i $raw_src -an -f rawvideo $target_path/$raw_ref
  154. do_ffmpeg_nocheck $pcm_ref -ab 128k -ac 2 -ar 44100 -f s16le -i $pcm_src -f wav $target_path/$pcm_ref
  155. fi
  156. if [ -n "$do_mpeg" ] ; then
  157. # mpeg1
  158. do_video_encoding mpeg1.mpg "-qscale 10" "-f mpeg1video"
  159. do_video_decoding
  160. fi
  161. if [ -n "$do_mpeg2" ] ; then
  162. # mpeg2
  163. do_video_encoding mpeg2.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video"
  164. do_video_decoding
  165. # mpeg2 encoding intra vlc qprd
  166. do_video_encoding mpeg2ivlc-qprd.mpg "-vb 500k -bf 2 -trellis 1 -flags +qprd+mv0 -flags2 +ivlc -cmp 2 -subcmp 2 -mbd rd" "-vcodec mpeg2video -f mpeg2video"
  167. do_video_decoding
  168. #mpeg2 4:2:2 encoding
  169. do_video_encoding mpeg2_422.mpg "-vb 1000k -bf 2 -trellis 1 -flags +qprd+mv0+ildct+ilme -flags2 +ivlc -mbd rd" "-vcodec mpeg2video -pix_fmt yuv422p -f mpeg2video"
  170. do_video_decoding
  171. # mpeg2
  172. do_video_encoding mpeg2.mpg "-qscale 10" "-vcodec mpeg2video -idct int -dct int -f mpeg1video"
  173. do_video_decoding "-idct int"
  174. # mpeg2 encoding interlaced
  175. do_video_encoding mpeg2i.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -flags +ildct+ilme"
  176. do_video_decoding
  177. fi
  178. if [ -n "$do_mpeg2thread" ] ; then
  179. # mpeg2 encoding interlaced
  180. do_video_encoding mpeg2thread.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 2"
  181. do_video_decoding
  182. # mpeg2 encoding interlaced using intra vlc
  183. do_video_encoding mpeg2threadivlc.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -flags2 +ivlc -threads 2"
  184. do_video_decoding
  185. # mpeg2 encoding interlaced
  186. file=${outfile}mpeg2reuse.mpg
  187. do_ffmpeg $file -sameq -me_threshold 256 -mb_threshold 1024 -i ${target_path}/${outfile}mpeg2thread.mpg -vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 4
  188. do_video_decoding
  189. fi
  190. if [ -n "$do_msmpeg4v2" ] ; then
  191. do_video_encoding msmpeg4v2.avi "-qscale 10" "-an -vcodec msmpeg4v2"
  192. do_video_decoding
  193. fi
  194. if [ -n "$do_msmpeg4" ] ; then
  195. do_video_encoding msmpeg4.avi "-qscale 10" "-an -vcodec msmpeg4"
  196. do_video_decoding
  197. fi
  198. if [ -n "$do_wmv1" ] ; then
  199. do_video_encoding wmv1.avi "-qscale 10" "-an -vcodec wmv1"
  200. do_video_decoding
  201. fi
  202. if [ -n "$do_wmv2" ] ; then
  203. do_video_encoding wmv2.avi "-qscale 10" "-an -vcodec wmv2"
  204. do_video_decoding
  205. fi
  206. if [ -n "$do_h261" ] ; then
  207. do_video_encoding h261.avi "-qscale 11" "-s 352x288 -an -vcodec h261"
  208. do_video_decoding
  209. fi
  210. if [ -n "$do_h263" ] ; then
  211. do_video_encoding h263.avi "-qscale 10" "-s 352x288 -an -vcodec h263"
  212. do_video_decoding
  213. fi
  214. if [ -n "$do_h263p" ] ; then
  215. do_video_encoding h263p.avi "-qscale 2 -flags +umv+aiv+aic" "-s 352x288 -an -vcodec h263p -ps 300"
  216. do_video_decoding
  217. fi
  218. if [ -n "$do_mpeg4" ] ; then
  219. do_video_encoding odivx.mp4 "-flags +mv4 -mbd bits -qscale 10" "-an -vcodec mpeg4"
  220. do_video_decoding
  221. fi
  222. if [ -n "$do_huffyuv" ] ; then
  223. do_video_encoding huffyuv.avi "" "-an -vcodec huffyuv -pix_fmt yuv422p -sws_flags neighbor+bitexact"
  224. do_video_decoding "" "-strict -2 -pix_fmt yuv420p -sws_flags neighbor+bitexact"
  225. fi
  226. if [ -n "$do_rc" ] ; then
  227. do_video_encoding mpeg4-rc.avi "-b 400k -bf 2" "-an -vcodec mpeg4"
  228. do_video_decoding
  229. fi
  230. if [ -n "$do_mpeg4adv" ] ; then
  231. do_video_encoding mpeg4-adv.avi "-qscale 9 -flags +mv4+part+aic -trellis 1 -mbd bits -ps 200" "-an -vcodec mpeg4"
  232. do_video_decoding
  233. do_video_encoding mpeg4-qprd.avi "-b 450k -bf 2 -trellis 1 -flags +mv4+qprd+mv0 -cmp 2 -subcmp 2 -mbd rd" "-an -vcodec mpeg4"
  234. do_video_decoding
  235. do_video_encoding mpeg4-adap.avi "-b 550k -bf 2 -flags +mv4+mv0 -trellis 1 -cmp 1 -subcmp 2 -mbd rd -scplx_mask 0.3" "-an -vcodec mpeg4"
  236. do_video_decoding
  237. do_video_encoding mpeg4-Q.avi "-qscale 7 -flags +mv4+qpel -mbd 2 -bf 2 -cmp 1 -subcmp 2" "-an -vcodec mpeg4"
  238. do_video_decoding
  239. fi
  240. if [ -n "$do_mpeg4thread" ] ; then
  241. do_video_encoding mpeg4-thread.avi "-b 500k -flags +mv4+part+aic -trellis 1 -mbd bits -ps 200 -bf 2" "-an -vcodec mpeg4 -threads 2"
  242. do_video_decoding
  243. fi
  244. if [ -n "$do_error" ] ; then
  245. do_video_encoding error-mpeg4-adv.avi "-qscale 7 -flags +mv4+part+aic -mbd rd -ps 250 -error 10" "-an -vcodec mpeg4"
  246. do_video_decoding
  247. fi
  248. if [ -n "$do_mpeg4nr" ] ; then
  249. do_video_encoding mpeg4-nr.avi "-qscale 8 -flags +mv4 -mbd rd -nr 200" "-an -vcodec mpeg4"
  250. do_video_decoding
  251. fi
  252. if [ -n "$do_mpeg1b" ] ; then
  253. do_video_encoding mpeg1b.mpg "-qscale 8 -bf 3 -ps 200" "-an -vcodec mpeg1video -f mpeg1video"
  254. do_video_decoding
  255. fi
  256. if [ -n "$do_mjpeg" ] ; then
  257. do_video_encoding mjpeg.avi "-qscale 10" "-an -vcodec mjpeg -pix_fmt yuvj420p"
  258. do_video_decoding "" "-pix_fmt yuv420p"
  259. fi
  260. if [ -n "$do_ljpeg" ] ; then
  261. do_video_encoding ljpeg.avi "" "-an -vcodec ljpeg -strict -1"
  262. do_video_decoding
  263. fi
  264. if [ -n "$do_jpegls" ] ; then
  265. do_video_encoding jpegls.avi "" "-an -vcodec jpegls -vtag MJPG -sws_flags neighbor+full_chroma_int+accurate_rnd+bitexact"
  266. do_video_decoding "" "-pix_fmt yuv420p -sws_flags area+bitexact"
  267. fi
  268. if [ -n "$do_rv10" ] ; then
  269. do_video_encoding rv10.rm "-qscale 10" "-an"
  270. do_video_decoding
  271. fi
  272. if [ -n "$do_rv20" ] ; then
  273. do_video_encoding rv20.rm "-qscale 10" "-vcodec rv20 -an"
  274. do_video_decoding
  275. fi
  276. if [ -n "$do_asv1" ] ; then
  277. do_video_encoding asv1.avi "-qscale 10" "-an -vcodec asv1"
  278. do_video_decoding
  279. fi
  280. if [ -n "$do_asv2" ] ; then
  281. do_video_encoding asv2.avi "-qscale 10" "-an -vcodec asv2"
  282. do_video_decoding
  283. fi
  284. if [ -n "$do_flv" ] ; then
  285. do_video_encoding flv.flv "-qscale 10" "-an -vcodec flv"
  286. do_video_decoding
  287. fi
  288. if [ -n "$do_ffv1" ] ; then
  289. do_video_encoding ffv1.avi "-strict -2" "-an -vcodec ffv1"
  290. do_video_decoding
  291. fi
  292. if [ -n "$do_snow" ] ; then
  293. do_video_encoding snow.avi "-strict -2" "-an -vcodec snow -qscale 2 -flags +qpel -me_method iter -dia_size 2 -cmp 12 -subcmp 12 -s 128x64"
  294. do_video_decoding "" "-s 352x288"
  295. fi
  296. if [ -n "$do_snowll" ] ; then
  297. do_video_encoding snow53.avi "-strict -2" "-an -vcodec snow -qscale .001 -pred 1 -flags +mv4+qpel"
  298. do_video_decoding
  299. fi
  300. if [ -n "$do_dv" ] ; then
  301. do_video_encoding dv.dv "-dct int" "-s pal -an"
  302. do_video_decoding "" "-s cif"
  303. do_video_encoding dv411.dv "-dct int" "-s pal -an -pix_fmt yuv411p -sws_flags area+accurate_rnd+bitexact"
  304. do_video_decoding "" "-s cif -sws_flags area+accurate_rnd+bitexact"
  305. fi
  306. if [ -n "$do_dv50" ] ; then
  307. do_video_encoding dv50.dv "-dct int" "-s pal -pix_fmt yuv422p -an -sws_flags neighbor+bitexact"
  308. do_video_decoding "" "-s cif -pix_fmt yuv420p -sws_flags neighbor+bitexact"
  309. fi
  310. if [ -n "$do_svq1" ] ; then
  311. do_video_encoding svq1.mov "" "-an -vcodec svq1 -qscale 3 -pix_fmt yuv410p"
  312. do_video_decoding "" "-pix_fmt yuv420p"
  313. fi
  314. if [ -n "$do_flashsv" ] ; then
  315. do_video_encoding flashsv.flv "" "-an -vcodec flashsv -sws_flags neighbor+full_chroma_int+accurate_rnd+bitexact"
  316. do_video_decoding "" "-pix_fmt yuv420p -sws_flags area+accurate_rnd+bitexact"
  317. fi
  318. if [ -n "$do_mp2" ] ; then
  319. do_audio_encoding mp2.mp2 "-ar 44100"
  320. do_audio_decoding
  321. $tiny_psnr $pcm_dst $pcm_ref 2 1924 >> $logfile
  322. fi
  323. if [ -n "$do_ac3" ] ; then
  324. do_audio_encoding ac3.rm "" -vn
  325. # gcc 2.95.3 compiled binaries decode ac3 differently because of missing SSE support
  326. #do_audio_decoding
  327. #$tiny_psnr $pcm_dst $pcm_ref 2 1024 >> $logfile
  328. fi
  329. if [ -n "$do_g726" ] ; then
  330. do_audio_encoding g726.wav "-ar 44100" "-ab 32k -ac 1 -ar 8000 -acodec g726"
  331. do_audio_decoding
  332. fi
  333. if [ -n "$do_adpcm_ima_wav" ] ; then
  334. do_audio_encoding adpcm_ima.wav "-ar 44100" "-acodec adpcm_ima_wav"
  335. do_audio_decoding
  336. fi
  337. if [ -n "$do_adpcm_ima_qt" ] ; then
  338. do_audio_encoding adpcm_qt.aiff "-ar 44100" "-acodec adpcm_ima_qt"
  339. do_audio_decoding
  340. fi
  341. if [ -n "$do_adpcm_ms" ] ; then
  342. do_audio_encoding adpcm_ms.wav "-ar 44100" "-acodec adpcm_ms"
  343. do_audio_decoding
  344. fi
  345. if [ -n "$do_adpcm_yam" ] ; then
  346. do_audio_encoding adpcm_yam.wav "-ar 44100" "-acodec adpcm_yamaha"
  347. do_audio_decoding
  348. fi
  349. if [ -n "$do_adpcm_swf" ] ; then
  350. do_audio_encoding adpcm_swf.flv "-ar 44100" "-acodec adpcm_swf"
  351. do_audio_decoding
  352. fi
  353. if [ -n "$do_flac" ] ; then
  354. do_audio_encoding flac.flac "-ar 44100" "-acodec flac -compression_level 2"
  355. do_audio_decoding
  356. fi
  357. if [ -n "$do_wma" ] ; then
  358. # wmav1
  359. do_audio_encoding wmav1.asf "-ar 44100" "-acodec wmav1"
  360. do_ffmpeg_nomd5 $pcm_dst -i $target_path/$file -f wav
  361. $tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
  362. # wmav2
  363. do_audio_encoding wmav2.asf "-ar 44100" "-acodec wmav2"
  364. do_ffmpeg_nomd5 $pcm_dst -i $target_path/$file -f wav
  365. $tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
  366. fi
  367. #if [ -n "$do_vorbis" ] ; then
  368. # vorbis
  369. #disabled because it is broken
  370. #do_audio_encoding vorbis.asf "-ar 44100" "-acodec vorbis"
  371. #do_audio_decoding
  372. #fi
  373. do_audio_enc_dec() {
  374. do_audio_encoding $3.$1 "" "$4 -sample_fmt $2 -acodec $3"
  375. do_audio_decoding
  376. }
  377. if [ -n "$do_pcm" ] ; then
  378. do_audio_enc_dec wav s16 pcm_alaw
  379. do_audio_enc_dec wav s16 pcm_mulaw
  380. do_audio_enc_dec mov u8 pcm_s8
  381. do_audio_enc_dec wav u8 pcm_u8
  382. do_audio_enc_dec mov s16 pcm_s16be
  383. do_audio_enc_dec wav s16 pcm_s16le
  384. do_audio_enc_dec mkv s16 pcm_s16be
  385. do_audio_enc_dec mkv s16 pcm_s16le
  386. do_audio_enc_dec mov s32 pcm_s24be
  387. do_audio_enc_dec wav s32 pcm_s24le
  388. #do_audio_enc_dec ??? s32 pcm_u24be #no compatible muxer or demuxer
  389. #do_audio_enc_dec ??? s32 pcm_u24le #no compatible muxer or demuxer
  390. do_audio_enc_dec mov s32 pcm_s32be
  391. do_audio_enc_dec wav s32 pcm_s32le
  392. #do_audio_enc_dec ??? s32 pcm_u32be #no compatible muxer or demuxer
  393. #do_audio_enc_dec ??? s32 pcm_u32le #no compatible muxer or demuxer
  394. do_audio_enc_dec au flt pcm_f32be
  395. do_audio_enc_dec wav flt pcm_f32le
  396. do_audio_enc_dec au dbl pcm_f64be
  397. do_audio_enc_dec wav dbl pcm_f64le
  398. do_audio_enc_dec wav s16 pcm_zork
  399. do_audio_enc_dec 302 s16 pcm_s24daud "-ac 6 -ar 96000"
  400. fi
  401. # libavformat testing
  402. if [ -n "$do_avi" ] ; then
  403. do_libav avi
  404. fi
  405. if [ -n "$do_asf" ] ; then
  406. do_libav asf "-acodec mp2" "-r 25"
  407. fi
  408. if [ -n "$do_rm" ] ; then
  409. file=${outfile}libav.rm
  410. do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src
  411. # broken
  412. #do_ffmpeg_crc $file -i $target_path/$file
  413. fi
  414. if [ -n "$do_mpg" ] ; then
  415. do_libav mpg
  416. fi
  417. if [ -n "$do_ts" ] ; then
  418. do_libav ts
  419. fi
  420. if [ -n "$do_swf" ] ; then
  421. do_libav swf -an
  422. fi
  423. if [ -n "$do_ffm" ] ; then
  424. do_libav ffm
  425. fi
  426. if [ -n "$do_flv_fmt" ] ; then
  427. do_libav flv -an
  428. fi
  429. if [ -n "$do_mov" ] ; then
  430. do_libav mov "-acodec pcm_alaw"
  431. fi
  432. if [ -n "$do_dv_fmt" ] ; then
  433. do_libav dv "-ar 48000 -r 25 -s pal -ac 2"
  434. fi
  435. if [ -n "$do_gxf" ] ; then
  436. do_libav gxf "-ar 48000 -r 25 -s pal -ac 1"
  437. fi
  438. if [ -n "$do_nut" ] ; then
  439. do_libav nut "-acodec mp2"
  440. fi
  441. if [ -n "$do_mkv" ] ; then
  442. do_libav mkv
  443. fi
  444. # streamed images
  445. # mjpeg
  446. #file=${outfile}libav.mjpeg
  447. #do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src
  448. #do_ffmpeg_crc $file -i $target_path/$file
  449. if [ -n "$do_pbmpipe" ] ; then
  450. do_streamed_images pbm
  451. fi
  452. if [ -n "$do_pgmpipe" ] ; then
  453. do_streamed_images pgm
  454. fi
  455. if [ -n "$do_ppmpipe" ] ; then
  456. do_streamed_images ppm
  457. fi
  458. if [ -n "$do_gif" ] ; then
  459. file=${outfile}libav.gif
  460. do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -pix_fmt rgb24
  461. #do_ffmpeg_crc $file -i $target_path/$file
  462. fi
  463. if [ -n "$do_yuv4mpeg" ] ; then
  464. file=${outfile}libav.y4m
  465. do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src
  466. #do_ffmpeg_crc $file -i $target_path/$file
  467. fi
  468. # image formats
  469. if [ -n "$do_pgm" ] ; then
  470. do_image_formats pgm
  471. fi
  472. if [ -n "$do_ppm" ] ; then
  473. do_image_formats ppm
  474. fi
  475. if [ -n "$do_bmp" ] ; then
  476. do_image_formats bmp
  477. fi
  478. if [ -n "$do_tga" ] ; then
  479. do_image_formats tga
  480. fi
  481. if [ -n "$do_tiff" ] ; then
  482. do_image_formats tiff "-pix_fmt rgb24"
  483. fi
  484. if [ -n "$do_sgi" ] ; then
  485. do_image_formats sgi
  486. fi
  487. if [ -n "$do_jpg" ] ; then
  488. do_image_formats jpg "-flags +bitexact -dct fastint -idct simple -pix_fmt yuvj420p" "-f image2"
  489. fi
  490. # audio only
  491. if [ -n "$do_wav" ] ; then
  492. do_audio_only wav
  493. fi
  494. if [ -n "$do_alaw" ] ; then
  495. do_audio_only al
  496. fi
  497. if [ -n "$do_mulaw" ] ; then
  498. do_audio_only ul
  499. fi
  500. if [ -n "$do_au" ] ; then
  501. do_audio_only au
  502. fi
  503. if [ -n "$do_mmf" ] ; then
  504. do_audio_only mmf
  505. fi
  506. if [ -n "$do_aiff" ] ; then
  507. do_audio_only aif
  508. fi
  509. if [ -n "$do_voc" ] ; then
  510. do_audio_only voc
  511. fi
  512. if [ -n "$do_ogg" ] ; then
  513. do_audio_only ogg
  514. fi
  515. # pix_fmt conversions
  516. if [ -n "$do_pixfmt" ] ; then
  517. conversions="yuv420p yuv422p yuv444p yuyv422 yuv410p yuv411p yuvj420p \
  518. yuvj422p yuvj444p rgb24 bgr24 rgb32 rgb565 rgb555 gray monow \
  519. monob yuv440p yuvj440p"
  520. for pix_fmt in $conversions ; do
  521. file=${outfile}libav-${pix_fmt}.yuv
  522. do_ffmpeg_nocheck $file -r 1 -t 1 -f image2 -vcodec pgmyuv -i $raw_src \
  523. -f rawvideo -s 352x288 -pix_fmt $pix_fmt $target_path/$raw_dst
  524. do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $target_path/$raw_dst \
  525. -f rawvideo -s 352x288 -pix_fmt yuv444p
  526. done
  527. fi
  528. rm -f "$bench" "$bench2"