A video tag is a tag of type 9. Its first byte gives the frame type and the codec. If the top bit of that byte is set, the tag is in the Enhanced FLV layout instead.
Video tag header
| Bits | Name | Meaning |
|---|---|---|
| 7 to 4 | FrameType | The kind of frame. |
| 3 to 0 | CodecID | The codec. |
| FrameType | Meaning |
|---|---|
| 1 | Key frame |
| 2 | Inter frame |
| 3 | Disposable inter frame (H.263 only) |
| 4 | Generated key frame (server use only) |
| 5 | Video info or command frame |
| CodecID | Codec |
|---|---|
| 0 | RGB; listed by Wikipedia, not in Adobe’s list |
| 1 | Run-length; listed by Wikipedia, not in Adobe’s list |
| 2 | Sorenson H.263 |
| 3 | Screen video |
| 4 | On2 VP6 |
| 5 | On2 VP6 with alpha |
| 6 | Screen video version 2 |
| 7 | AVC (H.264) |
| 8 | ITU H.263; listed by Wikipedia |
| 9 | MPEG-4 ASP; listed by Wikipedia |
| 10 to 15 | Reserved |
AVC packets
When CodecID is 7, the header byte is followed by:
| Offset | Size | Type | Name | Meaning |
|---|---|---|---|---|
| 0 | 1 | UI8 | AVCPacketType | 0: sequence header, an AVCDecoderConfigurationRecord. 1: NAL units. 2: end of sequence. |
| 1 | 3 | SI24 | CompositionTime | Composition offset in milliseconds when AVCPacketType is 1, otherwise 0. |
| 4 | varies | Data | The configuration record or the NAL units, each with a length prefix. |
Video info frames
A tag with FrameType 5 carries one byte of command instead of a frame:
0 is start of client-side seeking and 1 is end of client-side seeking.