I'm looking for a bit of advice on use of the VIDDEC2_process for decoding video.
My application is based upon the 'decode' demo app.
I've added features so I can record directly into MPEG4 or AVI container format, where during recording the encoded frames are packaged into and stored as MPEG/AVI atoms. My playback works fine by extracting the frames from the MPEG4/AVI file and passing them through VIDDEC2_process.
My problem is in implementing a video seek forward and seek reverse feature, where the user can playback at say double or quad speed in forwards or reverse.
Because of the MPEG4/AVI packaging I know exactly the location and size of each frame on disk so I can pick and choose which frames I read for playing back.
For seek forward I believe I can't just simply skip and ignore few frames from the file before passing one to the decoder, because the decoder will remember the previous frame it had, and if some frames are skipped before presenting it with another frame, those missing frames will screw up the decode (ie. decoder works on the differences between proper consecutive frames). So during forward seek I therefore have to pass each frame to the decoder whether it needs it or not, but reading and decoding lots of superfluous frames takes a while. I tried just skipping frames and I quickly get a multicoloured splat on the display.
The frames were stored during recording directly from the encoder, so there are no synch frames (ie. full unencoded frames, apart from the one at the start of the recorded file). Do I need to implement synch frames every so often in the recorded file, or is there a way to make the VIDDEC2_process resynch itself and deal with incoming 'missing' frames?
For reverse seek this looks even more difficult, as the frames are stored in order of time and changes between one frame to the next. I think I can't simply grab a frame and send it to the decoder, then grab the *previous* frame and send this to the decoder and so on... or can I?
Many thanks