I'm looking to record a MJPEG stream on motion detected. But my motion detection notification is seconds later than the motion occurs.
To counter this, I want to record all the time, but only keep the last 2 minutes of footage.
Right now I'm downloading infinitely with cURL, but I'm stuck on how to have it trim the front of the file correctly to be 2 minutes.