diff options
author | Jonas Smedegaard <dr@jones.dk> | 2017-05-16 14:11:52 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2017-05-16 14:12:24 +0200 |
commit | 5919275dde112187c5aeedeb7b4a76de8a7eb3dd (patch) | |
tree | ff0ab343c2ea65adfd5bb585ae2d6f09e6349e49 /bin/stream | |
parent | 3fe329a251c3b2dae13d3cc9663da231f5f49db4 (diff) |
Introduce variables SPEED_VPX SPEED_H264.
Diffstat (limited to 'bin/stream')
-rwxr-xr-x | bin/stream | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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 } |