diff options
author | Jonas Smedegaard <dr@jones.dk> | 2017-05-12 12:19:47 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2017-05-12 12:19:47 +0200 |
commit | 3822b5e619e06c0da03ab56f77a008ecafcb944d (patch) | |
tree | c8742e78b400d3cc29602aaaafe89fe9723b4dda | |
parent | 9d5c00ff55c1e0d43e6a996f7628ec166a69351f (diff) |
Set predictive GOP size for MPEG.
-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 } |