From f9991f455511b2993b22e54c982cf506adc10808 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Wed, 25 May 2022 00:06:10 +0300 Subject: ipcam_capture: support specifying rtsp transport protocol --- tools/ipcam_capture.sh | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/ipcam_capture.sh b/tools/ipcam_capture.sh index d96c06f..d1c13c2 100755 --- a/tools/ipcam_capture.sh +++ b/tools/ipcam_capture.sh @@ -6,6 +6,8 @@ IP= CREDS= DEBUG=0 CHANNEL=1 +FORCE_UDP=0 +FORCE_TCP=0 die() { echo >&2 "error: $@" @@ -22,6 +24,8 @@ Options: --port RTSP port (default: 554) --creds --debug + --force-tcp + --force-udp --channel 1|2 EOF @@ -55,6 +59,14 @@ while [[ $# -gt 0 ]]; do DEBUG=1 ;; + --force-tcp) + FORCE_TCP=1 + ;; + + --force-udp) + FORCE_UDP=1 + ;; + --channel) CHANNEL="$2" shift @@ -78,10 +90,17 @@ if [ ! -d "${OUTDIR}" ]; then echo "Created $OUTDIR." fi +args= if [ "$DEBUG" = "1" ]; then - args="-v info" + args="$args -v info" else - args="-nostats -loglevel warning" + args="$args -nostats -loglevel warning" +fi + +if [ "$FORCE_TCP" = "1" ]; then + args="$args -rtsp_transport tcp" +elif [ "$FORCE_UDP" = "1" ]; then + args="$args -rtsp_transport udp" fi [ ! -z "$CREDS" ] && CREDS="${CREDS}@" -- cgit v1.2.3