diff options
-rwxr-xr-x | bin/stream | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 } |