tools/ipcam_capture: spaces to tabs and support other extensions

This commit is contained in:
Evgeny Zinoviev 2023-06-01 02:58:46 +03:00
parent 2a761a7261
commit cbd8824e61

View File

@ -8,6 +8,7 @@ DEBUG=0
CHANNEL=1
FORCE_UDP=0
FORCE_TCP=0
EXTENSION="mp4"
die() {
echo >&2 "error: $@"
@ -72,6 +73,14 @@ while [[ $# -gt 0 ]]; do
shift
;;
--mov)
EXTENSION="mov"
;;
--mpv)
EXTENSION="mpv"
;;
*)
die "Unrecognized argument: $1"
;;
@ -107,4 +116,4 @@ fi
ffmpeg $args -i rtsp://${CREDS}${IP}:${PORT}/Streaming/Channels/${CHANNEL} \
-c copy -f segment -strftime 1 -segment_time 00:10:00 -segment_atclocktime 1 \
"$OUTDIR/record_%Y-%m-%d-%H.%M.%S.mp4"
"$OUTDIR/record_%Y%m-%d-%H.%M.%S.${EXTENSION}"