# Display camera in dashboard

**URL:** <https://discourse.nodered.org/t/display-camera-in-dashboard/50747>\
**Category:** General\
**Created:** [8 September 2021 09:14 UTC](https://discourse.nodered.org/t/display-camera-in-dashboard/50747 "2021-09-08T09:14:44Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giamma](https://avatars.discourse-cdn.com/v4/letter/g/e47774/32.png) [@Giamma](https://discourse.nodered.org/u/Giamma)\
**Post date:** [8 September 2021 09:14 UTC](https://discourse.nodered.org/t/display-camera-in-dashboard/50747/1 "2021-09-08T09:14:44Z")

</div>

Hi,  
I have one Reolink RLC-510wa wifi and after reading this post ..

> [@Display camera ip in dashboard and store video in raspberry](https://discourse.nodered.org/t/display-camera-ip-in-dashboard-and-store-video-in-raspberry/6349/35):
>
> I dont have a jpeg delay because the jpegs are being encoded from an RTSP source, and thus have a constant input pushing through. From what I remember, you were trying to push in jpegs and have them output in a different size. There must be some magical ffmpeg flags that we have not yet discovered. Perhaps adding -fflags +nobuffer+flush\_packets -flags low\_delay

I download the flow of @BartButenaers  
and set this string:  
...  
ffmpeg -rtsp\_transport tcp -i "rtsp://192.168.1.16:554/user=xxxx\_password=xxxx\_channel=0\_stream=1.sdp?real\_stream" -filter:v fps=fps=5 -f image2pipe pipe:1  
...  
(user and pwd are the correct ones of course)  
but don't works.

Can you help me?

What's means rc:1 (yellow)?

 ![img01](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/5/a54b84752bfed46a5006ec150b74c4e7b7050330.png)

---

<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:** [8 September 2021 09:27 UTC](https://discourse.nodered.org/t/display-camera-in-dashboard/50747/2 "2021-09-08T09:27:40Z")

</div>

> [@Giamma](#):
>
> What's means rc:1

It means the command in the exec node has failed. Check what is on the other two outputs of the node for more information. Set the debug nodes to show Complete Message and you should find some error information.

---

<div class="post-metadata">

**Author:** ![kevinGodell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kevingodell/32/27040_2.png) [@kevinGodell](https://discourse.nodered.org/u/kevinGodell)\
**Post date:** [8 September 2021 10:38 UTC](https://discourse.nodered.org/t/display-camera-in-dashboard/50747/4 "2021-09-08T10:38:20Z")

</div>

When ffmpeg is piping out jpeg buffer, it will be broken into chunks if it is bigger than your system's piping chunk size limitation. Either reduce the size output of the jpeg so that it is a small enough to fit in a single chunk or catch all of the buffer chunks and reassemble them into a complete jpeg after ffmpeg spits them out.

scaling jpeg size:  
[https://trac.ffmpeg.org/wiki/Scaling](https://trac.ffmpeg.org/wiki/Scaling)

reassemble the chunks:  
The option for catch the chunks and reassembling them can be done by installing **node-red-contrib-pipe2jpeg** and placing that node in between the exec node and image preview node.

---

<div class="post-metadata">

**Author:** ![Giamma](https://avatars.discourse-cdn.com/v4/letter/g/e47774/32.png) [@Giamma](https://discourse.nodered.org/u/Giamma)\
**Post date:** [8 September 2021 10:42 UTC](https://discourse.nodered.org/t/display-camera-in-dashboard/50747/5 "2021-09-08T10:42:00Z")

</div>

Well, it has improved but I have not the image, but speedy flash ....

 ![img04](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/f/cf58e26d87e4632200fbca51208ecf17573a1c97.png)

I have installed node-red-contrib-pipe2jpeg ....

and I have change the command insert this string:

`ffmpeg -rtsp_transport tcp -f rtsp -i rtsp://admin:xxxxx@192.168.1.16:554/h264Preview_01_main -f image2pipe pipe:1`

because this command:

`ffmpeg -rtsp_transport tcp -i "rtsp://192.168.1.16:554/user=admin_password=xxxxxx_channel=0_stream=1.sdp?real_stream" -filter:v fps=fps=5 -f image2pipe pipe:1`

or this command:

`ffmpeg -rtsp_transport tcp -i "rtsp://192.168.1.16:554/user=admin_password=xxxxx_channel=0_stream=0.sdp?real_stream" -filter:v fps=fps=5 -f image2pipe pipe:1 pipe2jpeg`

don't works and the error is:

`Server returned 401 Unauthorized (authorization failed)`

but I don't understand why ....

(my platform is pc i3 - kubuntu 20.04)

---

<div class="post-metadata">

**Author:** ![Giamma](https://avatars.discourse-cdn.com/v4/letter/g/e47774/32.png) [@Giamma](https://discourse.nodered.org/u/Giamma)\
**Post date:** [11 September 2021 04:34 UTC](https://discourse.nodered.org/t/display-camera-in-dashboard/50747/6 "2021-09-11T04:34:25Z")

</div>

Any ideas ?

---

<div class="post-metadata">

**Author:** ![Gunner](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gunner/32/43582_2.png) [@Gunner](https://discourse.nodered.org/u/Gunner)\
**Post date:** [11 September 2021 05:09 UTC](https://discourse.nodered.org/t/display-camera-in-dashboard/50747/7 "2021-09-11T05:09:38Z")

</div>

> [@Giamma](#):
>
> `Server returned 401 Unauthorized (authorization failed)`
> 
> but I don't understand why ....

It means what it says... The camera doesn't like either the credentials or the method of sending them.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [11 September 2021 10:58 UTC](https://discourse.nodered.org/t/display-camera-in-dashboard/50747/8 "2021-09-11T10:58:19Z")

</div>

does your rtsp statement

```auto
rtsp://192.168.1.16:554/user=admin_password=xxxxx_channel=0_stream=0.sdp?real_stream 

```

work if entered into a browser address bar?

Doing a google search of 'rtsp user password' gets results that suggest the format should be:

```auto
rtsp://[username:password@]ip_address[:rtsp_port]/server_URL[[?param1=val1[?param2=val2]…[?paramN=valN]]

```

you might want to try it that way and lookup the format the RTSP statement should be.

---

<div class="post-metadata">

**Author:** ![Giamma](https://avatars.discourse-cdn.com/v4/letter/g/e47774/32.png) [@Giamma](https://discourse.nodered.org/u/Giamma)\
**Post date:** [11 September 2021 11:41 UTC](https://discourse.nodered.org/t/display-camera-in-dashboard/50747/9 "2021-09-11T11:41:04Z")

</div>

@zenofmud  
Ok, this is the summary ......

`rtsp://admin:xxxxxx@192.168.1.16:554/h264Preview_01_main`  
This string work fine in VLC (I see the cam's video without problems); to say that's user and password are correct; probably is from this string that I can start, but I don't know how to set correctly for node red ....

I tried to insert this string:  
`ffmpeg -rtsp_transport tcp -f rtsp -i rtsp://admin:xxxxx@192.168.1.16:554/h264Preview_01_main -f image2pipe pipe:1`

and I have some speedy flash of the image from the cam (problem of buffer?)

`rtsp://192.168.1.16:554/user=admin_password=xxxxx_channel=0_stream=0.sdp?real_stream`  
If I use this string in a browser address bar, I have a request to enter user and password again but nothing user and pass are accepted.

The string you have found on google is that I use in vlc ......

---

<div class="post-metadata">

**Author:** ![Gunner](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gunner/32/43582_2.png) [@Gunner](https://discourse.nodered.org/u/Gunner)\
**Post date:** [11 September 2021 19:50 UTC](https://discourse.nodered.org/t/display-camera-in-dashboard/50747/10 "2021-09-11T19:50:29Z")

</div>

RTSP is generally NOT supported in browsers... and the dashboard is somewhat like a browser in terms of HTTP/CSS support.

VLC does the conversion, so just because it works there means nothing for running it elsewhere... but it is useful for confirming the URL command works and the camera actually streams.

It seems that for Node-Red, the RTSP streams would need to be converted to something else, which FFmpeg does (FFmpeg must be installed on the rpi, or whatever you are using to run NR). But whatever command you are using to do the conversion may be the issue.

Depending on the cameras I used, one of these worked for me... You will have to Google for and test various ones for your camera.

`ffmpeg -y -i "http://<USER>:<PASS>@<IP>:<PORT>/streaming/channels/102/picture" -vframes 1 -qscale:v 2`

`ffmpeg -y -i "rtsp://<USER>:<PASS>@<IP>:<PORT>/cam/realmonitor?channel=1&subtype=0" -vframes 1 -qscale:v 2`

I processed it as such: Set the path/name for a \*.jpg, run the FFmpeg command, retrieve the \*.jpg and display it, rinse repeat. This basically gave a viewable slideshow.

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

```auto
[{"id":"b0c191b669811a54","type":"file in","z":"a0650d3b89aad075","name":"Grab image","filename":"/home/pi/node-red-static/test_image.jpg","format":"","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":610,"y":720,"wires":[["23f6fbeb52f7d6b1"]]},{"id":"e4e2f4bf13d318bd","type":"exec","z":"a0650d3b89aad075","command":"ffmpeg -y -i \"http://<USER>:<PASS>@<IP>:<PORT>/<PATH_AND_COMMAND>\" -vframes 1 -qscale:v 2","addpay":"payload","append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"Grab a frame -> jpg","x":390,"y":740,"wires":[["b0c191b669811a54"],[],[]]},{"id":"fe1ca58fbde0196b","type":"change","z":"a0650d3b89aad075","name":"Set filename","rules":[{"t":"set","p":"payload","pt":"msg","to":"/home/pi/node-red-static/test_image.jpg","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":190,"y":760,"wires":[["e4e2f4bf13d318bd"]]},{"id":"23f6fbeb52f7d6b1","type":"base64","z":"a0650d3b89aad075","name":"Encode","x":600,"y":760,"wires":[["58c91758b35b0a9e"]]},{"id":"58c91758b35b0a9e","type":"image","z":"a0650d3b89aad075","name":"","width":160,"data":"payload","dataType":"msg","thumbnail":false,"active":true,"pass":false,"outputs":0,"x":940,"y":740,"wires":[]},{"id":"576c948a4e72b40e","type":"inject","z":"a0650d3b89aad075","name":"Trigger","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":170,"y":720,"wires":[["fe1ca58fbde0196b"]]}]

```

**HOWEVER!!...**

I eventually found it better to find a MJPEG URL for my camera (most seem to still support one) and use @BartButenaers's `node-red-contrib-multipart-stream-decoder`

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/9/e9baff23ede26480f15d52a04bcb99db2eb7a747.png)

```auto
[{"id":"0795688882464f6a","type":"image","z":"9f08acfb5108874a","name":"","width":160,"data":"payload","dataType":"msg","thumbnail":false,"active":true,"pass":false,"outputs":0,"x":1020,"y":840,"wires":[]},{"id":"fb1c03144d31d3f1","type":"multipart-decoder","z":"9f08acfb5108874a","name":"","ret":"bin","url":"","tls":"","delay":0,"maximum":1000000,"blockSize":1,"x":470,"y":880,"wires":[["7f7c82f4f6e58636"]]},{"id":"7f7c82f4f6e58636","type":"base64","z":"9f08acfb5108874a","name":"Encode","action":"","property":"payload","x":660,"y":880,"wires":[["0795688882464f6a","1c68d7aeb974ad21"]]},{"id":"cdb868c3be8533ea","type":"inject","z":"9f08acfb5108874a","name":"Start","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":170,"y":820,"wires":[["b3fa45befadf1321"]]},{"id":"b3fa45befadf1321","type":"change","z":"9f08acfb5108874a","name":"MJPEG URL","rules":[{"t":"set","p":"url","pt":"msg","to":"http://<USER>:<PASS>@<IP>:<PORT>/<PATH_AND_COMMAND>","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":860,"wires":[["fb1c03144d31d3f1"]]},{"id":"64181c078d3e0296","type":"inject","z":"9f08acfb5108874a","name":"Stop stream","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"true","payloadType":"bool","x":190,"y":940,"wires":[["209afe35dd346ef3"]]},{"id":"209afe35dd346ef3","type":"change","z":"9f08acfb5108874a","name":"","rules":[{"t":"set","p":"stop","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":900,"wires":[["fb1c03144d31d3f1"]]},{"id":"1c68d7aeb974ad21","type":"ui_template","z":"9f08acfb5108874a","group":"619cc9357a067deb","name":"Dashboard View","order":5,"width":8,"height":5,"format":"<style>\n img {\n border: 10px solid #999;\n border-radius: 8px;\n padding: 2px;\n width: 300px;\n }\n</style>\n\n<center>\n <table>\n <tr>\n <!-- Row 1 -->\n <td style=\"text-align: center\"><img src=\"data:image/jpg;base64,{{msg.payload}}\" /></td>\n </tr>\n </table>\n</center>","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","x":840,"y":900,"wires":[[]]},{"id":"619cc9357a067deb","type":"ui_group","name":"Multicams","tab":"73890071.f55b","order":6,"disp":true,"width":24,"collapse":false},{"id":"73890071.f55b","type":"ui_tab","name":"ESP32CAM & IP Cams","icon":"linked_camera","order":10,"disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![Giamma](https://avatars.discourse-cdn.com/v4/letter/g/e47774/32.png) [@Giamma](https://discourse.nodered.org/u/Giamma)\
**Post date:** [12 September 2021 04:11 UTC](https://discourse.nodered.org/t/display-camera-in-dashboard/50747/11 "2021-09-12T04:11:41Z")

</div>

Thank you ...

In  
\<PATH\_AND\_COMMAND\>

What should I put ?

---

<div class="post-metadata">

**Author:** ![Gunner](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gunner/32/43582_2.png) [@Gunner](https://discourse.nodered.org/u/Gunner)\
**Post date:** [12 September 2021 05:11 UTC](https://discourse.nodered.org/t/display-camera-in-dashboard/50747/12 "2021-09-12T05:11:50Z")

</div>

> [@Giamma](#):
>
> What should I put ?

That's the part you need to research/test based on your camera make and model. And some of them may want the user and password in a different position.

> **[Google Search](https://www.google.com/search?q=Reolink%2BRLC-510wa%2BStreaming%2BURL)**

> **[Google Search](https://www.google.com/search?q=Reolink%2BRLC-510wa%2Bmjpeg%2BURL)**

---

<div class="post-metadata">

**Author:** ![Giamma](https://avatars.discourse-cdn.com/v4/letter/g/e47774/32.png) [@Giamma](https://discourse.nodered.org/u/Giamma)\
**Post date:** [12 September 2021 05:33 UTC](https://discourse.nodered.org/t/display-camera-in-dashboard/50747/13 "2021-09-12T05:33:51Z")

</div>

Ok, thank you again ....

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [11 November 2021 05:34 UTC](https://discourse.nodered.org/t/display-camera-in-dashboard/50747/14 "2021-11-11T05:34:26Z")

</div>

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