Live mp4 streaming node

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 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.

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?

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 discussion!!
Bart

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)

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.

Thanks Bart for your feedback.

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.

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

BTW here are the links to Kevin's node-red-contrib-ui-mp4frag and node-red-contrib-mp4frag nodes...

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

make a shell script with this in it

#!/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

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

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

this works for me and gives me this

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

Hope this helps!

Many thanks Bart :pray: :pray: :pray:. I used ui_mp4frag and solved the issue in 2 minutes.

1 Like

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

1 Like

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

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.

1 Like

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

HLS streaming only?

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

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?

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

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

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

See if this improves the streaming

1 Like

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

Thank you!

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 :wink:

Have you tried now with your own ip cameras?