How to display CCTV camera in dashboard (RTSP)

:slightly_smiling_face: Yes, of course, best is to reduce as much as possible what is sent from the cameras

This is what is seen in my dashboard with changed camera resolutions. Still good enough with 640x480

                           1024x768

image

                           640x480

image

Whats your delay to the dash?

On my macbook air and iphone when wifi connected to same home network, 1 second
On my iPhone via 4G and VPN, 5 seconds

Ok lets have it then:
Camera:
Height: _____
Width:______
FPS:_______
Motion:
Height: _____
Width:______
Framerate:_______

Can you provide me the info?
Starting to get a bit frustated here.... Can it be my network speed?

To find where you have delays

  1. Check the delay when you view the camera directly with a browser
  2. Check the delay when viewing via Motion gui
  3. Check delay when viewing via dashboard

If you have most delay in Motion, there is some parameter that needs to be changed there. Check also that you have smart_mask_speed set to 0

After checking your points i have no delay on viewing the camera directly on a browser. The Motion gui presents a 4 min delay!
Do you wanna check my hole config?

I give you a sample of my config for a ip camera and you can check what may be different

Also, when Motion is in detecting mode, I have the same low delay, no difference

Check the cpu load with top on your Pi when Motion is running. In my case it is only around 17% and 26% when detecting, no movements. 2 cameras, RPi3

sample_config.txt (3.4 KB)

Tried your settings, still have a big delay.
I'm with a VPN. Gonna check if in my network i have the same delay. Either way im not getting convinced with motion... Have to drop the quality way too much when i can use the Reolink app and have a crispy sharp image and the motion detection.... The catch? All the cameras have to be reolink

Get ready for this Walter, now my Motion stream is faster than the camera IP..... That's very strange.

image

CAM:
image
MOTION:
image

Is that magic?

Only explanation I can imagine,,,,such cameras, looks like yours is pretty advanced, have several streams and maybe you have one connected to Motion and when you view it directly, you see another. The time difference is maybe less than a second between and could very well be caused by the camera itself when generating the streams. Date & time is coming from the camera itself it looks?

But with that very high resolution, I believe you will have very long delays in Motion. Have you tried to set it lower to 640x480 in the camera?

Or try another stream instead of "Clear" and see what configuration it has or set that to a much lower and use it in Motion. You could have a high resolution stream for viewing directly and a lower resolution sent to Motion

In the "Clear" stream that is the lowest resolution - 2304*1296 (its a 5MP cam).
I was in the "Fluent" stream (another from the dropdown) and could set it to 640x480 but was having that horrible delay.
I'm gonna leave it as it is for know and try to mess with it a bit. CPU usage dropped as well ~6%

UPDATE: already see the stream on my iPhone - solution: close the 20+ pages open and cleaned the cache! :slight_smile:
How can i disable the scroll in the template node?

OK, so now you have an "acceptable" delay also through Motion? If so, very good? And very low cpu load as well, that is brilliant!

The scroll, I suppose you mean the scroll bar/bars, are all part of the dashboard elements. I believe they are automatically shown when the widget has too little room in the view to fully show it's content. Only way I know how to make them disappear is to make the size of the widget larger and down scale the content. Try to reduce the size of the video frames in the template node and see what's happen, you have to experiment a bit with this until it fits the size/resolution of your monitor (or have a bigger screen with higher resolution)

Yes! Gonna explore the google drive upload now. Can i count on you if i need to? ahahah

Already messed with the sizes and everything is ok. The bars are gone.

I have not used that, I use a drive on my network to save pictures when Motion detects
Are you looking for uploading pictures to Google drive from Motion? If so, a possible solution could eventually be:

Camera -> Motion detects some strange people in your garden -> python scripts sends pictures to Node-RED via mqtt -> to Google drive via some Google drive node

Eventually the python script could do it as well

Sorry, I see at the end that you're using motion on raspy to decode the rtsp. Is there another way to make it all inside node-red? Because I'm on a PC and I cannot install motioneye.
Thanks

The topic starts with

Blockquote
vlc.exe -R rtsp://admin:password@10.4.5.24:554/Streaming/Channels/101/ --sout "#transcode{vcodec=mjpg,vb=2500,scale=1.0,fps=10,acodec=none}:standard{access=http{mime=multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8888/videostream.cgi}
This generates an MJPG which can be displayed with a simple Dashboard template node:

Where should I put it?

Hi @Lupin_III,
Via the link to my post aboveyou can find a solution that only needs ffmpeg to be installed.

Thanks Bart, I succeed in showing the camera inside the flow. I put a template node connected to the "Decode RTSP stream" one, but this is what is shown.
image
this what I wroew inside the template node:

<div>
<img width="312px" height="312px" src={{msg.payload}} ><br/>
</div>

you have to insert a b64 node like this :
image
image

this is my working template node code :

<img width="16" height="360" src="data:image/jpg;base64,{{msg.payload}}"/>
3 Likes