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.

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