diff options
Diffstat (limited to 'bin/capture+encode+serve')
-rwxr-xr-x | bin/capture+encode+serve | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/capture+encode+serve b/bin/capture+encode+serve index e3fce44..83af18c 100755 --- a/bin/capture+encode+serve +++ b/bin/capture+encode+serve @@ -47,7 +47,15 @@ my $HEIGHT = 240; my $FRAMERATE = 25; my $AUDIORATE = 48000; -my $VBITRATE = 256000; +my $VBITRATE; + +# inspired by Apple HLS recommendations +if ( $HEIGHT le 234 ) { $VBITRATE = 145000 } +elsif ( $HEIGHT le 270 ) { $VBITRATE = 365000 } +elsif ( $HEIGHT le 360 ) { $VBITRATE = 730000 } +elsif ( $HEIGHT le 432 ) { $VBITRATE = 1100000 } +elsif ( $HEIGHT le 540 ) { $VBITRATE = 2000000 } +elsif ( $HEIGHT le 720 ) { $VBITRATE = 3000000 } my $VCAPS = "video/x-raw,height=$HEIGHT"; my $ACAPS = "audio/x-raw,rate=$AUDIORATE,channels=2,depth=16"; |