Current project: FLV::Info

ChrisDolan on 2006-07-26T02:09:14

My current project is a Perl SWF <-> FLV transcoder. Under the hood, Adobe (neé Macromedia) FLV and SWF files share the same audio and video binary formats, differing only in metadata and little details.

Today I extended my work to include Flash 8 video (aka On2 VP6.2) in addition to the Flash 6/7 video I had solved last week. The hardest part was figuring out which video frames were keyframes vs. interframes, because the video format is not publicly documented. I solved the problem by looking at a lot of Flash 8 FLV files and looking at similar/differing bits for 6000+ frames of video:

keyframe bit 1 always 0 interframe bit 1 always 0 keyframe bit 4 always 0 interframe bit 4 always 0 keyframe bit 5 always 0 interframe bit 5 always 0 keyframe bit 8 always 0 interframe bit 8 always 0 keyframe bit 15 always 0 interframe bit 15 always 1 keyframe bit 16 always 0 keyframe bit 17 always 1 keyframe bit 18 always 1 keyframe bit 19 always 0 keyframe bit 20 always 0 keyframe bit 21 always 0 keyframe bit 22 always 1 keyframe bit 23 always 0

The only bit which is consistently different between keyframes and interframes is bit 15. Bingo! I then checked the VP3.1 documentation (an older codec, which has been open sourced and is the basis for Theora) and, indeed, that same bit is the key/interframe signifier.