summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2022-05-25 00:06:10 +0300
committerEvgeny Zinoviev <me@ch1p.io>2022-05-25 00:06:10 +0300
commitf9991f455511b2993b22e54c982cf506adc10808 (patch)
tree7db6c048cb5afb09718e8c29bf33f4429d8916c7 /tools
parentc75812751eaa50cd6ea005dd6ca3c1a39c4d74dc (diff)
ipcam_capture: support specifying rtsp transport protocol
Diffstat (limited to 'tools')
-rwxr-xr-xtools/ipcam_capture.sh23
1 files changed, 21 insertions, 2 deletions
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}@"