# \[beta testing\] nodes for live streaming mp4

**URL:** <https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743>\
**Category:** Share Your Nodes\
**Created:** [4 October 2020 23:35 UTC](https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743 "2020-10-04T23:35:12Z")\
**Posts on this page:** 20\
**Page:** 13

<div class="post-metadata">

**Author:** ![afiq93](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@afiq93](https://discourse.nodered.org/u/afiq93)\
**Post date:** [24 February 2021 07:23 UTC](https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743/242 "2021-02-24T07:23:59Z")

</div>

Hi. Im using exec node for my rtsp url which is ffmpeg -loglevel quiet -rtsp\_transport tcp -i rtsp://xxxx@192.168.1.xxx:554//h264Preview\_01\_main -an -c:v copy -f mp4 -movflags +frag\_keyframe+empty\_moov+default\_base\_moof pipe:1. and connect the node to mp4frag and ui\_mp4frag nodes by Kevin Godell. After deploy i only see video playback ready sign at dashboard. How to solve this?

---

<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:** [24 February 2021 08:06 UTC](https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743/243 "2021-02-24T08:06:54Z")

</div>

Your rtsp url. Does it work in VLC?. I do not have rtsp cameras myself but the link below normally works (when the camera is available). Try your rtsp url first in VLC, if it doesn't work there, no idea to try further until fixed. Also check how you have configured the ui\_mp4frag node

`ffmpeg -loglevel quiet -rtsp_transport tcp -i rtsp://freja.hiof.no:1935/rtplive/_definst_/hessdalen03.stream -an -c:v copy -f mp4 -movflags +frag_every_frame+empty_moov+default_base_moof -min_frag_duration 500000 pipe:1`

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

---

<div class="post-metadata">

**Author:** ![afiq93](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@afiq93](https://discourse.nodered.org/u/afiq93)\
**Post date:** [24 February 2021 08:15 UTC](https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743/244 "2021-02-24T08:15:23Z")

</div>

i already fix it. i move the mp4 to the top of the order. and it display on dashboard. just sometime the video stream dont have a good quality

---

<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:** [24 February 2021 08:26 UTC](https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743/245 "2021-02-24T08:26:04Z")

</div>

mp4 is mp4  
Quality is best when there is less movement in view. Principle for mp4 is to transfer not complete images but the difference from frame to frame. Check now what durations you get. Eventually reduce duration and resolution in camera setting. Try [socket.io](http://socket.io) and see if it is better

---

<div class="post-metadata">

**Author:** ![afiq93](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@afiq93](https://discourse.nodered.org/u/afiq93)\
**Post date:** [24 February 2021 08:28 UTC](https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743/246 "2021-02-24T08:28:37Z")

</div>

i see. thank you for the info. where to check the duration?

---

<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:** [24 February 2021 08:32 UTC](https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743/247 "2021-02-24T08:32:36Z")

</div>

You see it at the mp4frag nodes when the stream is running. How to change in the camera setting is camera device specific, if possible. The ultimate goal is to have short durations to reduce delay in view related to the actual real world

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

---

<div class="post-metadata">

**Author:** ![afiq93](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@afiq93](https://discourse.nodered.org/u/afiq93)\
**Post date:** [24 February 2021 09:03 UTC](https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743/248 "2021-02-24T09:03:39Z")

</div>

okay thank you very much

---

<div class="post-metadata">

**Author:** ![SuperNinja](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/superninja/32/5761_2.png) [@SuperNinja](https://discourse.nodered.org/u/SuperNinja)\
**Post date:** [26 February 2021 08:34 UTC](https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743/249 "2021-02-26T08:34:45Z")

</div>

Hi @kevinGodell , do you think you will simplify the installation of your Nodes. Going through the Palette would be so Noob friendly.  
And also to avoid using the Exec node would be great. 🙏

---

<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:** [26 February 2021 12:58 UTC](https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743/250 "2021-02-26T12:58:55Z")

</div>

> [@SuperNinja](#):
>
> do you think you will simplify the installation of your Nodes

You read my mind. I was thinking the same thing when the latest user was trying to install the nodes.

> [@SuperNinja](#):
>
> And also to avoid using the Exec node would be great.

Yes, I also need to make an ffmpeg node also that can monitor its progress and handle more output pipes than stdout/stderr.

Unfortunately, all of my free time has been tied up with an authentication node that I had to rebuilt from scratch 3 times now because it was never satisfactory. I think I am finally on the right path with it and I am trying to clean it up.

---

<div class="post-metadata">

**Author:** ![SuperNinja](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/superninja/32/5761_2.png) [@SuperNinja](https://discourse.nodered.org/u/SuperNinja)\
**Post date:** [27 February 2021 21:32 UTC](https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743/251 "2021-02-27T21:32:24Z")

</div>

happy to have read your mind. This is good news for all of us. all we have to do is wait 😃

---

<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:** [2 March 2021 18:45 UTC](https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743/252 "2021-03-02T18:45:10Z")

</div>

I just remembered why I haven't gotten around to publishing the nodes, other than my laziness. I am currently waiting for node-red-dashboard to upgrade to socket io v3. It may be happening within a month or 2 based on this comment from @dceejay[Socket.io, migrating from 2.x to 3.0 - #11 by dceejay](https://discourse.nodered.org/t/socket-io-migrating-from-2-x-to-3-0/36675/11).

At the very least, I took some time to clean up and publish mp4frag@0.3.0, which is used by node-red-contrib-mp4frag to parse the data spewed out of ffmpeg.

---

<div class="post-metadata">

**Author:** ![Andrefs](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@Andrefs](https://discourse.nodered.org/u/Andrefs)\
**Post date:** [7 March 2021 12:09 UTC](https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743/253 "2021-03-07T12:09:28Z")

</div>

Hello everyone,

In this moment i can do a mp4 file with good quality and a live stream on dashboard. However, live stream flashes a lot.  
I already tried to install Odells nodes but without sucess.

In this moment i have this:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/5/4533b95040a201d78f6e14a2f2d8fc4a4e7a70f3.png)

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

Someone can give some help?  
The camera is a reolink rlc 410

---

<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:** [7 March 2021 13:50 UTC](https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743/254 "2021-03-07T13:50:00Z")

</div>

There are a couple things wrong here, but they can easily be fixed.

You are trying to stream jpegs, not mp4, for now. We have to fix the ffmpeg command to reflect that. Remove the hls\_time and hls\_wrap flags. Realistically, you should rate limit the jpeg output, otherwise you might run a high cpu load decoding all of the mp4 frames and encoding them to individual jpegs. To add a rate limit, you can pass `-vf fps=fps=2` right in front of pipe:1. This would reduce the jpegs to 2 frames per second. If your cpu load is still too high, there are other things we can try.

The other issue is that the jpeg that is coming out of the exec node has to be buffered until it is a complete file. Based on our previous conversation about it flashing, you are probably receiving partial jpegs. Install my node, `node-red-contrib-pipe2jpeg` attach it to the first output of exec node, and then attach the other nodes to its output.

Once we get your jpeg issue fixed, we can look into mp4 streaming as an addition or alternative to the jpegs.

---

<div class="post-metadata">

**Author:** ![Andrefs](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@Andrefs](https://discourse.nodered.org/u/Andrefs)\
**Post date:** [7 March 2021 17:57 UTC](https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743/255 "2021-03-07T17:57:38Z")

</div>

Now i have this:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/9/59287024b5aa9907dcacba79edc16ddfa459f1b9.png)  
The image is not very good yet  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/7/47261a42c11fabc441e9c7ff4f6f16fc44b690c5.jpeg)

And the command in this moment is:  
ffmpeg -f rtsp -i "rtsp://andre:913558828Aa@192.168.50.240:554/h264Preview\_01\_sub" -f image2pipe -hls\_time 3 -hls\_wrap 10 -q 2 pipe:1 -vf fps=fps=2

However, with that command to decrease cpu load, i have this:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/0/00796f1f27458e1b4a187d26e30ed5eaee869655.png)

---

<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:** [7 March 2021 18:15 UTC](https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743/256 "2021-03-07T18:15:27Z")

</div>

Can you explain what is "no good" with image??

Also, please read carefully what is recommended:

> [@kevinGodell](#):
>
> you can pass `-vf fps=fps=2` right in front of pipe:1

This is not what you did but maybe it works anyway??

---

<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:** [7 March 2021 18:19 UTC](https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743/257 "2021-03-07T18:19:36Z")

</div>

> [@Andrefs](#):
>
> ffmpeg -f rtsp -i "rtsp://andre:913558828Aa@192.168.50.240:554/h264Preview\_01\_sub" -f image2pipe -hls\_time 3 -hls\_wrap 10 -q 2 pipe:1 -vf fps=fps=2

should be  
`ffmpeg -f rtsp -i rtsp://andre:913558828Aa@192.168.50.240:554/h264Preview_01_sub -f image2pipe -q 2 -vf fps=fps=2 pipe:1`

and image preview node should also be plugged into pipe2jpeg.

---

<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:** [7 March 2021 18:20 UTC](https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743/258 "2021-03-07T18:20:25Z")

</div>

> [@Andrefs](#):
>
> I already tried to install Odells nodes but without sucess

And why not?? Streaming mp4 correctly will not load the cpu that much (33% is really too much for 2 fps).

This whole thread is about live streaming mp4 so please try again to install the nodes and explain why it doesn't work

---

<div class="post-metadata">

**Author:** ![Andrefs](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@Andrefs](https://discourse.nodered.org/u/Andrefs)\
**Post date:** [8 March 2021 07:18 UTC](https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743/259 "2021-03-08T07:18:13Z")

</div>

Good morning,

I changed the command and now the problem of CPU load is solved, i think.

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

Now the problem is the quality of image. If i have ".....01\_sub..." the qualityis a little bad

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

if i change to ".....01\_main.." the quality is much better

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

However, in both cases, the image transmission is very slow and have a lot of breaks.

About instalation, i can' install because i have the following messages

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

I'm not a expert in node-red yet, so i'm sorry if i'm asking stupid questions 😕

---

<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 March 2021 12:01 UTC](https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743/260 "2021-03-08T12:01:58Z")

</div>

My setup seems much different from yours. I have to run the npm install command from within the `.node-red` directory. Like yourself, I am also not a node-red expert. Maybe you don't have the node-red-dashboard installed?

---

<div class="post-metadata">

**Author:** ![SuperNinja](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/superninja/32/5761_2.png) [@SuperNinja](https://discourse.nodered.org/u/SuperNinja)\
**Post date:** [8 March 2021 13:12 UTC](https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743/261 "2021-03-08T13:12:14Z")

</div>

@Andrefs

> [@Andrefs](#):
>
> the image transmission is very slow and have a lot of breaks.

the camera is connected in wifi? in ethernet? the router is far? you go through a switch etc ...

> [@kevinGodell](#):
>
> I have to run the npm install command from within the `.node-red` directory.

yes : you have to enter this 3 lines in the Terminal :

```auto
cd .node-red
npm install kevinGodell/node-red-contrib-mp4frag
npm install kevinGodell/node-red-contrib-ui-mp4frag

```

Did you test your RTSP adress : `rtsp://andre:913558828Aa@192.168.50.240:554/h264Preview_01_main`  
in a playing media software like **VLC** , to see if there is breaks to ?

[Previous page](https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743.md?page=12)

[Next page](https://discourse.nodered.org/t/beta-testing-nodes-for-live-streaming-mp4/33743.md?page=14)
