diff options
Diffstat (limited to 'bin/stream')
-rwxr-xr-x | bin/stream | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -238,21 +238,21 @@ encode_x264() { bitrate=$1; speed=$2; # * routing based on http://trac.ffmpeg.org/wiki/Creating%20multiple%20outputs#Teepseudo-muxer # * Use same RTP payload types as GStreamer -mux_webm() { - targetcount=$(echo "$TARGETS_WEBM" | wc --words) +mux() { targets="$1"; + targetcount=$(echo "$targets" | wc --words) if [ $targetcount -lt 2 ]; then - case "$TARGETS_WEBM" in + case "$targets" in rtp_opus) echo_n "-f rtp -payload_type 111 rtp://$IP:$FIRSTPORT?pkt_size=1440";; rtp_vp8) echo_n "-f rtp -payload_type 100 rtp://$IP:$((FIRSTPORT+2))?pkt_size=1440";; - *) exit1 "Unsupported muxing $TARGETS_WEBM";; + *) exit1 "Unknown target $targets";; esac else echo_n "-f tee " - for muxing in $TARGETS_WEBM; do + for muxing in $targets; do case "$muxing" in rtp_opus) echo_n "[select=\'a\':f=rtp:payload_type=111]rtp://$IP:$FIRSTPORT?pkt_size=1440";; rtp_vp8) echo_n "[select=\'v\':f=rtp:payload_type=100]rtp://$IP:$((FIRSTPORT+2))?pkt_size=1440";; - *) exit1 "Unsupported muxing $muxing";; + *) exit1 "Unknown target $muxing";; esac targetcount=$((targetcount-1)) [ $targetcount -lt 1 ] || echo_n '|' @@ -281,7 +281,7 @@ ffmpeg -hide_banner -threads auto \ $(encode_opus) } \ ${HASVIDEO:+\ $(encode_vp8 "$VBITRATE" "$SPEED_VP8") } \ - $(mux_webm) } \ + $(mux "$TARGETS_WEBM") } \ ${ENCODINGS_MPEG:+\ ${HASAUDIO:+-map '0:a' }${HASVIDEO:+$(printf_each ' -map [v%smpeg]' "$ENCODINGS_MPEG") } -shortest \ ${HASAUDIO:+\ |