TANIDVR(1)

πŸ’– tanidvr(1) β€” bestie's guide to pulling video off DVRs πŸ’–

okay so hi, this is the manual page for tanidvr(1), a lil command-line bestie for talking to DVRs and IP cameras that speak the DVR-IP protocol that Dahua uses. it's from the tanidvr tool family and yeah, we're doing this together, no cap 🫢


✨ NAME ✨

tanidvr β€” the tool for DVRs and IP cameras based on the DVR-IP protocol used by Dahua. that's literally it, that's the whole vibe.


🌸 SYNOPSIS 🌸

tanidvr -m <mode> -t <address> -u <user> -w <password> [OPTION]

like... you give it a mode, an address, a user, a password, and then whatever extra options your heart desires πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

TaniDVR is a CLI tool for accessing DVRs and IP cameras used for CCTV surveillance systems, and it works over the proprietary DVR-IP protocol on port 37777/TCP. yes bestie, one specific port, it knows what it likes.

The main character energy of TaniDVR is dumping video from a device. With that, it can record to a Matroska (MKV) file, or it can dump the video in realtime so you can play it in an external player. both are iconic, pick your fighter ✨


πŸŽ€ OPTIONS πŸŽ€

  • -m, --operation-mode β€” 0 shows you some DVR info. 1 dumps video. that's the whole menu, simple queen behavior.
  • -t, --dvr-target β€” the IP/hostname, like where your camera lives. gotta know the address to slide into its DMs.
  • -p, --dvr-port β€” network port (default 37777).
  • -u, --dvr-user β€” DVR user (heads up, this may not work if you're not admin!).
  • -w, --dvr-password β€” DVR password. keep it secret, keep it safe πŸ”
  • -c, --dvr-channel β€” 0-255 (default 0).
  • -s, --dvr-sub-channel β€” 0 is main (default). 1 is secondary.
  • -a, --net-protocol-dialect β€” 0 is the common dialect (default). 1 is the common dialect but while emulating OEM client behavior. dress-up mode fr.
  • -n, --media-container β€” 0 is DVR native: DHAV (.dav|.dhav) or RAW H.264 (depends on the DVR itself). 1 is Matroska (.mkv) (default).
  • -f, --out-file β€” <filename> (default: empty β€” console stdout). so if you don't say anything, it just yells the video at your terminal.
  • -k, --keep-alive β€” <mili_seconds> (default: 100ms). sends innocuous packets to the DVR so the connection doesn't get dropped gratuitously. to disable it (not recommended), set to 0. it's giving "texting back so they don't ghost you" 😭
  • -e, --timeout β€” <mili_seconds> (default 5000ms). this is the inactivity timeout β€” how long the DVR connection can sit there doing nothing before it's considered dead. a new DVR connection is started after this. to disable it (not recommended), set to 0.
  • -x, --sixty-hertz-ntsc β€” (default: not enabled). if defined, it assumes the NTSC field frequency is 60Hz instead of the typical 59.94Hz. some cameras do generate exact 60Hz video. important: this switch does NOT affect PAL video. periodt.
  • -r, --ts-proc β€” 0 means no correction will be performed to the buggy DHAV stream timestamps. 1 means perform timestamp correction (default).
  • -h, --help β€” prints the help message and exits. the classic.

🌈 EXAMPLES 🌈

  • 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
  • a simple media server and some clients. NOTE: INSECURE. NOT to be implemented as-is. it's shown only for didactic purposes. do not deploy this, bestie, i'm begging πŸ™ˆ
(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
🚨 real talk: that media-server example is INSECURE and should NOT be implemented as-is. it's purely for didactic purposes. look at it, learn from it, do not ship it.

πŸ’œ AUTHOR πŸ’œ

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).


and that's a wrap, bestie 🫢 this was tanidvr version 1.4.1, dated 18 Aug 2022, straight from the tanidvr manual pages. go dump some video, stay secure, and remember β€” never expose that ncat server, iykyk πŸ’…βœ¨