From 3822b5e619e06c0da03ab56f77a008ecafcb944d Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Fri, 12 May 2017 12:19:47 +0200 Subject: Set predictive GOP size for MPEG. --- bin/stream | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'bin') diff --git a/bin/stream b/bin/stream index d36902b..4c684eb 100755 --- a/bin/stream +++ b/bin/stream @@ -1,4 +1,6 @@ #!/bin/sh +# +# TODO: Set predictive GOP size for WebM (when tested that it works) set -eu @@ -139,6 +141,7 @@ tee_rtp() { stream=$1; pt=$2; port=$3; # * routing based on http://trac.ffmpeg.org/wiki/Creating%20multiple%20outputs#Teepseudo-muxer # * VP8 encoding based on http://www.webmproject.org/docs/encoder-parameters/#real-time-cbr-encoding-and-streaming # + Add 1s latency (deadline) +# * Predictive GOP size preserving scene-change GOP based on https://superuser.com/a/1098329 # * Use same RTP payload types as GStreamer ffmpeg -hide_banner -threads auto \ ${ALSA:+-f alsa -sample_rate "$AFRAMERATE" -channels "$ACHANNELS" -thread_queue_size 2048 -i "$ALSA"} \ @@ -179,4 +182,5 @@ ffmpeg -hide_banner -threads auto \ -pix_fmt yuv420p \ -codec:v libx264 -tune zerolatency -preset ultrafast \ -maxrate "$VBITRATE" -bufsize "$((VBITRATE*2))" -crf 23 } \ + -force_key_frames 'expr:gte(t,n_forced*2)' \ -f rtp_mpegts rtp://$IP:10000 } -- cgit v1.2.3