Show ip camera in dashboard and store prefixed buffer video

@Lupin_III
Always nice with video users joining! You should check out the very interesting thread where we have discussed a lot about video. The most impressive in there is what @kevinGodell has achieved and kindly shared, fantastic nodes creating mp4 out of streams. Here is the thread [beta testing] nodes for live streaming mp4

It's a very long thread but so useful, informative and valuable. To make a long story shorter, the outcome is two sets of nodes, node-red-contrib-mp4frag and node-red-contrib-ui-mp4frag

With those nodes you can very easily build efficient flows converting/presenting mp4 streams in the dashboard. For ip cameras you could use simple flows like this:

So far this works very well for live streaming & presentation. The exec node is starting ffmpeg that is used to create the stream and if needed, convert it to mp4. It works with many video formats. Using the mp4 format has of course well known advantages and disadvantages I'm not going to dicuss.

What is not supported by those nodes is recording. I believe it would maybe be here, eventually with a new node, a recording node could find a warm home. Imagine a rec_mp4frag node that could capture the mp4 video in a preset sized buffer and then on a command, saving to file on a mounted SSD drive, starting with the pre-captured video and then add real time video until stopped

As mentioned, I'm personally using a software called Motion that has this feature built in but it would of course be very nice to have a pure NR solution. The question is how much CPU load this would cause. Could the use of the GPU help? Obviously the footprint in the memory will be larger, related to the configured buffer size. Also when the "start recording" begins, it might cause a heavy load joining the pre-recording with the live stream into a smooth video recording

Anyway very interesting topic, I hope @kevinGodell will join the discussion because he is our real video expert and I'm sure he can sort out what eventually is possible or not

1 Like