Ubiquti CCTV in Dashboard simple solution

I recently got a few Ubiquiti CCTV cameras and wanted to display the video on the Dashboard, I'm aware that this subject has been covered before however I didn't really want to use any other software to handle the RTP stream
Since the cameras support snapshot view whereby you can grab a still frame from the camera URL I thought that I might try to use this to simplify the process
The code below will allow "streaming" directly into the Dashboard without need of VLC or other software. The frame rate can be tinkered with but 15 fps is not too bad.

I created a UI template for each camera and modified the IP address as necessary

You'll need to change the IP address to your camera IP and ensure that "snapshot" is enabled in camera settings
It may work for other CCTV camera manufacturers if they support snapshot or still's

Maybe someone will find it of some use should they want a lightweight solution to incorporate their CCTV in the Dash


<!doctype html>
        <meta charset="utf-8">      
        <title>Image Refresh Two</title>


    <!-- Get the initial image. -->
    <img id="frameT" src="">

        // Use an off-screen image to load the next frame.
        var imgT = new Image();

        // When it is loaded...
        imgT.addEventListener("load", function() {

            // Set the on-screen image to the same source. This should be instant because
            // it is already loaded.
            document.getElementById("frameT").src = imgT.src;

            // Schedule loading the next frame.
            setTimeout(function() {
                imgT.src = "" + (new Date).getTime();
            }, 1000/15); // 15 FPS (more or less)

        // Start the loading process.
        imgT.src = "" + (new Date).getTime();

Tell me more about these cameras. The way your display works makes them very efficient for using with my Python "AI person detector"

How much do they cost? What is the pixel resolution of the snapshots?

I used to think 720p or 1080p would be about the maximum needed, seeing how the image is resized to 300x300 for the Ai inference. I was shocked to see the detection performance improve significantly when I got a 4K UHD camera -- improvement was so dramatic I've replaced the six most important views with them (prices have dropped dramatically $60-80).

is that '(prices have dropped dramatically by $60-80'
or 'prices have dropped dramatically to $60-80'

if it's to $60-$80 - where?

"analog" 4K cameras;
Costco has had the Lorex UHD cameras" on sale" for ~$80 that go with the Lorex UHD system they sell.
Amazon has these (that work with the Lorex UHD DVR for $55 (still need cable and 12V 1A supply)

For Netcams Amazon has these for $80:

A nice 4-port POE switch for ~$31:

The downside is the Pi4 can handle maybe two UHD rtsp streams, but can do 4 or more 1080p streams.

The Pi3B+ can handle 6 Onvif snapshot camers but I haven't found many "Onvif Snapshot" camera that delivers the full resolution. I found one that is looking good in my testing giving full 1080p snapshots, but its not POE, for $38 at Amazon. but more are not available at the moment :frowning:

I'm working on some recommendations for when I update my GitHub with my latest Python AI code and node-red controller-viewer.

1 Like


The cameras I use are Ubiquiti UVC-G3-AF

The snapshots are 1080p

The Ubiquiti cameras are expensive at around Ā£130 each or $170 each in the UK when compared to other brands


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.