summaryrefslogtreecommitdiff
path: root/bin/recv-gst-rtp-v-a
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2017-05-11 11:45:15 +0200
committerJonas Smedegaard <dr@jones.dk>2017-05-11 11:55:47 +0200
commit61ba220b60087b62410b6709005f8ddfbdd711d6 (patch)
treea79e80b4aaa4351cb8888bca401efe2e02604b61 /bin/recv-gst-rtp-v-a
parente15ed7596332db8d84422342d318d26d0f6e7dda (diff)
Normalize device loop.
Diffstat (limited to 'bin/recv-gst-rtp-v-a')
-rwxr-xr-xbin/recv-gst-rtp-v-a10
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/recv-gst-rtp-v-a b/bin/recv-gst-rtp-v-a
index 2289d04..1da2106 100755
--- a/bin/recv-gst-rtp-v-a
+++ b/bin/recv-gst-rtp-v-a
@@ -4,8 +4,8 @@
set -e
CAMIP=${CAMIP:-$1} # origin host - default: use multicast group
-VCOUNT=${VCOUNT:-$2} # number of video stream(s) to display - default: 1
-ACOUNT=${ACOUNT:-$3} # number of audio stream(s) to play - default: 0
+VCOUNT=${VCOUNT:-${2:-1}} # number of video stream(s) to display - default: 1
+ACOUNT=${ACOUNT:-${3:-0}} # number of audio stream(s) to play - default: 0
VFORMAT=${VFORMAT:-$4} # H264 VP8 RAW - default: RAW
AFORMAT=${AFORMAT:-$5} # AMR OPUS RAW - default: RAW
VSINK=${VSINK:-autovideosink}
@@ -76,5 +76,7 @@ stream() {
gst-launch-1.0 -v \
rtpbin name=rtpbin latency=$NETLATENCY drop-on-latency=true \
- $(for i in $(seq "${VCOUNT:-1}"); do stream "$i" "$VCAPS" "$VDEC ! $VSINK"; done) \
- $(for j in $(seq "${ACOUNT:-0}"); do stream $((VCOUNT+j)) "$ACAPS" "$ADEC ! $ASINK buffer-time=$ABUFFERS"; done)
+ $(n=0;\
+ for i in $(seq "$VCOUNT"); do n=$((n+1)); stream "$n" "$VCAPS" "$VDEC ! $VSINK"; done;\
+ for i in $(seq "$ACOUNT"); do n=$((n+1)); stream "$n" "$ACAPS" "$ADEC ! $ASINK buffer-time=$ABUFFERS"; done;\
+ )