summaryrefslogtreecommitdiff
path: root/bin/capture+encode+serve
diff options
context:
space:
mode:
Diffstat (limited to 'bin/capture+encode+serve')
-rwxr-xr-xbin/capture+encode+serve12
1 files changed, 7 insertions, 5 deletions
diff --git a/bin/capture+encode+serve b/bin/capture+encode+serve
index 9c78374..4061595 100755
--- a/bin/capture+encode+serve
+++ b/bin/capture+encode+serve
@@ -56,12 +56,13 @@ my $RATIO_DEN = 3;
# + best (i.e. high-modulo) 4:3 heights: 288 312 384 480 624 816
# * speeds tuned to just below 100% cpu usage for each combination on a multi-core computer
# TODO: Externalize speeds to site-specific configfile
-my ( $VBITRATE, $SPEED_X264, $SPEED_X264_ALONE, $SPEED_VP8,
- $SPEED_VP8_ALONE );
+my ($VBITRATE, $SPEED_X264, $SPEED_X264_ALONE, $SPEED_VP8,
+ $SPEED_VP8_ALONE
+);
$RATIO_NUM ||= 16;
$RATIO_DEN ||= 9;
my $WIDTH ||= $HEIGHT * $RATIO_NUM / $RATIO_DEN;
-$BITS = $WIDTH * $HEIGHT;
+my $BITS = $WIDTH * $HEIGHT;
if ( $BITS le 110592 ) { # 234p → 97344
$VBITRATE = 145000;
@@ -103,7 +104,8 @@ elsif ( $BITS le 921600 ) { # 720p → 921600
$SPEED_X264_ALONE = 'ultrafast';
$SPEED_VP8_ALONE = 15;
}
-if ( toofast == $SPEED_X264 ) die "Not enough CPU - reduce size or streams";
+die "Not enough CPU - reduce size or streams"
+ if ( $SPEED_X264 eq 'toofast' );
# TODO: implement codec-specific height pools
#if ( toofast == $SPEED_X264 ) { @HEIGHTS_MPEG = () };
@@ -128,7 +130,7 @@ my %PIPELINE = (
# * let x264 use low-latency sliced-threads (i.e. don't disable treads)
VENC => [
- "x264enc speed-preset=$SPEED_H264 tune=zerolatency bitrate=800 byte-stream=true key-int-max=15 intra-refresh=true option-string=\"slice-max-size=8192:vbv-maxrate=80:vbv-bufsize=10\"",
+ "x264enc speed-preset=$SPEED_X264 tune=zerolatency bitrate=800 byte-stream=true key-int-max=15 intra-refresh=true option-string=\"slice-max-size=8192:vbv-maxrate=80:vbv-bufsize=10\"",
'video/x-h264,profile=baseline',
$QUEUE,
'rtph264pay',