jvcleave / ofxOMXCamera

OpenMax accelerated control of the Raspberry Pi Camera Module under openFrameworks
22 stars 6 forks source link

video recordings are saved as streams #7

Open MartinHN opened 5 years ago

MartinHN commented 5 years ago

hi, the files generated by VideoRecorders are formated as raw H264 NAL Units, so when they will be played back, they will be detected as streams. And so when looped, ofxOMXPlayer will reload the entire file at each loop.

do you now if there is a (simple) work around?

I suppose it could lead to complex problems , but you may have an idea about that? in my case, I'd rather risk to have jittery timestamps than reloading the stream (and freezing OF at each loop points)...

if you don't, feel free to close this issue.

MartinHN commented 5 years ago

An alternative would be to trigger ffmpeg commandline conversions, but it adds up to the dependencies and complexity budgets...

jvcleave commented 5 years ago

because it is a stream I don't think there is a way to detect the length. It doesn't have to reload the entire file to start playing so reloading isn't much of an issue (unless it were leaking memory).

The old version of this addon used to have the option to use mkvmerge but that takes more time than reloading. You could add this in your app if you want to try it.

https://github.com/jvcleave/ofxRPiCameraVideoGrabber/commit/fdcb1b6a9429fc8171c0287c4d8134faadc44fa2#diff-e0dd23c0c933caa6de1358b035d95c59R261