diff options
author | Greg Frost <gregfrost1@bigpond.com> | 2010-04-24 05:07:25 (GMT) |
---|---|---|
committer | Greg Frost <gregfrost1@bigpond.com> | 2010-04-24 05:07:25 (GMT) |
commit | 58ddf33002806eb979e128be45b0e849dbb138f4 (patch) | |
tree | 3a7797d360e76defa0e66ec125754eec644ecd71 /abs/core-testing/test-pattern/test_pattern.bash | |
parent | 5aefcc76e9b8fbe6be38d109a4d4ac090b70daf6 (diff) | |
download | linhes_pkgbuild-58ddf33002806eb979e128be45b0e849dbb138f4.zip linhes_pkgbuild-58ddf33002806eb979e128be45b0e849dbb138f4.tar.gz linhes_pkgbuild-58ddf33002806eb979e128be45b0e849dbb138f4.tar.bz2 |
test-pattern: add bitrate support
Diffstat (limited to 'abs/core-testing/test-pattern/test_pattern.bash')
-rwxr-xr-x | abs/core-testing/test-pattern/test_pattern.bash | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/abs/core-testing/test-pattern/test_pattern.bash b/abs/core-testing/test-pattern/test_pattern.bash index a68249a..76db158 100755 --- a/abs/core-testing/test-pattern/test_pattern.bash +++ b/abs/core-testing/test-pattern/test_pattern.bash @@ -9,8 +9,9 @@ TEMPDIR= unset remove_tempdir interlaced= aspect_ratio= +bitrate= -while getopts ":w:h:t:r:ia:" opt; do +while getopts ":w:h:t:r:ia:b:" opt; do case $opt in w) w=$OPTARG @@ -30,8 +31,11 @@ while getopts ":w:h:t:r:ia:" opt; do a) aspect_ratio=$OPTARG ;; + b) + bitrate=$OPTARG + ;; \?) - echo -n"\ + echo -n "\ Error: Invalid option -$OPTARG Usage: @@ -42,11 +46,16 @@ Usage: The height in pixels. -t tempdir Temporary directory for intermediate files. If no directory is specified, one is created and deleted at the end of processing. - -r framerate + -r fieldrate -i Generate an interlaced test pattern -a n:m Aspect ratio of generated video. + -b bitrate + Bitrate used for encoding. + +Example: +test_pattern.bash -w 1440 -h 1080 -t temp -r 50 -i -a 16:9 -b 12000k " exit 1 esac @@ -297,12 +306,17 @@ for ((i=0; i < $frames; i++)) ; do fi done +bitrate_flags= +if [ -n "$bitrate" ] ; then + bitrate_flags="-b $bitrate" +fi + if [ -n "$interlaced" ] ; then ffmpeg -r ${rate} -i ${TEMPDIR}/interlaced%03d.png -r ${rate} \ - -vcodec mpeg2video -flags +ilme+ildct -y test.mpg + -vcodec mpeg2video -flags +ilme+ildct ${bitrate_flags} -y test.mpg else ffmpeg -r ${rate} -i ${TEMPDIR}/test%03d.png -r ${rate} \ - -vcodec mpeg2video -aspect $aspect_ratio -y test.mpg + -vcodec mpeg2video -aspect $aspect_ratio ${bitrate_flags} -y test.mpg fi if [ -n "$remove_tempdir" ] ; then |