Flash Video
Flash Video is a container file format used to deliver digital video content over the Internet using Adobe Flash Player version 6 and newer. Flash Video content may also be embedded within SWF files. There are two different Flash Video file formats: FLV and F4V. The audio and video data within FLV files are encoded in the same way as SWF files. The F4V file format is based on the ISO base media file format, starting with Flash Player 9 update 3. Both formats are supported in Adobe Flash Player and developed by Adobe Systems. FLV was originally developed by Macromedia.
In the early 2000s, Flash Video was the de facto standard for web-based streaming video. Users include Hulu, VEVO, Yahoo! Video, metacafe, Reuters.com, and many other news providers.
Flash Video FLV files usually contain material encoded with codecs following the Sorenson Spark or VP6 video compression formats. public releases of Flash Player also support H.264 video and HE-AAC audio. All of these compression formats are restricted by patents. Flash Video is viewable on most operating systems via the Adobe Flash Player and web browser plugin or one of several third-party programs. Apple's iOS devices, along with almost all other mobile devices, do not support the Flash Player plugin and so require other delivery methods such as provided by the Adobe Flash Media Server.
History
The 2002 release of Flash Player 6 added support for video in the SWF file format. The 2003 release of Flash Player 7 added direct support for the FLV file format. Because of restrictions in the FLV file format, Adobe Systems created new file formats in 2007, based on the ISO base media file format. In this way, the F4V format shares a common base with the MP4 format, which is why F4V is sometimes informally called "Flash MP4". Flash Player does not check the filename extension but instead examines the file to determine the format of the thing created.The new file formats are very different from the older FLV file format. For example, F4V does not support Screen video, Sorenson Spark, VP6 video compression formats and ADPCM, or Nellymoser audio compression formats. Authors of Flash Player strongly encourage use of the new standard file format F4V because it overcomes functional limits with the FLV structure when streaming H.264 or AAC, which is one reason Adobe Systems is moving away from the older FLV file structure. Since 2002, the initial format is Flash Video and the file suffix is.flv with a MIME derived Internet media type of video/x-flv.
The Adobe-branded file suffix.f4v was extended from 2007 to support the ISO base media file format using the same MIME derived Internet media type of video/mp4 as the Apple file suffix of.m4v and the general file suffix of.mp4. Adobe-branded file suffixes exist for.f4p which relates to media encrypted with their Adobe Access DRM scheme; .f4a and.f4b relate respectively to.m4a and.m4b with the same MIME derived Internet media type of audio/mp4.
SWF files published for Flash Player 6 and later versions are able to exchange audio, video, and data over RTMP connections with the Adobe Flash Media Server. One way to feed data to Flash Media Server is from files in the FLV file format. Flash Player can play SWF files created for Flash Player 7 and later versions in FLV format directly. Flash Player can also play the new F4V file format, beginning with SWF files created for Flash Player 9 Update 3.
| Flash Player version | Released | File format | Video compression formats | Audio compression formats |
| 6 | 2002 | SWF | Sorenson Spark, Screen video | MP3, ADPCM, Nellymoser |
| 7 | 2003 | SWF, FLV | Sorenson Spark, Screen video | MP3, ADPCM, Nellymoser |
| 8 | 2005 | SWF, FLV | On2 VP6, Sorenson Spark, Screen video, Screen video 2 | MP3, ADPCM, Nellymoser |
| 9 | 2007 | SWF, FLV | On2 VP6, Sorenson Spark, Screen video, Screen video 2, H.264 | MP3, ADPCM, Nellymoser, AAC |
| 9 | 2007 | SWF, F4V, ISO base media file format | H.264 | AAC, MP3 |
| 10 | 2008 | SWF, FLV | On2 VP6, Sorenson Spark, Screen video, Screen video 2, H.264 | MP3, ADPCM, Nellymoser, Speex, AAC |
| 10 | 2008 | SWF, F4V, ISO base media file format | H.264 | AAC, MP3 |
Use of the H.264 compression format in the FLV file format has some limitations so authors of Flash Player strongly encourage use of the new standard F4V file format.
Encoding
Commonly, Flash Video FLV files contain video bit streams which are a proprietary variant of the H.263 video standard, under the name of Sorenson Spark. Sorenson Spark is an older codec for FLV files but it is also a widely available and compatible one, because it was the first video codec supported in Flash Player. It is the required video compression format for Flash Player 6 and 7. Flash Player 8 and newer revisions also support the playback of On2 TrueMotion VP6 video bit streams. On2 VP6 is the preferred video compression format for use with Flash Player 8 and higher. On2 VP6 can provide a higher visual quality than Sorenson Spark, especially when using lower bit rates. On the other hand, it is computationally more complex and therefore will not run as well on certain older system configurations.The Flash Video FLV file format supports two versions of a so-called 'screenshare' codec which is an encoding format designed for screencasts. Both these formats are bitmap tile based, can be lossy by reducing color depths and are compressed using zlib. The second version is only playable in Flash Player 8 and newer. Audio in Flash Video files is usually encoded as MP3. However, audio in Flash Video FLV files recorded from the user's microphone use the proprietary Nellymoser Asao Codec. FLV files also support uncompressed audio or ADPCM format audio. Recent versions of Flash Player 9 support AAC. Support for encoding Flash Video files is provided by an encoding tool included with Adobe's Flash Professional and Creative Suite products, On2's Flix encoding tools, Sorenson Squeeze, FFmpeg and other third-party tools.
Media type support
Supported media types in both the Flash Video and ISO base media file formats:- Video
- *H.264
- * unofficial Google GPL FLV implementations for Android
- ** MPEG-4 ASP
- ** ITU H.263
- Audio
- *MPEG layer 3
- *MPEG AAC
- General video
- *RGB
- *run-length
- *Sorenson's H.263
- *On2 TrueMotion VP6 with and without alpha channel
- Animated video are the zlib based Screen 1 and 2.
- General audio are PCM and ADPCM.
- Vocal audio
- *Nellymoser's Asao @ 16 or 8 or 5 kHz
- *a-law and μ-law
- *Speex
- Timed text requires ActionScript specific commands for loading captioning, which is only supported by external text files in either JSON or W3C XML formats.
- Animated video are QuickTime types for GIF, PNG and JPEG, which replace the Screen 1 and 2 encodings.
- Timed text requires ActionScript specific commands for loading captions embedded as either EIA-608 or QuickTime mac based styled text with the 3GPP derived version that supports Unicode.
FLV converters
- SUPER
- Free Studio
- Freemake Video Converter
- Format Factory
- HandBrake Video Converter
- VLC Video Player
- Any Video Converter
- FFmpeg
- Easy 7-Zip -Via Extraction of Audios and Videos
Extensions
As FLV is widely used for online streaming through Real-Time Messaging Protocol, non-Adobe parties have added newer, modern audio and video codecs to FLV by extending the file format. See.Flash Video Structure
Header
FLV files start with a standard header which is shown below:| Field | Data Type | Default | Details |
| Signature | byte | "FLV" | Always "FLV" |
| Version | uint8 | 1 | Only 0x01 is valid |
| Flags | uint8 bitmask | 0x05 | Bitmask: 0x04 is audio, 0x01 is video |
| Header Size | uint32_be | 9 | Used to skip a newer expanded header |
Packets
After the header, the file is split into packets called "FLV tags", which have 15-byte packet headers. The first four bytes denote the size of the previous packet/tag, and aid in seeking backward.| Field | Data Type | Default | Details |
| Size of previous packet | uint32_be | 0 | For first packet set to NULL |
| Packet Type | uint8 | 18 | For first packet set to AMF Metadata |
| Payload Size | uint24_be | varies | Size of packet data only |
| Timestamp Lower | uint24_be | 0 | For first packet set to NULL |
| Timestamp Upper | uint8 | 0 | Extension to create a uint32_be value |
| Stream ID | uint24_be | 0 | For first stream of same type set to NULL |
| Payload Data | freeform | varies | Data as defined by packet type |
The Packet Type byte of a packet/tag header is based on the RTMP message ID byte with the AMF metadata value of 18, video payload value of 9 and audio payload value of 8 being the only valid types used. The third bit indicates the payload is encrypted using the same mechanism as RTMP uses, however this is rarely used due to encrypted transports such as RTMP being used instead. The FLV packet encryption is generally inherited from a MP4 file that is stored on an Adobe Flash Media Server.
- Packet types enumerated as 1 is a RTMP set packet size.
- Packet types enumerated from 3 are RTMP bytes read report, RTMP ping, RTMP server bandwidth, RTMP client bandwidth.
- Packet types enumerated from 8 are Audio payload, Video payload.
- Packet types enumerated from 15 are RTMP flex stream send, RTMP flex shared object, RTMP flex message, AMF metadata, shared object, RTMP invoke.
- Packet type enumerated as 24 is an encapsulated flash video.
The first packet encountered is usually a metadata packet which contains information such as:
- "duration" - 64-bit IEEE floating point value in seconds
- "width" and "height" – 64-bit IEEE floating point value in pixels
- "framerate" – 64-bit IEEE floating point value in frames per second
- "keyframes" – an array with the positions of p-frames, needed when random access is sought.
- "|AdditionalHeader" - an array of required stream decoding informational pairs
- * "Encryption" - an array of required encryption informational pairs
- * "Metadata" - Base64 encoded string of a signed X.509 certificate containing the Adobe Access AES decryption key required
Video encodings enumerated from 0 are:
| Id | Video encoding |
| 0 | RGB |
| 1 | run-length |
| 2 | Sorenson's H.263 |
| 3 | Screen 1 |
| 4 | On2 TrueMotion VP6 |
| 5 | VP6 with alpha |
| 6 | Screen 2 |
| 7 | MP4 H.264 |
| 8 | ITU H.263 |
| 9 | MPEG-4 ASP. |
| 10-15 | Reserved. |
Video processing parameters enumerated from 1 are:
| Id | Video processing parameters |
| 1 | key frame |
| 2 | non-key frame |
| 3 | H.263 disposable frame |
| 4 | generated key frame |
| 5 | one byte frame seeking instruction |
MPEG-4 encodings such as H.264, MPEG-4 ASP and AAC add a one byte value with a NULL value indicating that the payload contains MPEG-4 configuration details. MPEG-4 video encodings also add three bytes for composition timestamp offset which is required for encodings that use B-frames.
Audio encodings enumerated from 0 are:
| Id | Audio encoding |
| 0 | native PCM |
| 1 | ADPCM |
| 2 | MPEG layer 3 |
| 3 | PCM - little endian |
| 4 | Asao 16 kHz |
| 5 | Asao 8 kHz |
| 6 | Asao parameter rate |
| 7 | a-law |
| 8 | μ-law |
| 9 | Reserved |
| 10 | MP4 AAC |
| 11 | Speex |
| 12-13 | Reserved |
| 14 | MPEG layer 3 8 kHz |
| 15 | Device specific such as MIDI |
Audio processing parameters with the first two bits for the sampling rate, next bit flags 16-bit sample size on with off indicating 8-bit sample size, and the final bit flags stereophonic channels on with off indicating monaural only. Sampling rates enumerated from 0 are 5.5 kHz, 11.025 kHz quarter, 22.05 kHz half, 44.1 kHz full.
Encrypted packets have an additional 31 or 24 byte header before the AES-CBC encrypted payload as follows:
| Field | Data Type | Default | Details |
| NumFilters | uint8 | 1 | always only 1 |
| FilterName | C string | "Encryption" | if only selected payloads are encrypted then is "SE" |
| Length | uint24_be | 16 or 17 | initialization vector length |
| EncryptedAU | uint8 bitmask | 0x80 or 0x00 | only if FilterName is "SE", then 0x80 mean encrypted payload |
| IV | uint128 | varies | initialization vector for AES decryption |
| Content | freeform | varies | encrypted payload |
| Padding | freeform | 0x10 | encryption padding |