summaryrefslogtreecommitdiff
path: root/bin/stream
diff options
context:
space:
mode:
Diffstat (limited to 'bin/stream')
-rwxr-xr-xbin/stream7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/stream b/bin/stream
index 846ebde..d044b24 100755
--- a/bin/stream
+++ b/bin/stream
@@ -88,6 +88,9 @@ HEIGHT=234
HEIGHTS_WEBM="$HEIGHT"
HEIGHTS_MPEG="$HEIGHT"
+SPEED_VPX=15
+SPEED_X264=ultrafast
+
# inspired by Apple HLS recommendations
if [ $HEIGHT -le 234 ]; then VBITRATE=145000;
elif [ $HEIGHT -le 270 ]; then VBITRATE=365000;
@@ -176,7 +179,7 @@ ffmpeg -hide_banner -threads auto \
-codec:a libopus -ac "$ACHANNELS" -ar "$AFRAMERATE_OPUS" -b:a "$ABITRATE_OPUS" } \
${HASVIDEO:+\
-pix_fmt yuv420p \
- -codec:v vp8 -quality realtime -deadline 1000000 -cpu-used 15 \
+ -codec:v vp8 -quality realtime -deadline 1000000 -cpu-used "$SPEED_VPX" \
-b:v "$VBITRATE" -minrate "$VBITRATE" -maxrate "$VBITRATE" \
-undershoot-pct 95 -bufsize $((6000*VBITRATE/1000)) -rc_init_occupancy $((4000*VBITRATE/1000)) \
-max-intra-rate 0 \
@@ -192,7 +195,7 @@ ffmpeg -hide_banner -threads auto \
-codec:a aac -strict experimental -ac "$ACHANNELS" -ar "$AFRAMERATE_AAC" -b:a $((ACHANNELS*ABITRATE_AAC)) } \
${HASVIDEO:+\
-pix_fmt yuv420p \
- -codec:v libx264 -tune zerolatency -preset ultrafast \
+ -codec:v libx264 -tune zerolatency -preset "$SPEED_X264" \
-maxrate "$VBITRATE" -bufsize "$((VBITRATE*2))" -crf 23 } \
-force_key_frames 'expr:gte(t,n_forced*2)' \
-f rtp_mpegts rtp://$IP:10000 }