diff options
Diffstat (limited to 'bin/stream')
-rwxr-xr-x | bin/stream | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -191,6 +191,8 @@ HEIGHTS=$(uniqwords "$HEIGHTS_WEBM $HEIGHTS_MPEG") [ -z "${SAVEDIR:-}" ] || SAVESTEM="${SAVEDIR:-}/$(date +%Y%m%d-%H%M%S)" [ -z "${SAVEDIR:-}" ] || export FFREPORT=file="$SAVESTEM.log" +# * scale+watermark trick based on http://stackoverflow.com/a/10937357 +# + scale to square pixels as needed filters_compose() { logo=$1; heightcount=$(echo "$HEIGHTS" | wc --words) echo_n "[$VSTREAMINDEX:v]${DEINT:+$DEINT,}${VFRAMERATE:+framerate=$VFRAMERATE,}format=pix_fmts=yuv420p,split=$heightcount" @@ -211,6 +213,9 @@ filter_split_codec() { heights_webm=$1; heights_mpeg=$2; done } +# * 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 encode_opus() { echo_n "-codec:a libopus -ac $ACHANNELS -ar $AFRAMERATE_OPUS -b:a $ABITRATE_OPUS" } @@ -230,17 +235,13 @@ encode_x264() { bitrate=$1; speed=$2; -maxrate $bitrate -bufsize $((bitrate*2)) -crf 23 \ -force_key_frames expr:gte(t,n_forced*2)" } + +# * routing based on http://trac.ffmpeg.org/wiki/Creating%20multiple%20outputs#Teepseudo-muxer +# * Use same RTP payload types as GStreamer tee_rtp() { stream=$1; pt=$2; port=$3; echo_n "[select=\'$stream\':f=rtp:payload_type=$pt]rtp://$IP:$port?pkt_size=1440" } -# * scale+watermark trick based on http://stackoverflow.com/a/10937357 -# + scale to square pixels as needed -# * 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_SRC" -channels "$ACHANNELS" -thread_queue_size 2048 -i "$ALSA"} \ ${DVCAM:+-f iec61883 -thread_queue_size 64 -i $DVCAM} \ |