Short Version:
I am looking for a library or sample code in either C or Actionscript which allows me to find the byte offset in a FLV file for each keyframe. I am aware that the spec is published at http://download.macromedia.com/f4v/video_file_format_spec_v10_1.pdf but wading through it and writing reliable code would, hopefully, be reinventing the wheel ;)
Longer version:
In Actionscript- I am successfully using netStream.appendBytes() to play a flv file. However, now I want to enable seeking.
It seems that I must change the stream offset to the beginning of a keyframe in the file, simply seeking to any position in the file does not work (neither when using NetStreamAppendBytesAction.RESET_SEEK nor NetStreamAppendBytesAction.RESET_BEGIN)
However, I'm not sure how to determine where that is. Even if the file were encoded with CBR and I knew the timecode for a keyframe, it would still need to be after the header which could be any length.
So I am looking for a library or solution in either C or Actionscript which allows me to find the byte offset in the file of each keyframe- that way I'll have the precise value and can even use VBR
(C will be used either to find this information beforehand, or possibly at runtime via alchemy)
Use netStream onSeekPoint event : http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html#event:onSeekPoint