Pre Recodring (buffering) RSTP Stream before motion detection with for example FFMPEG


i would like to save motion trigged movies. But the main thing is that i would like to save 5 seconds before motion triggering and end it with the end of motion triggering.
How could it be realized?

Thanks a lot!

I think this relates to the lookback value in the camera component but could be wrong

See here:

Yes you are wright!
But it is not a solutuon. I have testet it too much. Problems:

  • it works when it want, when it do not want it do not work make prerecord (i mean loopback)
  • after some attepmts it gives error, smth as that stream in use, can not record more, like it did not get signal that recored is over. It is the known issurse since more than one year. As i understood the only solution is to restart HA - but it is… :disappointed_relieved:
  • you can stop recording, you can only set a duration, what is not acceptable.

More to say - NVR like motioneye, i have also testet. It gives very high CPU load, even if the cam not in use. I need only stream for lovelace and record on demand (motion)

Are you trying to view and record the streams at the same time? many cameras dont like multiple sources accessing the stream at the same time.

I have automations to record 30s of video (+ 10 sec loopback) when motion is detected on my driveway. I was having intermittent issues and traced it to viewing the camera stream in either another lovelace window that features a camera view, or accessing the stream from the manufactures app at the same time. This might be worth investigating in your case?

would also like to see a START/STOP recording option rather than a timed record. This would allow you to start recording when motion is detected and stop when ther is no more motion.

Will check this!

Because of this i would like use com command line methodes.

By the way, which camera do you use?

Maybe you know how to solve this error of record?

The record was started and not ended, sometimes file created, sometimes not.
I can only restart HA, but maybe there is better method?