summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/stream23
1 files changed, 20 insertions, 3 deletions
diff --git a/bin/stream b/bin/stream
index 523181c..d43236f 100755
--- a/bin/stream
+++ b/bin/stream
@@ -132,10 +132,27 @@ BITS=$(videosize "$HEIGHT" "$RATIO")
# * bitrates and bits in parens based on https://developer.apple.com/library/content/documentation/General/Reference/HLSAuthoringSpec/Requirements.html
# + bits rounded up to include nearby modulo 16 formats
-# + best (i.e. high-modulo) 16:9 heights: 216 288 360 432 576 720
-# + best (i.e. high-modulo) 4:3 heights: 288 312 384 480 624 816
+# + best (i.e. high-modulo) 16:9 heights: (72 180) 216 288 360 432 576 720
+# + best (i.e. high-modulo) 4:3 heights: (105 210) 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
+if [ $BITS -le 15360 ]; then # 192x80 → 15360
+ AFRAMERATE_AAC=22050
+ ABITRATE_OPUS=16000
+ ABITRATE_AAC=32000
+ VFRAMERATE=10
+ VBITRATE=32000
+ SPEED_X264=fast; SPEED_X264_ALONE=fast
+ SPEED_VP8=3; SPEED_VP8_ALONE=2
+elif [ $BITS -le 61440 ]; then # 384x160 → 61440
+ AFRAMERATE_AAC=22050
+ ABITRATE_OPUS=16000
+ ABITRATE_AAC=32000
+ VFRAMERATE=10
+ VBITRATE=64000
+ VBITRATE=145000
+ SPEED_X264=fast; SPEED_X264_ALONE=fast
+ SPEED_VP8=3; SPEED_VP8_ALONE=2
if [ $BITS -le 110592 ]; then # 234p → 97344
VBITRATE=145000
SPEED_X264=fast; SPEED_X264_ALONE=fast
@@ -172,7 +189,7 @@ HEIGHTS=$(uniqwords "$HEIGHTS_WEBM $HEIGHTS_MPEG")
filter_split_height() {
heightcount=$(echo "$HEIGHTS" | wc --words)
- echo_n "[$VSTREAMINDEX:v]${DEINT:+$DEINT,}format=pix_fmts=yuv420p,split=$heightcount"
+ echo_n "[$VSTREAMINDEX:v]${DEINT:+$DEINT,}${VFRAMERATE:+framerate=$VFRAMERATE,}format=pix_fmts=yuv420p,split=$heightcount"
printf_each '[s%s]' "$HEIGHTS"
}
filter_scale() { outstem=${1:-v};