summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2017-05-05 17:44:32 +0200
committerJonas Smedegaard <dr@jones.dk>2017-05-05 17:44:32 +0200
commitf6c9bd0e9e81210b119df4a608c6c2be274ba2b8 (patch)
tree7cde9b4aa993ebd7d5fe946159ff9237dde47783
parent7e83ea62492c99a2cce4fffb772204da52ea3969 (diff)
Prepare for multiple heights: Map video codecs dynamically.
-rwxr-xr-xbin/stream4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/stream b/bin/stream
index e1d0925..686b1c1 100755
--- a/bin/stream
+++ b/bin/stream
@@ -126,7 +126,7 @@ ffmpeg -hide_banner -threads auto -re \
-segment_list "$SAVESTEM.ffconcat" -segment_list_flags live \
-segment_time 600 -segment_atclocktime 1 -strftime 1 "$SAVESTEM-%H%M.mkv"} \
${HEIGHTS_WEBM:+\
- ${HASAUDIO:+-map '0:a' }${HASVIDEO:+ -map "[v${height}webm]" } \
+ ${HASAUDIO:+-map '0:a' }${HASVIDEO:+$(printf_each ' -map [v%swebm]' "$HEIGHTS_WEBM") } \
${HASAUDIO:+\
-codec:a libopus -ac "$ACHANNELS" -ar "$AFRAMERATE" -b:a "$ABITRATE" } \
${HASVIDEO:+\
@@ -140,7 +140,7 @@ ffmpeg -hide_banner -threads auto -re \
"${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}" } \
${HEIGHTS_MPEG:+\
- ${HASAUDIO:+-map '0:a' }${HASVIDEO:+ -map "[v${height}mpeg]" } \
+ ${HASAUDIO:+-map '0:a' }${HASVIDEO:+$(printf_each ' -map [v%smpeg]' "$HEIGHTS_MPEG") } \
${HASAUDIO:+\
-codec:a aac -strict experimental -ac "$ACHANNELS" -ar 44100 -b:a $((ACHANNELS*64))k } \
${HASVIDEO:+\