Introduction
FLV is the video container of Adobe Flash Player, first used by Macromedia in Flash Player 6 and 7. In the 2000s most video on the web, including early YouTube, was delivered as FLV. Flash Player has since been retired, but FLV files remain in archives, and the same tag format is still carried by RTMP live streaming.
Early FLV files held Sorenson Spark or On2 VP6 video with MP3 audio. Later files usually hold H.264 video and AAC audio. The related F4V format is based on MP4 instead.
Structure
An FLV file starts with a 9-byte header: the signature FLV, a version
byte of 1, a flags byte saying whether audio (04) and video
(01) are present, and a 32-bit big-endian header size of 9.
The rest of the file is a series of tags, each preceded by a 32-bit size of the tag
before it (zero for the first). Each tag has an 11-byte header: a type byte (8 for
audio, 9 for video, 18 for script data such as the onMetaData object), a
24-bit data size, a 24-bit timestamp in milliseconds with an extra byte for its upper
bits, and a 24-bit stream ID that is always 0. The tag data follows.
0HeaderFLV, version, flags, header size9 bytes9PreviousTagSize0 always 04 bytes13Tag type, size, timestamp, stream ID, then the data11 bytes + data…PreviousTagSize then the next tagrepeated
Links
Software
- VLC media player (Windows, macOS, Linux, mobile)
- mpv (Windows, macOS, Linux)
- HandBrake (Windows, macOS, Linux)
- FFmpeg (Windows, macOS, Linux)
- OBS Studio, which can record to FLV (Windows, macOS, Linux)
Developers
- libavformat, C, FFmpeg’s container library