So I have found out how to cut a video at a specific time frame by using the following command
ffmpeg -i input.wmv -ss 00:00:30.0 -c copy -t 00:00:10.0 output.wmv ffmpeg -i input.wmv -ss 30 -c copy -t 10 output.wmv
So this works but it works on a video file output.wmv, How could I do this in real time? Basically I want a camera to be running and recording 24/7 and when I click a button it will save the last 30 seconds. So what that means is anything older then 30 seconds I no longer need. So what I want to do is essentially cut off any frames that are older then 30 seconds, from an input stream (webcam) so that I do not fill up the HDD in one day.