View Local Camera as Live Feed in Video Player component in Perspective

Hello Everyone,

Is it any way to use Local device camera as live feed in video player component in perspective.

Basically i want to show local camera in this component

I am waiting for your positive responses.

Pretty sure the camera needs to support mjpeg streams to stream their feed directly. If it only supports rtsp then you can use @pturmel's module

Well, I think the Perspective viewer has more capabilities. But you still have cross-origin restrictions that my module would address. In Perspective, you have to script reload of the player any time the stream stops.

What about streams that use basic authentication? Does your module support that, Phil?

Current OpenCV support appears to work with basic auth. (I don't claim to support anything not supported by OpenCV's VideoCapture class.)

(You can always use trial mode with your sample....)

1 Like

I might have to give your module a go in trial mode then for one of my customer's sites, as they're missing their video streams they had in Vision since moving to perspective

Do remember that it is a CPU hog, even when no-one is watching.

I seem to recall you saying that. Maybe just proof of concept for now and we'll run it in its own VM with separate platform licence if they choose to go ahead with it.

I recommend turning your cameras' frame rates down. 12fps instead of 30 or 60 fps. Makes a big difference.

1 Like

I am having the same issue. Was the OP able to solve this?

If you don't need high frame rate, something like 1fps or so (yes 1...not a typo), you could just use the Perspective Video Player component to capture the still images from the camera (you will have to figure out the URL for your specific camera brand). For example, I did a test using an Amcrest IP camera and the source parameter used a binding expression to update/refresh the image that had the following:

"http://<camperaIPAddress>/cgi-bin/snapshot.cgi?user=<username>&password=<password>&t=" + toMillis(now(1000))

to poll and display a high-res image every second. The &t=1692723892428 part of the URL is ignored by the camera and helps with refreshing the source parameter with something new to fetch.

Note: you won't get a preview in the designer. In fact it will display File not valid just like the OP shows, but if you save and launch the project in a browser, it will display it. It is very glitchy, from my experience. If you save the project, you will have to refresh the browser (so hopes for unattended video wall may not work) and sometimes the polling just stops. If you try to poll too fast, you might just get video with a "loading" icon.
Note that with this high-res image, your network usage will spike. A single 4k image spiked throughput by about 5Mbps

Picture showing 1 camera 4k image polling at 1000ms then switching to 5000ms.

1 Like

OP's profile says they haven't even visited since the beginning of May. You might just want to try the recommendations in this topic.