From c9889f639d8d4a48e3358816c1f7dba923b96954 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Fri, 28 Apr 2017 02:02:22 +0200 Subject: Support saving a copy of inputs to SAVEDIR. --- bin/stream | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'bin') diff --git a/bin/stream b/bin/stream index 7270f6b..f20c589 100755 --- a/bin/stream +++ b/bin/stream @@ -80,6 +80,7 @@ VBITRATE=256000 # + scale+watermark trick based on http://stackoverflow.com/a/10937357 # + Add 1s latency (deadline) # + Use same RTP payload types as GStreamer +${SAVEDIR:+export FFREPORT=file="$SAVEDIR/%t.log"} ffmpeg -hide_banner -threads auto -re \ ${ALSA:+-f alsa -sample_rate "$AFRAMERATE" -channels "$ACHANNELS" -thread_queue_size 1024 -i "$ALSA"} \ ${DVCAM:+-f iec61883 -i $DVCAM} \ @@ -90,6 +91,9 @@ ffmpeg -hide_banner -threads auto -re \ ${MAYBEVIDEO:+-filter_complex \ "[$VSTREAMINDEX:v]scale=-1:$HEIGHT${WATERMARK:-[v]}${WATERMARK:+[bg]${LOGO:+; [bg][$((VSTREAMINDEX+1)):v]overlay=main_w-overlay_w-20:main_h-overlay_h-20[v]}}"} \ + ${SAVEDIR:+-map ':a?' -map ':v?' \ + -codec copy \ + -f matroska "file:$SAVEDIR/$(date +%Y%m%d-%H%M%S).mkv"} \ ${MAYBEAUDIO:+-map '0:a' \ -codec:a libopus -ac "$ACHANNELS" -ar "$AFRAMERATE" -b:a "$ABITRATE" \ -f rtp -payload_type 111 "rtp://$IP:$FIRSTPORT?pkt_size=1200"} \ -- cgit v1.2.3