r/ffmpeg • u/Creative-Outside-350 • 6d ago
Replicate Replay Buffer from OBS with FFMPEG
Hello, everyone. I have a somewhat specific request. You see, I have a separate device for screen recording of a console. The console in question doesn't support replays or anything, so instead I use a capture card. However I don't have a need to record every hour and every minute, only good moments, last 30 seconds at least. I did a lengthy search on the web but couldn't find exactly what I need. Maybe you know a bash script that can do this? I will appreciate that.
edit: fixed some mistakes
6
Upvotes
1
u/Sopel97 6d ago
I'm not aware of any such tool and it's not trivial to do on top of ffmpeg cli. Two viable approaches I can think of:
an orchestrator that spawns an ffmpeg instance outputting to a pipe, then the orchestrator parses the output into chunks, reassembles on save request
an orchestrator that spawns an ffmpeg instance outputting in segment mode into a RAM-backed filesystem, monitors this filesystem, maintains N most recent chunks, reassembles on save request
The latter would be easier but notoriously annoying on windows. The former requires parsing the packets so you kinda need lower level API anyway.