diff options
Diffstat (limited to 'bin/stream')
-rwxr-xr-x | bin/stream | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -81,9 +81,18 @@ AFRAMERATE=24000 ABITRATE=16000 # FIXME: support multiple heights -HEIGHTS_WEBM=234 -HEIGHTS_MPEG=234 -VBITRATE=145000 +HEIGHT=234 +HEIGHTS_WEBM="$HEIGHT" +HEIGHTS_MPEG="$HEIGHT" + +# inspired by Apple HLS recommendations + if [ $HEIGHT -le 234 ]; then VBITRATE=145000; +elif [ $HEIGHT -le 270 ]; then VBITRATE=365000; +elif [ $HEIGHT -le 360 ]; then VBITRATE=730000; +elif [ $HEIGHT -le 432 ]; then VBITRATE=1100000; +elif [ $HEIGHT -le 540 ]; then VBITRATE=2000000; +elif [ $HEIGHT -le 720 ]; then VBITRATE=3000000; +fi # shellcheck disable=SC2048,SC2059 echo_n() { |