# Live mp4 streaming node

**URL:** <https://discourse.nodered.org/t/live-mp4-streaming-node/40907>\
**Category:** General\
**Created:** [13 February 2021 00:07 UTC](https://discourse.nodered.org/t/live-mp4-streaming-node/40907 "2021-02-13T00:07:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![alechenne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alechenne/32/37099_2.png) [@alechenne](https://discourse.nodered.org/u/alechenne)\
**Post date:** [13 February 2021 00:07 UTC](https://discourse.nodered.org/t/live-mp4-streaming-node/40907/1 "2021-02-13T00:07:33Z")

</div>

Dear All,

I'm starting experimenting red-node. It runs on a raspberry. I'm looking for a node which can play a live streaming mp4 of my Netatmo camera. URL is something [https://xxxx](https://xxxx) that ends with /live/index\_local.m3u8. Format is CODECS="avc1.420028,mp4a.40.2".

I saw @BartButenaers created something that seems interesting but unfortunately when I installed through npm install bartbutenaers/node-red-contrib-ui-mp4-player, I cannot find the node in the search modules part of the editor.

Any help or alternative will be warm welcomed.

Thanks in advance and kind regards.

---

<div class="post-metadata">

**Author:** ![leftymuller](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/leftymuller/32/102326_2.png) [@leftymuller](https://discourse.nodered.org/u/leftymuller)\
**Post date:** [13 February 2021 08:00 UTC](https://discourse.nodered.org/t/live-mp4-streaming-node/40907/2 "2021-02-13T08:00:33Z")

</div>

Hi! Welcome to the community

could you tell us what your trying to achieve? are you trying to put that camera feed on the dashboard?

---

<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:** [13 February 2021 08:35 UTC](https://discourse.nodered.org/t/live-mp4-streaming-node/40907/3 "2021-02-13T08:35:50Z")

</div>

Hi Alex,  
Due to a lack of free time, I have stopped working on that node. You should definately have a look at the nodes from @kevinGodell, like e.g. in [this](https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743) discussion!!  
Bart

---

<div class="post-metadata">

**Author:** ![JGKK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jgkk/32/18515_2.png) [@JGKK](https://discourse.nodered.org/u/JGKK)\
**Post date:** [13 February 2021 09:16 UTC](https://discourse.nodered.org/t/live-mp4-streaming-node/40907/4 "2021-02-13T09:16:12Z")

</div>

> [@alechenne](#):
>
> I cannot find the node in the search modules part of the editor.

Just to keep in mind when installing nodes with npm directly you have to do this from the node-red folder for it to appear in the palette. (`~/.node-red` if you installed with the standard script)

---

<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:** [13 February 2021 09:48 UTC](https://discourse.nodered.org/t/live-mp4-streaming-node/40907/5 "2021-02-13T09:48:47Z")

</div>

> [@alechenne](#):
>
> I cannot find the node in the search modules part of the editor.

For completeness: that is an experimental node, which has never been published on npm. That is the reason why you can't find it in your Node-RED palette.

---

<div class="post-metadata">

**Author:** ![alechenne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alechenne/32/37099_2.png) [@alechenne](https://discourse.nodered.org/u/alechenne)\
**Post date:** [13 February 2021 11:34 UTC](https://discourse.nodered.org/t/live-mp4-streaming-node/40907/6 "2021-02-13T11:34:23Z")

</div>

> [@alechenne](#):
>
> npm install bartbutenaers/node-red-contrib-ui-mp4-player

Thanks Bart for your feedback.

---

<div class="post-metadata">

**Author:** ![alechenne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alechenne/32/37099_2.png) [@alechenne](https://discourse.nodered.org/u/alechenne)\
**Post date:** [13 February 2021 11:35 UTC](https://discourse.nodered.org/t/live-mp4-streaming-node/40907/7 "2021-02-13T11:35:50Z")

</div>

Thanks for the info; but despite this and a restart of the red-node server, it would'nt appear in the palette. But @BartButenaers certainly give us the reason in his comment.

---

<div class="post-metadata">

**Author:** ![alechenne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alechenne/32/37099_2.png) [@alechenne](https://discourse.nodered.org/u/alechenne)\
**Post date:** [13 February 2021 11:36 UTC](https://discourse.nodered.org/t/live-mp4-streaming-node/40907/8 "2021-02-13T11:36:28Z")

</div>

This is exactly the behaviour I would have: put a camera feed on the dashboard.

---

<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:** [13 February 2021 11:54 UTC](https://discourse.nodered.org/t/live-mp4-streaming-node/40907/9 "2021-02-13T11:54:17Z")

</div>

BTW here are the links to Kevin's [node-red-contrib-ui-mp4frag](https://github.com/kevinGodell/node-red-contrib-ui-mp4frag) and [node-red-contrib-mp4frag](https://github.com/kevinGodell/node-red-contrib-mp4frag) nodes...

---

<div class="post-metadata">

**Author:** ![leftymuller](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/leftymuller/32/102326_2.png) [@leftymuller](https://discourse.nodered.org/u/leftymuller)\
**Post date:** [13 February 2021 12:48 UTC](https://discourse.nodered.org/t/live-mp4-streaming-node/40907/10 "2021-02-13T12:48:30Z")

</div>

Ok... this is how I did it using VLC command line and a iframe node

make a shell script with this in it

```auto
#!/bin/bash
cvlc -R rtsp://admin:admin@192.168.2.205:554/Streaming/Channels/102 --sout "#transcode{vb=1000,fps=5,vcodec=MJPG,fps=5,acodec=none}:standard{access=http{mime=multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8889/videostream.cgi"

```

then make a iframe with the IP of that machine on port 8888

start it from node-red ... this is my flow

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

I have a script (checkvlc.sh) that run every minute to make sure its running

```auto
#!/bin/bash
ps ax |grep vlc |wc --lines

```

this works for me and gives me this

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/c/cc18dc5236d5f6cb41c3c8621803113bd2e86774.jpeg)

I have 2 instances running and the Pi3 seems to handle it no problems.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![alechenne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alechenne/32/37099_2.png) [@alechenne](https://discourse.nodered.org/u/alechenne)\
**Post date:** [13 February 2021 12:53 UTC](https://discourse.nodered.org/t/live-mp4-streaming-node/40907/11 "2021-02-13T12:53:00Z")

</div>

Many thanks Bart 🙏 🙏 🙏. I used ui\_mp4frag and solved the issue in 2 minutes.

---

<div class="post-metadata">

**Author:** ![alechenne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alechenne/32/37099_2.png) [@alechenne](https://discourse.nodered.org/u/alechenne)\
**Post date:** [13 February 2021 12:54 UTC](https://discourse.nodered.org/t/live-mp4-streaming-node/40907/12 "2021-02-13T12:54:07Z")

</div>

Many thanks for your clear explanation. Based on the comment of @BartButenaers , I used the ui\_mp4frag which solved problem in few seconds.

---

<div class="post-metadata">

**Author:** ![leftymuller](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/leftymuller/32/102326_2.png) [@leftymuller](https://discourse.nodered.org/u/leftymuller)\
**Post date:** [13 February 2021 12:55 UTC](https://discourse.nodered.org/t/live-mp4-streaming-node/40907/13 "2021-02-13T12:55:07Z")

</div>

No problem.. Might have to look into that myself!

---

<div class="post-metadata">

**Author:** ![alechenne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alechenne/32/37099_2.png) [@alechenne](https://discourse.nodered.org/u/alechenne)\
**Post date:** [13 February 2021 13:22 UTC](https://discourse.nodered.org/t/live-mp4-streaming-node/40907/14 "2021-02-13T13:22:46Z")

</div>

In my use case, it was very easy, just to provide the url ending with .m3u8 to the ui\_mp4frag, add a property in the settings.js and that's it.

---

<div class="post-metadata">

**Author:** ![leftymuller](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/leftymuller/32/102326_2.png) [@leftymuller](https://discourse.nodered.org/u/leftymuller)\
**Post date:** [14 February 2021 02:54 UTC](https://discourse.nodered.org/t/live-mp4-streaming-node/40907/15 "2021-02-14T02:54:48Z")

</div>

could be wrong but I dont think this wont work for an RTSP stream.

HLS streaming only?

---

<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:** [14 February 2021 06:10 UTC](https://discourse.nodered.org/t/live-mp4-streaming-node/40907/16 "2021-02-14T06:10:50Z")

</div>

It works very well with RTSP. You may test a setting like the one in the link below. For a full understanding you have to read the thread. It's long but very informative

> [@\[beta testing\] nodes for live streaming mp4](https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743/16):
>
> Try this. Amazing!! The cpu load on the RPi3 is just 2-5% full streaming, resolution is 1280x720 What I have seen earlier with other implementations is that streaming rtsp normally loads the cpu pretty heavy. What is the magic with this solution?? [{"id":"17b65c21.7ccc04","type":"inject","z":"252b9369.44a80c","name":"Start stream","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":"1","topic":"","payload":"true","payloadType":"bool","x":200,"y":2110,"wires":[…

---

<div class="post-metadata">

**Author:** ![leftymuller](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/leftymuller/32/102326_2.png) [@leftymuller](https://discourse.nodered.org/u/leftymuller)\
**Post date:** [21 February 2021 06:17 UTC](https://discourse.nodered.org/t/live-mp4-streaming-node/40907/17 "2021-02-21T06:17:04Z")

</div>

Hello!

Just got this working with mp4 RTSP but there is at least a 5-8 sec delay.

is there a place to change the buffer size?

---

<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:** [21 February 2021 06:57 UTC](https://discourse.nodered.org/t/live-mp4-streaming-node/40907/18 "2021-02-21T06:57:09Z")

</div>

What values do you get for the "durations" ?

I think the delay is discussed somewhere here in the thread. The longer durations, the longer delays. If I remember, I think it is also related to the resolution you have for the camera. I'm streaming the Norwegian camera right now and get durations around 0.5 seconds which is the actual delay  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/9/f9935a27178a4c2ffeca8edce2f18fd203b62475.png)

Anyway, open up the exec node and modify the last part of the ffmpeg command:

```auto
copy -f mp4 -movflags +frag_every_frame+empty_moov+default_base_moof -min_frag_duration 500000 pipe:1

```

See if this improves the streaming

---

<div class="post-metadata">

**Author:** ![leftymuller](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/leftymuller/32/102326_2.png) [@leftymuller](https://discourse.nodered.org/u/leftymuller)\
**Post date:** [21 February 2021 07:04 UTC](https://discourse.nodered.org/t/live-mp4-streaming-node/40907/19 "2021-02-21T07:04:14Z")

</div>

Thanks for that.

The durations im seeing are 4.8xx to 5

I substituted the ffmpeg command, but now it starts then stops?

Edit: Got it working.. now seeing

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

Thank you!

---

<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:** [21 February 2021 08:18 UTC](https://discourse.nodered.org/t/live-mp4-streaming-node/40907/20 "2021-02-21T08:18:31Z")

</div>

OK, looks better from duration point of view. The number of frames you get is most likely depending on eventual "other viewers". I have sometimes seen much higher frame rates, most likely I was alone watching 😉

Have you tried now with your own ip cameras?

[Next page](https://discourse.nodered.org/t/live-mp4-streaming-node/40907.md?page=2)
