From 5919275dde112187c5aeedeb7b4a76de8a7eb3dd Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Tue, 16 May 2017 14:11:52 +0200 Subject: Introduce variables SPEED_VPX SPEED_H264. --- bin/encodevideo+loop+stream | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bin/encodevideo+loop+stream') diff --git a/bin/encodevideo+loop+stream b/bin/encodevideo+loop+stream index fb2b3b7..94ea765 100755 --- a/bin/encodevideo+loop+stream +++ b/bin/encodevideo+loop+stream @@ -16,6 +16,8 @@ FIRSTPORT=${2:-5002} # even number - next 3 ports used too # TODO: resolve this or resize based on it HEIGHT=360 +SPEED_VPX=15 + # inspired by Apple HLS recommendations if [ $HEIGHT -le 234 ]; then VBITRATE=145000; elif [ $HEIGHT -le 270 ]; then VBITRATE=365000; @@ -32,7 +34,7 @@ ffmpeg -hide_banner -threads auto -re \ -stream_loop -1 -i "$INPUT" \ -map '0:v' \ -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 \ -- cgit v1.2.3