summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2017-04-28 03:54:50 +0200
committerJonas Smedegaard <dr@jones.dk>2017-04-28 03:54:50 +0200
commit77dc02220c8becb59f53627caf4f1ed38dbe177d (patch)
treea9f33f6632ba7698caedc1ac83ba4397b558ee72
parent9834d95d5f04fa198697851bc18ddae6e00f149d (diff)
Generalize variable SAVESTEM.
-rwxr-xr-xbin/stream6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/stream b/bin/stream
index 7688f95..9d08418 100755
--- a/bin/stream
+++ b/bin/stream
@@ -77,11 +77,13 @@ ABITRATE=32000
HEIGHT=360
VBITRATE=256000
+SAVESTEM="$SAVEDIR/$(date +%Y%m%d-%H%M%S)"
+${SAVEDIR:+export FFREPORT=file="$SAVESTEM.log"}
+
# based on http://www.webmproject.org/docs/encoder-parameters/#real-time-cbr-encoding-and-streaming
# + 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} \
@@ -94,7 +96,7 @@ ffmpeg -hide_banner -threads auto -re \
[bg][$((VSTREAMINDEX+1)):v]overlay=main_w-overlay_w-20:main_h-overlay_h-20[v]}}"} \
${SAVEDIR:+-map '0:' ${TWOSOURCES:+-map '1:'} \
-codec copy \
- -f matroska "file:$SAVEDIR/$(date +%Y%m%d-%H%M%S).mkv"} \
+ -f matroska "file:$SAVESTEM.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"} \