From 30d52bfd1b2451f7223b8888ddbbff63d3d76dd5 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 4 May 2017 13:54:33 +0200 Subject: Use pseudo-format tee. --- bin/stream | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'bin') diff --git a/bin/stream b/bin/stream index 2fdd50d..2fad692 100755 --- a/bin/stream +++ b/bin/stream @@ -99,14 +99,16 @@ ffmpeg -hide_banner -threads auto -re \ -f segment -segment_format matroska -segment_format_options live=1:reserve_index_space=512kB \ -segment_list "$SAVESTEM.ffconcat" -segment_list_flags live \ -segment_time 600 -segment_atclocktime 1 -strftime 1 "$SAVESTEM-%H%M.mkv"} \ - ${HASAUDIO:+-map '0:a' \ - -codec:a libopus -ac "$ACHANNELS" -ar "$AFRAMERATE" -b:a "$ABITRATE" \ - -f rtp -payload_type 111 "rtp://$IP:$FIRSTPORT?pkt_size=1200"} \ - ${HASVIDEO:+-map '[v]' \ + ${HASAUDIO:+-map '0:a' } ${HASVIDEO:+-map '[v]' } \ + ${HASAUDIO:+ + -codec:a libopus -ac "$ACHANNELS" -ar "$AFRAMERATE" -b:a "$ABITRATE" } \ + ${HASVIDEO:+\ -pix_fmt yuv420p \ -codec:v vp8 -quality realtime -deadline 1000000 -cpu-used 15 \ -b:v "$VBITRATE" -minrate "$VBITRATE" -maxrate "$VBITRATE" \ -undershoot-pct 95 -bufsize $((6000*VBITRATE/1000)) -rc_init_occupancy $((4000*VBITRATE/1000)) \ -max-intra-rate 0 \ - -qmin 4 -qmax 56 \ - -f rtp -payload_type 100 "rtp://$IP:$((FIRSTPORT+2))?pkt_size=1200"} + -qmin 4 -qmax 56 } \ + -f tee \ + "${HASAUDIO:+[select=\'a\':f=rtp:payload_type=111]rtp://$IP:$FIRSTPORT?pkt_size=1200| \ + }${HASVIDEO:+[select=\'v\':f=rtp:payload_type=100]rtp://$IP:$((FIRSTPORT+2))?pkt_size=1200}" -- cgit v1.2.3