summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2017-05-22 15:31:41 +0200
committerJonas Smedegaard <dr@jones.dk>2017-05-22 15:31:41 +0200
commit42193b81bd1bcdf47b2dea81c6df03ec2d90faea (patch)
treee2b3707235f3473da277793e059d6a3c478d902f
parent414d5a435051e65b0bd6420e6fb2c3eae0101417 (diff)
Use mux() for mpeg (not only webm).
-rwxr-xr-xbin/stream5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/stream b/bin/stream
index 44374d6..7a5851c 100755
--- a/bin/stream
+++ b/bin/stream
@@ -103,6 +103,7 @@ fi
[ -n "${NOAUDIO:-}" ] || [ -z "$AINPUT$XINPUT" ] || HASAUDIO=1
[ -n "${NOVIDEO:-}" ] || [ -z "$VINPUT$XINPUT" ] || HASVIDEO=1
TARGETS_WEBM="${HASAUDIO:+rtp_opus} ${HASVIDEO:+rtp_vp8}"
+TARGETS_MPEG="rtp_mpegts"
VSTREAMINDEX=1
[ -n "$AINPUT" ] || VSTREAMINDEX=0
@@ -244,6 +245,7 @@ mux() { targets="$1";
case "$targets" in
rtp_opus) echo_n "-f rtp -payload_type 111 rtp://$IP:$FIRSTPORT?pkt_size=1440";;
rtp_vp8) echo_n "-f rtp -payload_type 100 rtp://$IP:$((FIRSTPORT+2))?pkt_size=1440";;
+ rtp_mpegts) echo_n "-f rtp_mpegts rtp://$IP:10000?pkt_size=1440";;
*) exit1 "Unknown target $targets";;
esac
else
@@ -252,6 +254,7 @@ mux() { targets="$1";
case "$target" in
rtp_opus) echo_n "[select=\'a\':f=rtp:payload_type=111]rtp://$IP:$FIRSTPORT?pkt_size=1440";;
rtp_vp8) echo_n "[select=\'v\':f=rtp:payload_type=100]rtp://$IP:$((FIRSTPORT+2))?pkt_size=1440";;
+ rtp_mpegts) echo_n "[f=rtp_mpegts]rtp://$IP:$((FIRSTPORT+2))?pkt_size=1440";;
*) exit1 "Unknown target $target";;
esac
targetcount=$((targetcount-1))
@@ -288,4 +291,4 @@ ffmpeg -hide_banner -threads auto \
$(encode_aac) } \
${HASVIDEO:+\
$(encode_x264 "$VBITRATE" "$SPEED_X264") } \
- -f rtp_mpegts rtp://$IP:10000 }
+ $(mux "$TARGETS_MPEG") }