Display camera ip in dashboard and store video in raspberry

Morning Colin (@Colin),

Indeed I should have explained that. The question in this discussion was to save video footage from a camera. That is perhaps very easy with external tools (like Motion, ...), but you know me: I want to integrate this entirely inside Node-RED, which is possible by using FFmpeg.

So I did an experiment:

  1. Getting images from a camera (using an mpjeg stream or an rtsp stream): both work fine.
  2. Inject those images into a daemon node, and let FFmpeg create an mp4 file from those images.

However the mp4 file is only created when I end the stdin stream. This is not what I want since all images are being queued in memory, which might blow up my system. And I want FFmpeg to keep running. First I thought that FFmpeg was queueing the images, because mp4 does a compression between multiple images (and he perhaps does need N images before he could start creating an mp4 file). But afterwards I thought: perhaps FFmpeg doesn't start compressing until ALL (whathever that means) images have arrived.

But then I realised that even a simple use case doesn't work: if I try to resize a single image, I only get a resized image as output when I end the stdin stream. And that is not normal, so I'm doing something wrong!

Have been experimenting and guessing for 3 evenings, and now I have enough of it. I have build a debug version of FFmpeg and attached a Visual Studio Code debbuger to it. Hopefully I can now debug the C code what is going wrong, if I can find some time this weekend ...

Will keep you guys informed.
Bart