summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/stream14
1 files changed, 8 insertions, 6 deletions
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}"