The eternal question about video playback performance but this time with some background and some constraints. I’m interested mainly in high performance image sequence save/load from/to disc.
By high performance I mean:
Capable of storing high resolution frames e.g.4K or
high fps e.g.+1000 fps at smaller resolutions.
Mostly interested on saving at lossless compression, png, tiff, LZ4, binary.
Loading in Jpeg 2000 would be good. I’m considering a worker thread to convert lossless to jpeg 2000 in case the sequence has to be displayed.
No audio sync, I’wont use audio for now.
Starting on Windows and porting afterwards.
Displaying in realtime of course means using only 60fps out of 1000 (or any other high fps used). But it could be interesting to playback at high fps without display, just for processing purposes.
Scrubbing will suffer since we are reading from disk. Not sure what delay is expected.
The recording part is more tricky, dropping frames is not a good thing, so first we need to store in memory and then save to disk as fast as possible. If the sequence is very long we might get into the situation where no more memory is available, then start dropping frames and keep a log.
Things i’ve tried:
So far I have been using my own version of ofxImageSequence (by @obviousjim and Co) to load from memory, import from disk, export to disk, and playback (updating a single texture…).
This works very well for a sequence that has been completetly stored in memory. The problem is that storing long sequences in memory is not a good idea.
I have been reading about Memory-mapped files (MMFs) [https://msdn.microsoft.com/en-us/library/ms810613.aspx]. It is a -very old- windows API for reading chunks of data from/to disk. Not sure if this is useful at all today. Any idea if this has been used in any project? I saw that boost implements a multiplatform API.
Any suggestion on what is best to use?
What to start researching first?
Is the wheel already made and I should not try building anything new?
Addons didn’t try yet:
@looks interesting but I’m not interested in lossy compression, simultaneous file palyback…
@arturo could you give one cent of what exacly does? only file formating?
My own version is here: