summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/stream4
1 files changed, 4 insertions, 0 deletions
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 }