tanidvr - tool for DVRs and IP cameras based on DVR-IP
protocol used by Dahua
tanidvr -m <mode> -t <address> -u <user> -w <password> [OPTION]
TaniDVR is a CLI tool for accessing DVRs and IP cameras used for
CCTV surveillance systems based on the proprietary DVR-IP protocol (port
37777/TCP).
The main use of TaniDVR is to dump video from a device. With this,
it can record to a Matroska (MKV) file or dump the video in realtime to play
in an external player.
- -m,
--operation-mode
- 0 - display DVR information. 1 - dump video.
- -t,
--dvr-target
- IP/hostname.
- -p,
--dvr-port
- Network port (default 37777).
- -u,
--dvr-user
- DVR user (may not work if not admin!).
- -w,
--dvr-password
- DVR password.
- -c,
--dvr-channel
- 0-255 (default 0).
- -s,
--dvr-sub-channel
- 0 - main (default). 1 - secondary.
- -a,
--net-protocol-dialect
- 0 - common dialect (default). 1 - common dialect, while emulating OEM
client behavior.
- -n,
--media-container
- 0 - DVR native: DHAV (.dav|.dhav) or RAW H.264 (depends on the DVR
itself). 1 - Matroska (.mkv) (default).
- -f,
--out-file
- <filename> (default: empty -- console stdout).
- -k,
--keep-alive
- <mili_seconds> (default: 100ms). Send innocuous packets to the DVR
in order to avoid the connection to be dropped gratuitously. To disable
(not recommended), set to 0.
- -e,
--timeout
- <mili_seconds> (default 5000ms). Inactivity timeout for DVR
connection to be considered dead. A new DVR connection is started after
this. To disable (not recommended), set to 0.
- -x,
--sixty-hertz-ntsc
- (default: not enabled). If defined, assumes NTSC field frequency to be
60Hz, instead of the typical 59.94Hz. Some cameras do generate exact 60Hz
video. This switch does NOT affect PAL video.
- -r,
--ts-proc
- 0 - No correction will be performed to the buggy DHAV stream timestamps. 1
- Perform timestamp correction (default).
- -h,
--help
- Prints help message and exit.
- •
- Show some information about the DVR.
tanidvr -m 0 -t 192.168.0.12 -u admin -w secret1234
- •
- Record a video to a file.
tanidvr -m 1 -t 192.168.0.12 -u admin -w secret1234 -c 2 -f camera2.mkv
- •
- Play the video in realtime with an external player.
tanidvr -m 1 -t 192.168.0.12 -u admin -w secret1234 -c 2 | mplayer -cache 32 - 2>/dev/null
- •
- Simple media server and some clients. NOTE: INSECURE. NOT to be
implemented as-is. It is shown only for didactic purposes.
(server at 192.168.20.1)
tanidvr -n 0 -m 1 -t 192.168.0.12 -u admin -w secret1234 -c 5 | ncat --broker -l 192.168.20.1 2000
(clients ; same/other host)
ncat --recv-only 192.168.20.1 2000 | dhav2mkv | mplayer -cache 32 -
ncat --recv-only 192.168.20.1 2000 | dhav2mkv > channel_5_realtime_backup.mkv
ncat --recv-only 192.168.20.1 2000 > channel_5_realtime_backup.dhav
tanidvr was written by Daniel Mealha Cabrita
<dancab@gmx.net>.
This manual page was written by Marcos Talau
<marcos@talau.info> for the Debian project (but may be used by
others).