I'm using the Intel Media SDK for decoding a h264 stream and I'm very happy with the results. Decoding 4K at 900fps! I'm now looking for a way that allows me to perform jumping between frames in real-time. Lets say the current frame is 25 and I want to jump to frame 100, then I would first need to find the nearest I-frame. When the nearest I-frame is 90, I need to decode from frame 90 to 100. This may take too much time and therefore one solution would be to only store I-frames which ofcourse will increase the file size.
Lets say I have plenty of cpu, ram, etc.. what would be the best solution that allows me to jump between frames in real-time?
If I'm correct I need to reset the decoder, but would this slow down decoding?
To seek/skip frames in decoder, the two options that exist today are (1) Use the fast HW decoder to decode frames and discard the ones not needed. Given the very high decoding fps, this option may not hurt your pipeline as much. (2) Do the pre-processing on the CPU side to parse the frames and identify them.
Hope this helps.
I'm using a combination. I'm parsing the h264 stream and identify the start offsets (in bytes) of the frames and store these offsets in a file. Then when I want to playback from a specific frame, I look for the closest idr-frame, read the sps and pps (I think this is wrongly mentioned in the manual), and start decoding up to the frame. This works perfectly and is easy doable in real time for 4K.