summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2017-04-28 03:50:51 +0200
committerJonas Smedegaard <dr@jones.dk>2017-04-28 03:50:51 +0200
commit9834d95d5f04fa198697851bc18ddae6e00f149d (patch)
tree75977886e6a5ca1ba2a9665d22969dc9820d251f /bin
parentc9889f639d8d4a48e3358816c1f7dba923b96954 (diff)
Fix save only A/V (not also watermark when only a single true source).
Diffstat (limited to 'bin')
-rwxr-xr-xbin/stream3
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/stream b/bin/stream
index f20c589..7688f95 100755
--- a/bin/stream
+++ b/bin/stream
@@ -64,6 +64,7 @@ fi
[ -z "$XINPUT" ] || [ $XINPUT -eq 1 ] || exit1 "Too many arguments: Max. 1 multimedia source"
[ -n "$NOAUDIO" ] || [ -z "$AINPUT$XINPUT" ] || MAYBEAUDIO=1
[ -n "$NOVIDEO" ] || [ -z "$VINPUT$XINPUT" ] || MAYBEVIDEO=1
+[ "$AINPUT$VINPUT$XINPUT" = "1" ] || TWOSOURCES=1
VSTREAMINDEX=1
[ -n "$AINPUT" ] || VSTREAMINDEX=0
@@ -91,7 +92,7 @@ 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?' \
+ ${SAVEDIR:+-map '0:' ${TWOSOURCES:+-map '1:'} \
-codec copy \
-f matroska "file:$SAVEDIR/$(date +%Y%m%d-%H%M%S).mkv"} \
${MAYBEAUDIO:+-map '0:a' \