diff --git a/h264 b/h264 index 9a6c906..bfd8280 100755 --- a/h264 +++ b/h264 @@ -12,6 +12,7 @@ Output will be written to \$SRC.h264.mp4 -1080p Rescale to no bigger than 1080p -720p Rescale to no bigger than 720p -480p Rescale to no bigger than 480p + -bitrate B Set average bitrate to B, overriding rescale setting -swenc Software encode instead of hardware EOD @@ -21,8 +22,8 @@ bitrate="-b:v 2048k" while true; do case "$1" in -height|--height) - height=$1 - shift + height=$2 + shift 2 ;; -1080p|--1080p) height=1080 @@ -31,7 +32,7 @@ while true; do ;; -720p|--720p) height=720 - bitrate="-b:v 3000k" + bitrate="-b:v 1200k" shift ;; -480p|--480p) @@ -39,6 +40,10 @@ while true; do bitrate="-b:v 512k" shift ;; + -bitrate|--bitrate) + bitrateManual="-b:v $2" + shift 2 + ;; -swenc|--swenc) codec=h264 shift @@ -56,6 +61,7 @@ done if [ "$codec" = "h264" ]; then bitrate="-crf 28" fi +bitrate=${bitrateManual:-$bitrate} log () { echo "=== $*"