tags:

views:

324

answers:

1

I wanna know how the onMetaData marker in FLV files looks like. When i open FLV files as plain text I get this:

FLV[][][][][](TAB)[][][][][][][]8[][][][][][][][][]  
onMetaData[]  
duration...   

The docs say the first 3 bytes are the signature "FLV" the next byte tells the flv version, the next byte is telling us if audio or video tags are present, the next 4 bytes are the data-offset(the size of the header), wich is 9, in ascii its the TAB code. after the TAB starts the body with the fist "previous tag size field" wich is 0(4 bytes) next, there is the Tag Type (1 byte) the data size (3 bytes) and the timestamp (4 bytes) the stream id (always 0, 3bytes). After that remains:

[]  
onMetaData[]  
[][][][][][]  
duration...

I suppose the onMetaData marker is "1byte, newline"onMetaData"1byte,newline) but what are the 7 bytes between onMetaData marker and duration?

+1  A: 

You would need to view this file in a hex editor to get anything useful from it; a text editor will just show you unprintable characters.

The ASCII "onMetaData" bit in the file is the tag header, which is wrapping the "duration" field. The three bytes immediately after "onMetaData" are the BodyLength of the tag (uint24, big-endian), and the next 4 bytes ("\x00\x00\x00\x08") describe the length of the name for the next tag, which is "duration."

pixelbath