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.

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