How to combine Circular Output and FfmpegOutput? #605
Replies: 1 comment
-
I think there are a variety of problems here. Firstly, the CircularOutput class inherits from FileOutput, and it might do better just to "contain" one. But more fundamentally, there are some difficulties with timestamps. We use FFmpeg as a completely separate process. As far as I know, there is no way we can give it timestamps for the frames even though we have them, so FFmpeg resamples the times as it gets them, and this probably won't play nicely with a circular buffer. The solution might be to use a lower level interface right into the libav libraries, I believe there are some, but that's not trivial. Alternatively perhaps we could mux the frames into "something simple" that allows us to include timestamps, but that doesn't feel terribly nice. Pragmatically speaking, I think your best bet is to save h.264 streams and re-mux them afterwards. Sorry not to have a better answer! |
Beta Was this translation helpful? Give feedback.
-
I am using the capture_circular example as the basis for motion detection with the NoIR camera.
However the Circular Output only produces h264 files.
I would like to get mp4 files as output when motion occurs.
As far as I can tell the circular buffer is more or less a delay line for the encoder output.
So in principle it should be possible to daisy-chain a FfmpegOutput.
Any hints how to achieve this are welcome.
Beta Was this translation helpful? Give feedback.
All reactions