You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

725 lines
19KB

  1. #!/bin/sh
  2. #
  3. # automatic regression test for ffmpeg
  4. #
  5. #
  6. #set -x
  7. # Even in the 21st century some diffs are not supporting -u.
  8. diff -u "$0" "$0" > /dev/null 2>&1
  9. if [ $? -eq 0 ]; then
  10. diff_cmd="diff -u"
  11. else
  12. diff_cmd="diff"
  13. fi
  14. diff -w "$0" "$0" > /dev/null 2>&1
  15. if [ $? -eq 0 ]; then
  16. diff_cmd="$diff_cmd -w"
  17. fi
  18. set -e
  19. datadir="./data"
  20. logfile="$datadir/ffmpeg.regression"
  21. outfile="$datadir/a-"
  22. # tests to do
  23. if [ "$1" = "mpeg4" ] ; then
  24. do_mpeg4=y
  25. elif [ "$1" = "mpeg" ] ; then
  26. do_mpeg=y
  27. do_mpeg2=y
  28. elif [ "$1" = "ac3" ] ; then
  29. do_ac3=y
  30. elif [ "$1" = "huffyuv" ] ; then
  31. do_huffyuv=y
  32. elif [ "$1" = "mpeg2thread" ] ; then
  33. do_mpeg2thread=y
  34. elif [ "$1" = "snow" ] ; then
  35. do_snow=y
  36. elif [ "$1" = "snowll" ] ; then
  37. do_snowll=y
  38. elif [ "$1" = "libavtest" ] ; then
  39. do_libav=y
  40. logfile="$datadir/libav.regression"
  41. outfile="$datadir/b-"
  42. else
  43. do_mpeg=y
  44. do_mpeg2=y
  45. do_mpeg2thread=y
  46. do_msmpeg4v2=y
  47. do_msmpeg4=y
  48. do_wmv1=y
  49. do_wmv2=y
  50. do_h261=y
  51. do_h263=y
  52. do_h263p=y
  53. do_mpeg4=y
  54. do_mp4psp=y
  55. do_huffyuv=y
  56. do_mjpeg=y
  57. do_ljpeg=y
  58. do_rv10=y
  59. do_rv20=y
  60. do_mp2=y
  61. do_ac3=y
  62. do_g726=y
  63. do_adpcm_ima_wav=y
  64. do_adpcm_ms=y
  65. do_rc=y
  66. do_mpeg4adv=y
  67. do_mpeg4thread=y
  68. do_mpeg4nr=y
  69. do_mpeg1b=y
  70. do_asv1=y
  71. do_asv2=y
  72. do_flv=y
  73. do_ffv1=y
  74. do_error=y
  75. do_svq1=y
  76. do_snow=y
  77. do_snowll=y
  78. do_adpcm_yam=y
  79. do_dv=y
  80. fi
  81. # various files
  82. ffmpeg="../ffmpeg_g"
  83. tiny_psnr="./tiny_psnr"
  84. reffile="$2"
  85. benchfile="$datadir/ffmpeg.bench"
  86. raw_src="$3/%02d.pgm"
  87. raw_dst="$datadir/out.yuv"
  88. raw_ref="$datadir/ref.yuv"
  89. pcm_src="asynth1.sw"
  90. pcm_dst="$datadir/out.wav"
  91. pcm_ref="$datadir/ref.wav"
  92. if [ X"`echo | md5sum 2> /dev/null`" != X ]; then
  93. do_md5sum() { md5sum -b $1; }
  94. elif [ -x /sbin/md5 ]; then
  95. do_md5sum() { /sbin/md5 -r $1 | sed 's# \**\./# *./#'; }
  96. else
  97. do_md5sum() { echo No md5sum program found; }
  98. fi
  99. # create the data directory if it does not exists
  100. mkdir -p $datadir
  101. do_ffmpeg()
  102. {
  103. f="$1"
  104. shift
  105. echo $ffmpeg -y -flags +bitexact -dct fastint -idct simple $*
  106. $ffmpeg -y -flags +bitexact -dct fastint -idct simple -benchmark $* > $datadir/bench.tmp 2> /tmp/ffmpeg$$
  107. egrep -v "^(Stream|Press|Input|Output|frame| Stream| Duration|video:)" /tmp/ffmpeg$$ || true
  108. rm -f /tmp/ffmpeg$$
  109. do_md5sum $f >> $logfile
  110. if [ $f = $raw_dst ] ; then
  111. $tiny_psnr $f $raw_ref >> $logfile
  112. elif [ $f = $pcm_dst ] ; then
  113. $tiny_psnr $f $pcm_ref 2 >> $logfile
  114. else
  115. wc -c $f >> $logfile
  116. fi
  117. expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
  118. echo `cat $datadir/bench2.tmp` $f >> $benchfile
  119. }
  120. do_ffmpeg_crc()
  121. {
  122. f="$1"
  123. shift
  124. echo $ffmpeg -y -flags +bitexact -dct fastint -idct simple $* -f crc $datadir/ffmpeg.crc
  125. $ffmpeg -y -flags +bitexact -dct fastint -idct simple $* -f crc $datadir/ffmpeg.crc > /tmp/ffmpeg$$ 2>&1
  126. egrep -v "^(Stream|Press|Input|Output|frame| Stream| Duration|video:|ffmpeg version| configuration| built)" /tmp/ffmpeg$$ || true
  127. rm -f /tmp/ffmpeg$$
  128. echo "$f `cat $datadir/ffmpeg.crc`" >> $logfile
  129. }
  130. do_ffmpeg_nocheck()
  131. {
  132. f="$1"
  133. shift
  134. echo $ffmpeg -y -flags +bitexact -dct fastint -idct simple $*
  135. $ffmpeg -y -flags +bitexact -dct fastint -idct simple -benchmark $* > $datadir/bench.tmp 2> /tmp/ffmpeg$$
  136. egrep -v "^(Stream|Press|Input|Output|frame| Stream| Duration|video:)" /tmp/ffmpeg$$ || true
  137. rm -f /tmp/ffmpeg$$
  138. expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
  139. echo `cat $datadir/bench2.tmp` $f >> $benchfile
  140. }
  141. echo "ffmpeg regression test" > $logfile
  142. echo "ffmpeg benchmarks" > $benchfile
  143. ###################################
  144. # generate reference for quality check
  145. do_ffmpeg_nocheck $raw_ref -y -f pgmyuv -i $raw_src -an -f rawvideo $raw_ref
  146. do_ffmpeg_nocheck $pcm_ref -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -f wav $pcm_ref
  147. ###################################
  148. if [ -n "$do_mpeg" ] ; then
  149. # mpeg1 encoding
  150. file=${outfile}mpeg1.mpg
  151. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -f mpeg1video $file
  152. # mpeg1 decoding
  153. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  154. fi
  155. ###################################
  156. if [ -n "$do_mpeg2" ] ; then
  157. # mpeg2 encoding
  158. file=${outfile}mpeg2.mpg
  159. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video $file
  160. # mpeg2 decoding
  161. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  162. # mpeg2 encoding
  163. file=${outfile}mpeg2.mpg
  164. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -idct int -dct int -f mpeg1video $file
  165. # mpeg2 decoding
  166. do_ffmpeg $raw_dst -y -idct int -i $file -f rawvideo $raw_dst
  167. # mpeg2 encoding interlaced
  168. file=${outfile}mpeg2i.mpg
  169. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video -flags +ildct+ilme $file
  170. # mpeg2 decoding
  171. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  172. fi
  173. ###################################
  174. if [ -n "$do_mpeg2thread" ] ; then
  175. # mpeg2 encoding interlaced
  176. file=${outfile}mpeg2thread.mpg
  177. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 2 $file
  178. # mpeg2 decoding
  179. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  180. # mpeg2 encoding interlaced
  181. file=${outfile}mpeg2reuse.mpg
  182. do_ffmpeg $file -y -sameq -me_threshold 256 -mb_threshold 1024 -i ${outfile}mpeg2thread.mpg -vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 4 $file
  183. # mpeg2 decoding
  184. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  185. fi
  186. ###################################
  187. if [ -n "$do_msmpeg4v2" ] ; then
  188. # msmpeg4 encoding
  189. file=${outfile}msmpeg4v2.avi
  190. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec msmpeg4v2 $file
  191. # msmpeg4v2 decoding
  192. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  193. fi
  194. ###################################
  195. if [ -n "$do_msmpeg4" ] ; then
  196. # msmpeg4 encoding
  197. file=${outfile}msmpeg4.avi
  198. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec msmpeg4 $file
  199. # msmpeg4 decoding
  200. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  201. fi
  202. ###################################
  203. if [ -n "$do_wmv1" ] ; then
  204. # wmv1 encoding
  205. file=${outfile}wmv1.avi
  206. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec wmv1 $file
  207. # wmv1 decoding
  208. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  209. fi
  210. ###################################
  211. if [ -n "$do_wmv2" ] ; then
  212. # wmv2 encoding
  213. file=${outfile}wmv2.avi
  214. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec wmv2 $file
  215. # wmv2 decoding
  216. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  217. fi
  218. ###################################
  219. if [ -n "$do_h261" ] ; then
  220. # h261 encoding
  221. file=${outfile}h261.avi
  222. do_ffmpeg $file -y -qscale 11 -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h261 $file
  223. # h261 decoding
  224. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  225. fi
  226. ###################################
  227. if [ -n "$do_h263" ] ; then
  228. # h263 encoding
  229. file=${outfile}h263.avi
  230. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h263 $file
  231. # h263 decoding
  232. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  233. fi
  234. ###################################
  235. if [ -n "$do_h263p" ] ; then
  236. # h263p encoding
  237. file=${outfile}h263p.avi
  238. do_ffmpeg $file -y -qscale 2 -flags +umv+aiv+aic -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h263p -ps 300 $file
  239. # h263p decoding
  240. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  241. fi
  242. ###################################
  243. if [ -n "$do_mpeg4" ] ; then
  244. # mpeg4
  245. file=${outfile}odivx.mp4
  246. do_ffmpeg $file -y -flags +mv4 -mbd bits -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
  247. # mpeg4 decoding
  248. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  249. fi
  250. ###################################
  251. if [ -n "$do_huffyuv" ] ; then
  252. # huffyuv
  253. file=${outfile}huffyuv.avi
  254. do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec huffyuv -pix_fmt yuv422p $file
  255. # huffyuv decoding
  256. do_ffmpeg $raw_dst -y -i $file -f rawvideo -strict -2 -pix_fmt yuv420p $raw_dst
  257. fi
  258. ###################################
  259. if [ -n "$do_rc" ] ; then
  260. # mpeg4 rate control
  261. file=${outfile}mpeg4-rc.avi
  262. do_ffmpeg $file -y -b 400 -bf 2 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
  263. # mpeg4 rate control decoding
  264. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  265. fi
  266. ###################################
  267. if [ -n "$do_mpeg4adv" ] ; then
  268. # mpeg4
  269. file=${outfile}mpeg4-adv.avi
  270. do_ffmpeg $file -y -qscale 9 -flags +mv4+part+aic+trell -mbd bits -ps 200 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
  271. # mpeg4 decoding
  272. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  273. fi
  274. ###################################
  275. if [ -n "$do_mpeg4thread" ] ; then
  276. # mpeg4
  277. file=${outfile}mpeg4-thread.avi
  278. do_ffmpeg $file -y -b 500 -flags +mv4+part+aic+trell -mbd bits -ps 200 -bf 2 -f pgmyuv -i $raw_src -an -vcodec mpeg4 -threads 2 $file
  279. # mpeg4 decoding
  280. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  281. fi
  282. ###################################
  283. if [ -n "$do_mpeg4adv" ] ; then
  284. # mpeg4
  285. file=${outfile}mpeg4-Q.avi
  286. do_ffmpeg $file -y -qscale 7 -flags +mv4+qpel -mbd 2 -bf 2 -cmp 1 -subcmp 2 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
  287. # mpeg4 decoding
  288. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  289. fi
  290. ###################################
  291. if [ -n "$do_mp4psp" ] ; then
  292. # mp4 PSP style
  293. file=${outfile}mpeg4-PSP.mp4
  294. do_ffmpeg $file -y -b 768 -s 320x240 -f psp -ar 24000 -ab 32 -i $raw_src $file
  295. fi
  296. ###################################
  297. if [ -n "$do_error" ] ; then
  298. # damaged mpeg4
  299. file=${outfile}error-mpeg4-adv.avi
  300. do_ffmpeg $file -y -qscale 7 -flags +mv4+part+aic -mbd rd -ps 250 -error 10 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
  301. # damaged mpeg4 decoding
  302. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  303. fi
  304. ###################################
  305. if [ -n "$do_mpeg4nr" ] ; then
  306. # noise reduction
  307. file=${outfile}mpeg4-nr.avi
  308. do_ffmpeg $file -y -qscale 8 -flags +mv4 -mbd rd -nr 200 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
  309. # mpeg4 decoding
  310. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  311. fi
  312. ###################################
  313. if [ -n "$do_mpeg1b" ] ; then
  314. # mpeg1
  315. file=${outfile}mpeg1b.mpg
  316. do_ffmpeg $file -y -qscale 8 -bf 3 -ps 200 -f pgmyuv -i $raw_src -an -vcodec mpeg1video -f mpeg1video $file
  317. # mpeg1 decoding
  318. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  319. fi
  320. ###################################
  321. if [ -n "$do_mjpeg" ] ; then
  322. # mjpeg
  323. file=${outfile}mjpeg.avi
  324. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mjpeg -pix_fmt yuvj420p $file
  325. # mjpeg decoding
  326. do_ffmpeg $raw_dst -y -i $file -f rawvideo -pix_fmt yuv420p $raw_dst
  327. fi
  328. ###################################
  329. if [ -n "$do_ljpeg" ] ; then
  330. # ljpeg
  331. file=${outfile}ljpeg.avi
  332. do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec ljpeg -strict -1 $file
  333. # ljpeg decoding
  334. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  335. fi
  336. ###################################
  337. if [ -n "$do_rv10" ] ; then
  338. # rv10 encoding
  339. file=${outfile}rv10.rm
  340. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an $file
  341. # rv10 decoding
  342. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  343. fi
  344. ###################################
  345. if [ -n "$do_rv20" ] ; then
  346. # rv20 encoding
  347. file=${outfile}rv20.rm
  348. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec rv20 -an $file
  349. # rv20 decoding
  350. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  351. fi
  352. ###################################
  353. if [ -n "$do_asv1" ] ; then
  354. # asv1 encoding
  355. file=${outfile}asv1.avi
  356. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec asv1 $file
  357. # asv1 decoding
  358. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  359. fi
  360. ###################################
  361. if [ -n "$do_asv2" ] ; then
  362. # asv2 encoding
  363. file=${outfile}asv2.avi
  364. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec asv2 $file
  365. # asv2 decoding
  366. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  367. fi
  368. ###################################
  369. if [ -n "$do_flv" ] ; then
  370. # flv encoding
  371. file=${outfile}flv.flv
  372. do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec flv $file
  373. # flv decoding
  374. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  375. fi
  376. ###################################
  377. if [ -n "$do_ffv1" ] ; then
  378. # ffv1 encoding
  379. file=${outfile}ffv1.avi
  380. do_ffmpeg $file -y -strict -2 -f pgmyuv -i $raw_src -an -vcodec ffv1 $file
  381. # ffv1 decoding
  382. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  383. fi
  384. ###################################
  385. if [ -n "$do_snow" ] ; then
  386. # snow encoding
  387. file=${outfile}snow.avi
  388. do_ffmpeg $file -y -strict -2 -f pgmyuv -i $raw_src -an -vcodec snow -qscale 2 -flags +qpel -me iter -dia_size 2 -cmp 12 -subcmp 12 -s 128x64 $file
  389. # snow decoding
  390. do_ffmpeg $raw_dst -y -i $file -f rawvideo -s 352x288 $raw_dst
  391. fi
  392. ###################################
  393. if [ -n "$do_snowll" ] ; then
  394. # snow encoding
  395. file=${outfile}snow53.avi
  396. do_ffmpeg $file -y -strict -2 -f pgmyuv -i $raw_src -an -vcodec snow -pred 1 -flags +mv4+qpel $file
  397. # snow decoding
  398. do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
  399. fi
  400. ###################################
  401. if [ -n "$do_dv" ] ; then
  402. # dv encoding
  403. file=${outfile}dv.dv
  404. do_ffmpeg $file -dct int -y -f pgmyuv -i $raw_src -s pal -an $file
  405. # dv decoding
  406. do_ffmpeg $raw_dst -y -i $file -f rawvideo -s cif $raw_dst
  407. fi
  408. ###################################
  409. if [ -n "$do_svq1" ] ; then
  410. # svq1 encoding
  411. file=${outfile}svq1.mov
  412. do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec svq1 -qscale 3 -pix_fmt yuv410p $file
  413. # svq1 decoding
  414. do_ffmpeg $raw_dst -y -i $file -f rawvideo -pix_fmt yuv420p $raw_dst
  415. fi
  416. ###################################
  417. if [ -n "$do_mp2" ] ; then
  418. # mp2 encoding
  419. file=${outfile}mp2.mp2
  420. do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src $file
  421. # mp2 decoding
  422. do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
  423. $tiny_psnr $pcm_dst $pcm_ref 2 1924 >> $logfile
  424. fi
  425. ###################################
  426. if [ -n "$do_ac3" ] ; then
  427. # ac3 encoding
  428. file=${outfile}ac3.rm
  429. do_ffmpeg $file -y -ab 128 -ac 2 -f s16le -i $pcm_src -vn $file
  430. # ac3 decoding
  431. #do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
  432. fi
  433. ###################################
  434. if [ -n "$do_g726" ] ; then
  435. # g726 encoding
  436. file=${outfile}g726.wav
  437. do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -ab 32 -ac 1 -ar 8000 -acodec g726 $file
  438. # g726 decoding
  439. do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
  440. fi
  441. ###################################
  442. if [ -n "$do_adpcm_ima_wav" ] ; then
  443. # encoding
  444. file=${outfile}adpcm_ima.wav
  445. do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ima_wav $file
  446. # decoding
  447. do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
  448. fi
  449. ###################################
  450. if [ -n "$do_adpcm_ms" ] ; then
  451. # encoding
  452. file=${outfile}adpcm_ms.wav
  453. do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ms $file
  454. # decoding
  455. do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
  456. fi
  457. ###################################
  458. if [ -n "$do_adpcm_yam" ] ; then
  459. # encoding
  460. file=${outfile}adpcm_yam.wav
  461. do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_yamaha $file
  462. # decoding
  463. do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
  464. fi
  465. ###################################
  466. # libav testing
  467. ###################################
  468. if [ -n "$do_libav" ] ; then
  469. # avi
  470. file=${outfile}libav.avi
  471. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
  472. do_ffmpeg_crc $file -i $file
  473. # asf
  474. file=${outfile}libav.asf
  475. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
  476. do_ffmpeg_crc $file -i $file -r 25
  477. # rm
  478. file=${outfile}libav.rm
  479. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
  480. # broken
  481. #do_ffmpeg_crc $file -i $file
  482. # mpegps
  483. file=${outfile}libav.mpg
  484. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
  485. do_ffmpeg_crc $file -i $file
  486. # mpegts
  487. file=${outfile}libav.ts
  488. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
  489. do_ffmpeg_crc $file -i $file
  490. # swf (decode audio only)
  491. file=${outfile}libav.swf
  492. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
  493. do_ffmpeg_crc $file -i $file
  494. # ffm
  495. file=${outfile}libav.ffm
  496. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
  497. do_ffmpeg_crc $file -i $file
  498. # flv
  499. file=${outfile}libav.flv
  500. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -an $file
  501. do_ffmpeg_crc $file -i $file
  502. # mov
  503. file=${outfile}libav.mov
  504. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec pcm_alaw $file
  505. do_ffmpeg_crc $file -i $file
  506. # nut
  507. file=${outfile}libav.nut
  508. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
  509. do_ffmpeg_crc $file -i $file
  510. # dv
  511. file=${outfile}libav.dv
  512. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -ar 48000 -r 25 -s pal -ac 2 $file
  513. do_ffmpeg_crc $file -i $file
  514. ####################
  515. # streamed images
  516. # mjpeg
  517. #file=${outfile}libav.mjpeg
  518. #do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
  519. #do_ffmpeg_crc $file -i $file
  520. # pbmpipe
  521. file=${outfile}libav.pbm
  522. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
  523. do_ffmpeg_crc $file -f image2pipe -i $file
  524. # pgmpipe
  525. file=${outfile}libav.pgm
  526. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
  527. do_ffmpeg_crc $file -f image2pipe -i $file
  528. # ppmpipe
  529. file=${outfile}libav.ppm
  530. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
  531. do_ffmpeg_crc $file -f image2pipe -i $file
  532. # gif
  533. file=${outfile}libav.gif
  534. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
  535. #do_ffmpeg_crc $file -i $file
  536. # yuv4mpeg
  537. file=${outfile}libav.y4m
  538. do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
  539. #do_ffmpeg_crc $file -i $file
  540. ####################
  541. # image formats
  542. # pgm (we do not do md5 on image files yet)
  543. file=${outfile}libav%02d.pgm
  544. $ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
  545. do_ffmpeg_crc $file -i $file
  546. # ppm (we do not do md5 on image files yet)
  547. file=${outfile}libav%02d.ppm
  548. $ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
  549. do_ffmpeg_crc $file -i $file
  550. # jpeg (we do not do md5 on image files yet)
  551. file=${outfile}libav%02d.jpg
  552. $ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src -flags +bitexact -dct fastint -idct simple -pix_fmt yuvj420p -f image2 $file
  553. do_ffmpeg_crc $file -f image2 -i $file
  554. ####################
  555. # audio only
  556. # wav
  557. file=${outfile}libav.wav
  558. do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
  559. do_ffmpeg_crc $file -i $file
  560. # alaw
  561. file=${outfile}libav.al
  562. do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
  563. do_ffmpeg_crc $file -i $file
  564. # mulaw
  565. file=${outfile}libav.ul
  566. do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
  567. do_ffmpeg_crc $file -i $file
  568. # au
  569. file=${outfile}libav.au
  570. do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
  571. do_ffmpeg_crc $file -i $file
  572. # mmf
  573. file=${outfile}libav.mmf
  574. do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
  575. do_ffmpeg_crc $file -i $file
  576. ####################
  577. # pix_fmt conversions
  578. conversions="yuv420p yuv422p yuv444p yuv422 yuv410p yuv411p yuvj420p \
  579. yuvj422p yuvj444p rgb24 bgr24 rgba32 rgb565 rgb555 gray monow \
  580. monob pal8"
  581. for pix_fmt in $conversions ; do
  582. file=${outfile}libav-${pix_fmt}.yuv
  583. do_ffmpeg_nocheck $file -r 1 -t 1 -y -f pgmyuv -i $raw_src \
  584. -f rawvideo -s 352x288 -pix_fmt $pix_fmt $raw_dst
  585. do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $raw_dst \
  586. -f rawvideo -s 352x288 -pix_fmt yuv444p $file
  587. done
  588. fi
  589. if $diff_cmd "$logfile" "$reffile" ; then
  590. echo
  591. echo Regression test succeeded.
  592. exit 0
  593. else
  594. echo
  595. echo Regression test: Error.
  596. exit 1
  597. fi