# 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:** 1
**Showing post:** 13

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [19 December 2018 00:18 UTC](https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860/13 "2018-12-19T00:18:34Z")

</div>

Hello Mat,

Instead of writing yet-another-ffmpeg-node, I have compared the existing Node-RED contributions:

1. [node-red-ffmpeg](https://github.com/Mnark/Node-RED/tree/master/nodes/ffmpeg) has some disadvantages:

2. [node-red-contrib-dynamorse-ffmpeg](https://github.com/Streampunk/node-red-contrib-dynamorse-ffmpeg/tree/master/nodes) are rather specific nodes (e.g. AACencoder …), which I 'think' are a bit too specific for our purpose.

3. [node-red-contrib-princip-ffmpeg](https://github.com/ShamatienkoYaroslav/node-red-contrib-princip-ffmpeg) is experimental.

4. [node-red-contrib-media-utils](https://github.com/ibm-early-programs/node-red-contrib-media-utils/blob/master/ffmpeg-conversion) contains a.o. ffmpeg nodes. The disadvantages:

5. [node-red-contrib-viseo-ffmpeg](https://github.com/NGRP/node-red-contrib-viseo/tree/master/node-red-contrib-ffmpeg) _ **seem to be the right choice for our purpose** _, since it has a lot of advantages:

Another disadvantage (in all 5 cases) is that **ffmpeg** needs to be installed manually, which is a rather slow process. I found that [ffmpeg-binaries](https://www.npmjs.com/package/ffmpeg-binaries) could be used to install pre-build binaries of ffmpeg on a series of known platforms. However it failed on my Raspberry Pi 3, which I 'think' might be related to this [issue](https://github.com/Hackzzila/node-ffmpeg-binaries/issues/16). Summarized _ **currently you will have to install ffmpeg manually** _...

Here is my test flow:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/82855776f2ab123b00f81dc3a52fe366280200d2.png)

```auto
[{"id":"86ab3e95.61eb5","type":"ffmpeg-command","z":"18e47039.88483","name":"RTSP via FFMPEG","output":"payload","outputType":"msg","cmd":"-i \"rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov\" -f image2pipe -hls_time 3 -hls_wrap 10 pipe:1","cmdType":"str","spawn":"true","x":1390,"y":200,"wires":[["377fe881.b68d18"]]},{"id":"f89dff57.9f288","type":"inject","z":"18e47039.88483","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1200,"y":200,"wires":[["86ab3e95.61eb5"]]},{"id":"377fe881.b68d18","type":"function","z":"18e47039.88483","name":"Move output","func":"if (msg.payload.stdout) {\n msg.payload = msg.payload.stdout;\n return msg;\n}\n","outputs":1,"noerr":0,"x":1590,"y":200,"wires":[["5186e7cf.8be3e8"]]},{"id":"5186e7cf.8be3e8","type":"image","z":"18e47039.88483","name":"","width":200,"x":1771,"y":200,"wires":[]}]

```

The core of the solution is the list of arguments that I pass to the ffmpeg executable:

```auto
-i "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov" -f image2pipe -hls_time 3 -hls_wrap 10 pipe:1

```

Some explanation of that argument list:

- The input **'-i'** will be the rtsp link
- Since we have no output file, ffmpeg cannot 'guess' the output format from the file extension (e.g. jpeg). Therefore we will have to specify that the format **'-f'** will be an image to a pipe (image2pipe).
- Then there are some parameters about the rtsp stream (hls\_time, hls\_wrap).
- At the end we will have specify where the output (i.e. the images) will need to go to. In this case the output will need to go to the first pipe (pipe:1), which means stdout.

The argument list is very complex to create, but it is very powerful. We could create a dedicated **node-red-contrib-rtsp** node, that hides this complex line to the user. However there are an enourmous amount of different argument combinations possible (to do all kind of great audio/video conversions), so - in my humble opinion - _ **it becomes unmaintainable to create a dedicated node for every purpose** _. Therefore I think such a generic reusable ffmpeg node is a better solution.

Although it should be nice if we had some kind of central place where people could share there argument lists for the ffmpeg node? Don't know if this forum is the best place ??

Have fun with it!!  
Bart

---

_[View the full topic](https://discourse.nodered.org/t/how-to-display-cctv-camera-in-dashboard-rtsp/5860)._
