# How to display CCTV camera in dashboard (RTSP)

**URL:** <https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860>\
**Category:** General\
**Created:** [16 December 2018 23:37 UTC](https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860 "2018-12-16T23:37:49Z")\
**Posts on this page:** 20\
**Page:** 6

<div class="post-metadata">

**Author:** ![wb666greene](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wb666greene/32/6534_2.png) [@wb666greene](https://discourse.nodered.org/u/wb666greene)\
**Post date:** [26 May 2019 17:55 UTC](https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860/102 "2019-05-26T17:55:06Z")

</div>

> [@dceejay](#):
>
> there is mention of a 200k limit (albeit 4 years ago)...

By resizing the images with ffmpeg -s WxH  
option, Its looking like 65K is the maximum chunk size. Images below this seem to arrive correctly, images larger seem truncated.

The beach images are like 14K and they work wondefully for me too. I'm going to compare some jpeg image frames with the frames I get reading the rtsp stream with OpenCV. Unfortunately I won't get very far until Tuesday as this is Memorial Day Holiday weekend in the US.

Its nice to expose these limitations even if there is nothing can be done to work around so I have to give up on this approach for an rtsp stream to MQTT buffer stream converter. The node-red would be very elegant if it could be made to work with other than "smallish" output images.

Rezizing my HD security system mp4 image frames to under 65K loses a lot of quality -- makes little difference on the AI person detection, but matters a lot for the "human in the loop" friend or foe determination.

---

<div class="post-metadata">

**Author:** ![GChapo](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@GChapo](https://discourse.nodered.org/u/GChapo)\
**Post date:** [31 July 2019 10:53 UTC](https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860/103 "2019-07-31T10:53:42Z")

</div>

Krambriw,

Thanks for the information here. I have got motion up and running and I can browse to my camera via the pi ip address and the port I have supplied it through the config file. Can you tell me how you got the image on your node red dashboard please?

Thanks in advance

Glenn

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [31 July 2019 11:06 UTC](https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860/104 "2019-07-31T11:06:49Z")

</div>

Hi, nice to hear,  
Try the flow in this thread

> [@A Dashboard setup for video cameras](https://discourse.nodered.org/t/a-dashboard-setup-for-video-cameras/12165):
>
> Well, seems this is an increasing interest in todays society being able to monitor your home and other belongings using all kind of video devices. Especially since they have become rather affordable and easy to install and configure So let's start simple, this beginners example flow just demonstrates how you can view live video in the dashboard. Obviously you have to change the url's to fit your specific cameras Next steps could involve adding features to integrate with your home automation & …

---

<div class="post-metadata">

**Author:** ![nishant2019](https://avatars.discourse-cdn.com/v4/letter/n/958977/32.png) [@nishant2019](https://discourse.nodered.org/u/nishant2019)\
**Post date:** [16 August 2019 14:58 UTC](https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860/106 "2019-08-16T14:58:16Z")

</div>

can you please share the flow for you camera in node red ? Thanks

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [17 August 2019 07:22 UTC](https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860/107 "2019-08-17T07:22:23Z")

</div>

It is shared already, just follow the link you see in the posting above yours

---

<div class="post-metadata">

**Author:** ![fs.santos](https://avatars.discourse-cdn.com/v4/letter/f/3da27b/32.png) [@fs.santos](https://discourse.nodered.org/u/fs.santos)\
**Post date:** [9 October 2019 13:50 UTC](https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860/108 "2019-10-09T13:50:28Z")

</div>

Hey Walter,

I was just wondering, can you help me get the notification of movement?  
I have an IP camera in my dash and i want to get a notification in my dash if it identifies any movement (Not in the DNN Analyzewr leevel yet). I have a high sensitivity setup in Motion app.

TYIA

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [9 October 2019 14:29 UTC](https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860/109 "2019-10-09T14:29:09Z")

</div>

> [@fs.santos](#):
>
> I have a high sensitivity setup in Motion app.

Do you mean you are already using Motion for motion detection ([GitHub - Motion-Project/motion: Motion, a software motion detector. Home page: https://motion-project.github.io/](https://github.com/Motion-Project/motion)) if so then that can run a script on motion detection from where you can notify node-red (via mqtt for example).

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [9 October 2019 14:42 UTC](https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860/110 "2019-10-09T14:42:33Z")

</div>

Hi,  
In Motion there are several possibilities to achieve this. One that I use myself is the configuration parameter "on\_picture\_save". Another is "on\_motion\_detected" and this is the one I use in this simple example

In Motion configuration, select the camera and list the configuration parameters. You will/should find this depending on your Motion version

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/b74ea4c6bf54bb3706b3dc4bd16620282321c5d6.png)

I have entered the full path to a simple Python script that I have in my RPi's /home/pi directory

The Python script is as an example and can be much more advanced. When Motion is set to start detection & senses motion above the configured "Threshold", it executes the script that simply connects to your mqtt broker and publishes the event. The event is captured by NR where all the other processing can be made

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/24e6afe27d1675316f33f5122730d77e15352766.png)  
With this example you will most likely get many events when Motion triggers and it will require you to configure the filters and mask to avoid too many. You can also do configurations in NR to filter out, like using the RBE node and others. As stated, this example is just a starter to make it happen...

Here is the Python script. You will have to install mosquitto as broker and paho for Python if you do not have them already. You also have to change the ip & port to fit with your local setup

```auto
#!/usr/bin/python
# USAGE
# python on_motion_detected.py

import time
import paho.mqtt.client as mqtt

def send_mqtt_message(msg):
    client = mqtt.Mosquitto()
    client.connect(mqtt_host, port)
    result, mid = client.publish(topic_out, msg, 0)
    time.sleep(1)
    client.disconnect()
    del client

# Main starts here -----------------------------------------------------------

#MQTT settings
mqtt_host = '192.168.0.241'
port = 1883
topic_out = 'motion'

send_mqtt_message('Motion detected!!!')

```

---

<div class="post-metadata">

**Author:** ![fs.santos](https://avatars.discourse-cdn.com/v4/letter/f/3da27b/32.png) [@fs.santos](https://discourse.nodered.org/u/fs.santos)\
**Post date:** [15 October 2019 20:14 UTC](https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860/111 "2019-10-15T20:14:04Z")

</div>

Walter i already have the livestream IP.  
How do i get it to show on node red dash?  
Its a template, but i cant find help anywhere

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [15 October 2019 21:30 UTC](https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860/112 "2019-10-15T21:30:17Z")

</div>

Here you have a ready made example flow that will work fine with Motion

> [@A Dashboard setup for video cameras](https://discourse.nodered.org/t/a-dashboard-setup-for-video-cameras/12165):
>
> Well, seems this is an increasing interest in todays society being able to monitor your home and other belongings using all kind of video devices. Especially since they have become rather affordable and easy to install and configure So let's start simple, this beginners example flow just demonstrates how you can view live video in the dashboard. Obviously you have to change the url's to fit your specific cameras Next steps could involve adding features to integrate with your home automation & …

---

<div class="post-metadata">

**Author:** ![fs.santos](https://avatars.discourse-cdn.com/v4/letter/f/3da27b/32.png) [@fs.santos](https://discourse.nodered.org/u/fs.santos)\
**Post date:** [15 October 2019 22:02 UTC](https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860/113 "2019-10-15T22:02:00Z")

</div>

I already tried your flow.  
I was wondering what setup you have im motion.  
I have basic authentication on my stream URL. And localhost is on.  
Even though I tried changing it and still didn't work. I get a "broken file" icon. Any thoughts?

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [16 October 2019 03:51 UTC](https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860/114 "2019-10-16T03:51:19Z")

</div>

stream\_localhost needs to be off to allow viewing cameras from other computers. Have you tried to view a camera directly in a browser from a computer on your network? Like [http://192.168.0.236:8081](http://192.168.0.236:8081/) but with ip that fits your settings?

---

<div class="post-metadata">

**Author:** ![fs.santos](https://avatars.discourse-cdn.com/v4/letter/f/3da27b/32.png) [@fs.santos](https://discourse.nodered.org/u/fs.santos)\
**Post date:** [16 October 2019 06:48 UTC](https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860/115 "2019-10-16T06:48:27Z")

</div>

> [@krambriw](#):
>
> tream\_localhost needs to be off to allow viewing cameras from other computers. Have you tried to view a camera directly in a browser from a computer on your network? Like [http://192.168.0.236:8081](http://192.168.0.236:8081/) but with ip that fits your settings?

Yes i did. I got it working last night! I had the localhost on.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/93e76abadbacbc49cd7f5fe9f75e9237728d750c.jpeg)

Now I have two other problems:  
1- When i open the dash on my iPhone (using safari) I can't see the livestream;  
2- My config is getting almost one minute delay (with motion detection off!).  
Any thoughts?

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [16 October 2019 07:04 UTC](https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860/116 "2019-10-16T07:04:12Z")

</div>

1. Only will work if your iphone is connected to your same home wifi network
2. Possible too high framerate. Try reduce frame rate

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/6/63211dc3b60c4266a59e6dc9feb10fbe8dc95f10.png)

---

<div class="post-metadata">

**Author:** ![fs.santos](https://avatars.discourse-cdn.com/v4/letter/f/3da27b/32.png) [@fs.santos](https://discourse.nodered.org/u/fs.santos)\
**Post date:** [16 October 2019 07:58 UTC](https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860/117 "2019-10-16T07:58:56Z")

</div>

1- I have a VPN set on my rasp. I can view the dash, can't load the stream image only...... Do your flow display images on iOS?  
2- I'm gonna try it ASAP

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [16 October 2019 08:18 UTC](https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860/118 "2019-10-16T08:18:31Z")

</div>

1. Yes, works fine on my iOS devices, both with Safari & Chrome. Working fine with wifi directly to my home network or via 4G and VPN (I use OpenVPN on my iPhone)

2. Eventually, if you have an ip-camera, you will have to reduce the frame rate in the camera setup. If you have a high frame rate, it will take long time until all frames have been processed, they are all placed in a queue typ FIFO

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [16 October 2019 08:19 UTC](https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860/119 "2019-10-16T08:19:44Z")

</div>

and /or reduce the resolution - so the amount of data per picture frame is smaller

---

<div class="post-metadata">

**Author:** ![fs.santos](https://avatars.discourse-cdn.com/v4/letter/f/3da27b/32.png) [@fs.santos](https://discourse.nodered.org/u/fs.santos)\
**Post date:** [16 October 2019 08:22 UTC](https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860/120 "2019-10-16T08:22:56Z")

</div>

1- Ankward.... I'm using the same node as you are.... Read on a post that iOS safari couldn't load html pictures bigger than a certain size.... What's your cam size config in motion?  
Gonna try to solve this...

2- It worked! Thanks!

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [16 October 2019 08:44 UTC](https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860/121 "2019-10-16T08:44:51Z")

</div>

1. Just 640x480. Also tried with 1024x768 and iPhone via VPN, still works fine in Safari & Chrome. On my iPhone, iPad, MacBook, no problems

When you configure camera resolution:

1. What you configure in camera will be what the camera send
2. What you configure in dashboard template will decide the scaling

So for instance, you configure the camera to 1024x768 but in dashboard template you have width: 405px;  
Then the 1024x768 frame size will be scaled to fit into the element with the width of 405 pixels

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [16 October 2019 08:49 UTC](https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860/122 "2019-10-16T08:49:28Z")

</div>

yes - but it will have to send the 1024x768 = 786k of data vs scaling before you send eg (say 405 wide = approx 123k of data = 6x less to send...

[Previous page](https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860.md?page=5)

[Next page](https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860.md?page=7)
