Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

ChrisDolan (2855)

  (email not shown publicly)

Journal of ChrisDolan (2855)

Tuesday July 25, 2006
09:09 PM

Current project: FLV::Info

[ #30427 ]

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.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.