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.

684 lines
18KB

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