diff options
author | Jonas Smedegaard <dr@jones.dk> | 2017-05-04 17:38:27 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2017-05-04 17:38:27 +0200 |
commit | fd0cbbd3a1fedcf5814cec7f5d430af1b48148bc (patch) | |
tree | 1a7410a49ef0c7c8ad1142f4880d1eb6d6e0fade | |
parent | 2fe152d9dcdcb859c029f06054c60c87d5721ced (diff) |
Add switch variable MKWEBM.
-rwxr-xr-x | bin/stream | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -77,6 +77,10 @@ ABITRATE=32000 HEIGHT=360 VBITRATE=256000 +MKWEBM='[webm]' + +[ -z "$MKWEBM" ] || VCODECCOUNT=$((VCODECCOUNT+1)) + SAVESTEM="$SAVEDIR/$(date +%Y%m%d-%H%M%S)" ${SAVEDIR:+export FFREPORT=file="$SAVESTEM.log"} @@ -94,13 +98,15 @@ ffmpeg -hide_banner -threads auto -re \ ${LOGO:+-i "$LOGO"} \ ${HASVIDEO:+-filter_complex \ "[$VSTREAMINDEX:v]scale=-2:$HEIGHT${WATERMARK:-[v]}${WATERMARK:+[bg]${LOGO:+; - [bg][$((VSTREAMINDEX+1)):v]overlay=main_w-overlay_w-20:main_h-overlay_h-20[v]}}"} \ + [bg][$((VSTREAMINDEX+1)):v]overlay=main_w-overlay_w-20:main_h-overlay_h-20[v]}} + [v]split=$VCODECCOUNT$MKWEBM" } \ ${SAVEDIR:+-map '0:' ${TWOSOURCES:+-map '1:'} \ -codec copy \ -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' } ${HASVIDEO:+-map '[v]' } \ + ${HASAUDIO:+-map '0:a' } ${HASVIDEO:+-map '[webm]' } \ + ${MKWEBM:+\ ${HASAUDIO:+\ -codec:a libopus -ac "$ACHANNELS" -ar "$AFRAMERATE" -b:a "$ABITRATE" } \ ${HASVIDEO:+\ @@ -112,4 +118,4 @@ ffmpeg -hide_banner -threads auto -re \ -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}" + }${HASVIDEO:+[select=\'v\':f=rtp:payload_type=100]rtp://$IP:$((FIRSTPORT+2))?pkt_size=1200}" } |