Embedding DVR Video Streams Into Grafana

dvr_header.jpg

These panels are a live feed embedded into Grafana via iframes. During the conversion of the video from RTSP which comes from your DVR - to HTTP, which can be displayed on a web page, you do lose some quality and frame rate, but being able to embed multiple video streams into multiple web pages also gives many advantages.

In my case I'm using an Annke 8 camera DVR I got off of Amazon for about $160. (Click here to see it on Amazon)

UPDATE: I have since purchased another brand DVR for a client, and it did NOT have RTSP stream output. I had to send it back and get an ANNKE brand DVR, and the ANNKE brand does seem to consistently have RTSP capability.

This tutorial is Windows specific, although many items are cross-platform compatible.

Dependencies

  • A DVR
  • ContaCam
  • Grafana
  • XAMPP
  • A Windows PC

1. Connect your DVR to your network

If your DVR has a wifi option, I recommend switching that feature off and hard-wiring instead. It will offer a much more stable and reliable connection to ContaCam.

2. Give your DVR a static IP address

This will give ContaCam a consistent IP address from which to pull the RTSP stream.

When you connect the DVR to your network, it will most likely be issued a DHCP address automatically. You can see this address by hooking the DVR up to a monitor, accessing the on-screen menu and checking the network settings. Alternatively you should be able to log into the DVR's web admin panel after reading the DVR's DHCP issued IP address from your router's list of DHCP clients.

If your DVR doesn't offer the ability to set a static IP address, don't sweat it too much - it is likely that your DVR will keep the same IP address for a long time, if not for the entire life of your router. In the event that it doesn't keep the same IP address, you'll just have to find the DVR's IP address and update it in ContaCam occasionally.

You may have to refer to your DVR's manuals in order to figure out how to do this. In my case, it's just an option under my DVR's web administration panel.

dvr_config.jpg

3. Install ContaCam on your PC

You can download ContaCam by clicking here. It's free, although there is a nag message on the camera feed asking for donations.

4. Find your DVR's RTSP Stream URL

In my particular case, my DVR's RTSP stream URL is as follows: (I have X'd out the IP address for privacy reasons)

rtsp://192.168.XXX.XXX/Streaming/Channels/101

The trailing number, 101, indicates the first camera in the DVR. Each subsequent camera's URL increments upward in this fashion: 101, 201, 301, etc. all the way to 801, which indicates the last camera on my DVR. In my case, there are a total of 8 cameras so the final RTSP stream url is as follows:

rtsp://192.168.XXX.XXX/Streaming/Channels/801

Please note that this particular RTSP stream URL is specific to my DVR. You may have to research your own DVR's RTSP stream, and it's not normally available in the accompanying manuals. Some Google-Foo might be in order.

5.1 Enter the RTSP stream URL into ContaCam

Now start ContaCam and go to Camera ->  Network / IP Camera and paste the DVR's RTSP URL into the connection dialog, then enter your DVR's administrative username and password and click OK.

connect_RTSP_Stream.JPG

A camera feed should pop up inside ContaCam that shows what the camera is seeing, shown below.