diff options
Diffstat (limited to 'bin/recv-gst-rtp-v-a')
-rwxr-xr-x | bin/recv-gst-rtp-v-a | 10 |
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;\ + ) |