FLV Flash Video

AI-powered detection and analysis of Flash Video files.

📂 Video
🏷️ .flv
🎯 video/x-flv
🔍

Instant FLV File Detection

Use our advanced AI-powered tool to instantly detect and analyze Flash Video files with precision and speed.

File Information

File Description

Flash Video

Category

Video

Extensions

.flv

MIME Type

video/x-flv

FLV (Flash Video) File Format

Overview

The FLV (Flash Video) format is a container file format developed by Adobe Systems for delivering video content over the internet through Adobe Flash Player. While Flash has been deprecated, FLV files were historically significant for web video streaming and are still encountered in legacy systems and archived content.

Technical Details

File Characteristics

  • Extension: .flv
  • MIME Type: video/x-flv
  • Category: Video
  • Format Type: Binary container format

Container Structure

  • Streaming Optimized: Designed for progressive download
  • Low Overhead: Minimal container metadata
  • Tag-based Format: Audio, video, and script data tags
  • Timestamp Support: Frame-level timing information

File Structure

FLV Header

// FLV File Header (9 bytes)
struct FLVHeader {
    char signature[3];     // "FLV" (0x46 0x4C 0x56)
    uint8_t version;       // File version (typically 1)
    uint8_t flags;         // Audio/Video presence flags
    uint32_t headerSize;   // Header size (typically 9)
};

// Flags byte breakdown:
// Bit 0: Reserved (must be 0)
// Bit 1: Reserved (must be 0)
// Bit 2: Audio present flag
// Bit 3: Reserved (must be 0)
// Bit 4: Video present flag
// Bits 5-7: Reserved (must be 0)

Tag Structure

// FLV Tag Header (11 bytes)
struct FLVTagHeader {
    uint8_t tagType;       // Tag type (8=audio, 9=video, 18=script)
    uint24_t dataSize;     // Size of tag data
    uint24_t timestamp;    // Timestamp in milliseconds
    uint8_t timestampExt;  // Extended timestamp (upper 8 bits)
    uint24_t streamID;     // Stream ID (always 0)
};

// Tag types:
// 8:  Audio tag
// 9:  Video tag
// 18: Script data tag (metadata)

File Organization

FLV File Layout:
├── FLV Header (9 bytes)
├── Previous Tag Size (4 bytes) - always 0 for first tag
├── Tag 1 (Header + Data)
├── Previous Tag Size (4 bytes)
├── Tag 2 (Header + Data)
├── Previous Tag Size (4 bytes)
├── ...
└── Final Previous Tag Size (4 bytes)

Video Encoding

Supported Video Codecs

Video Codec Support:
- H.263 (Sorenson Spark): Legacy codec
- Screen Video: Screen capture content
- VP6: On2 VP6 codec (common)
- VP6 Alpha: VP6 with alpha channel
- Screen Video v2: Enhanced screen capture
- H.264: Advanced Video Coding (AVC)

Video Tag Format

// Video Tag Data
struct VideoTagData {
    uint8_t frameInfo;     // Frame type and codec ID
    uint8_t avcPacketType; // AVC packet type (H.264 only)
    uint24_t composition;  // Composition time offset
    // Variable length video data follows
};

// Frame type (upper 4 bits):
// 1: Key frame (for AVC, seekable frame)
// 2: Inter frame (for AVC, non-seekable frame)
// 3: Disposable inter frame (H.263 only)
// 4: Generated key frame (server use only)
// 5: Command frame (video info/command frame)

// Codec ID (lower 4 bits):
// 2: Sorenson H.263
// 3: Screen video
// 4: On2 VP6
// 5: On2 VP6 with alpha channel
// 6: Screen video version 2
// 7: H.264/AVC

Audio Encoding

Supported Audio Codecs

Audio Codec Support:
- PCM: Uncompressed audio
- ADPCM: Adaptive Differential PCM
- MP3: MPEG-1 Audio Layer 3
- PCM Little Endian: Uncompressed LE
- Nellymoser 16kHz: Speech codec
- Nellymoser 8kHz: Lower quality speech
- Nellymoser: General purpose
- G.711 A-law: Telephony codec
- G.711 mu-law: Telephony codec
- AAC: Advanced Audio Coding
- Speex: Open source speech codec

Audio Tag Format

// Audio Tag Data
struct AudioTagData {
    uint8_t soundInfo;     // Sound format, rate, size, type
    uint8_t aacPacketType; // AAC packet type (AAC only)
    // Variable length audio data follows
};

// Sound format (upper 4 bits):
// 0: PCM Platform endian
// 1: ADPCM
// 2: MP3
// 3: PCM Little endian
// 4-5: Nellymoser variants
// 6: Nellymoser
// 10: AAC
// 11: Speex

// Sound rate (2 bits):
// 0: 5.5 kHz
// 1: 11 kHz
// 2: 22 kHz
// 3: 44 kHz

// Sound size (1 bit):
// 0: 8-bit samples
// 1: 16-bit samples

// Sound type (1 bit):
// 0: Mono
// 1: Stereo

Metadata and Script Tags

Script Data Tags

// ActionScript metadata example
{
    "duration": 120.5,
    "width": 640,
    "height": 480,
    "framerate": 25,
    "videodatarate": 500,
    "audiodatarate": 128,
    "videocodecid": 7,
    "audiocodecid": 10,
    "canSeekToEnd": true,
    "cuePoints": [
        {
            "name": "chapter1",
            "time": 0,
            "type": "navigation"
        },
        {
            "name": "chapter2", 
            "time": 60.5,
            "type": "navigation"
        }
    ]
}

Common Metadata Fields

Standard Metadata:
duration          # Video length in seconds
width             # Video width in pixels
height            # Video height in pixels
framerate         # Frames per second
videodatarate     # Video bitrate in kbps
audiodatarate     # Audio bitrate in kbps
videocodecid      # Video codec identifier
audiocodecid      # Audio codec identifier
filesize          # Total file size in bytes

Streaming and Playback

Progressive Download

// ActionScript 3 FLV playback
var netConnection:NetConnection = new NetConnection();
netConnection.connect(null);

var netStream:NetStream = new NetStream(netConnection);
var video:Video = new Video(640, 480);
video.attachNetStream(netStream);

// Play FLV file
netStream.play("video.flv");

// Handle metadata
netStream.client = {
    onMetaData: function(metadata:Object):void {
        trace("Duration: " + metadata.duration);
        trace("Dimensions: " + metadata.width + "x" + metadata.height);
    }
};

RTMP Streaming

// Real-Time Messaging Protocol streaming
var connection:NetConnection = new NetConnection();
connection.connect("rtmp://streaming.server.com/live");

var stream:NetStream = new NetStream(connection);
stream.play("livestream");

Creation and Encoding

FFmpeg Conversion

# Convert to FLV with VP6 video and MP3 audio
ffmpeg -i input.mp4 -c:v flv -c:a mp3 -ar 44100 -b:a 128k output.flv

# Convert to FLV with H.264 video and AAC audio
ffmpeg -i input.mov -c:v libx264 -c:a aac -b:v 500k -b:a 128k output.flv

# Extract frames from FLV
ffmpeg -i video.flv -r 1 frame_%03d.png

# Convert FLV to modern format
ffmpeg -i legacy.flv -c:v libx264 -c:a aac output.mp4

Adobe Media Encoder

Encoding Settings:
- Video Codec: H.264 or VP6
- Video Bitrate: 500-2000 kbps
- Audio Codec: AAC or MP3
- Audio Bitrate: 96-320 kbps
- Frame Rate: 25-30 fps
- Keyframe Interval: 2-5 seconds

Programming Interface

Python FLV Processing

# Basic FLV parsing
import struct

def parse_flv_header(file_data):
    """Parse FLV file header"""
    if len(file_data) < 9:
        raise ValueError("Invalid FLV file")
    
    signature = file_data[:3]
    if signature != b'FLV':
        raise ValueError("Not a valid FLV file")
    
    version = file_data[3]
    flags = file_data[4]
    header_size = struct.unpack('>I', file_data[5:9])[0]
    
    has_audio = bool(flags & 0x04)
    has_video = bool(flags & 0x01)
    
    return {
        'version': version,
        'has_audio': has_audio,
        'has_video': has_video,
        'header_size': header_size
    }

def parse_flv_tags(file_data, start_offset=9):
    """Parse FLV tags"""
    offset = start_offset
    
    # Skip first previous tag size (always 0)
    offset += 4
    
    tags = []
    while offset < len(file_data) - 4:
        # Parse tag header
        tag_type = file_data[offset]
        data_size = struct.unpack('>I', b'\x00' + file_data[offset+1:offset+4])[0]
        timestamp = struct.unpack('>I', b'\x00' + file_data[offset+4:offset+7])[0]
        timestamp_ext = file_data[offset+7]
        stream_id = struct.unpack('>I', b'\x00' + file_data[offset+8:offset+11])[0]
        
        timestamp |= (timestamp_ext << 24)
        
        tag = {
            'type': tag_type,
            'size': data_size,
            'timestamp': timestamp,
            'stream_id': stream_id,
            'offset': offset + 11
        }
        
        tags.append(tag)
        offset += 11 + data_size + 4  # header + data + prev tag size
    
    return tags

JavaScript FLV Analysis

// Browser-based FLV parsing
class FLVParser {
    constructor(arrayBuffer) {
        this.data = new Uint8Array(arrayBuffer);
        this.offset = 0;
    }
    
    parseHeader() {
        if (this.data.length < 9) {
            throw new Error('Invalid FLV file');
        }
        
        const signature = String.fromCharCode(...this.data.slice(0, 3));
        if (signature !== 'FLV') {
            throw new Error('Not a valid FLV file');
        }
        
        const version = this.data[3];
        const flags = this.data[4];
        const headerSize = this.readUint32(5);
        
        return {
            version,
            hasAudio: !!(flags & 0x04),
            hasVideo: !!(flags & 0x01),
            headerSize
        };
    }
    
    readUint32(offset) {
        return (this.data[offset] << 24) |
               (this.data[offset + 1] << 16) |
               (this.data[offset + 2] << 8) |
               this.data[offset + 3];
    }
    
    readUint24(offset) {
        return (this.data[offset] << 16) |
               (this.data[offset + 1] << 8) |
               this.data[offset + 2];
    }
}

Legacy and Conversion

Modern Alternatives

# Convert FLV to modern formats
# To MP4 (H.264/AAC)
ffmpeg -i legacy.flv -c:v libx264 -c:a aac -movflags faststart output.mp4

# To WebM (VP9/Opus)
ffmpeg -i legacy.flv -c:v libvpx-vp9 -c:a libopus output.webm

# To HLS for streaming
ffmpeg -i input.flv -c:v libx264 -c:a aac -f hls -hls_time 10 playlist.m3u8

Browser Compatibility

<!-- Legacy Flash Player embedding -->
<object width="640" height="480">
    <param name="movie" value="player.swf">
    <param name="flashvars" value="file=video.flv">
    <embed src="player.swf" flashvars="file=video.flv" width="640" height="480">
</object>

<!-- Modern HTML5 video (after conversion) -->
<video width="640" height="480" controls>
    <source src="video.mp4" type="video/mp4">
    <source src="video.webm" type="video/webm">
    Your browser does not support the video tag.
</video>

Best Practices

Archival and Preservation

  • Convert FLV files to modern formats for long-term storage
  • Maintain original FLV files for historical accuracy
  • Document original encoding parameters and metadata
  • Use lossless conversion when possible

Performance Considerations

  • FLV files are optimized for progressive download
  • Consider modern adaptive streaming formats for new projects
  • Use appropriate keyframe intervals for seeking performance
  • Optimize bitrates for target bandwidth

Security Considerations

  • FLV files may contain ActionScript code in metadata
  • Validate FLV files from untrusted sources
  • Use modern, sandboxed players for FLV playback
  • Consider security implications of Flash Player dependencies

The FLV format, while largely obsolete, remains important for understanding video streaming history and handling legacy content in modern applications.

AI-Powered FLV File Analysis

🔍

Instant Detection

Quickly identify Flash Video files with high accuracy using Google's advanced Magika AI technology.

🛡️

Security Analysis

Analyze file structure and metadata to ensure the file is legitimate and safe to use.

📊

Detailed Information

Get comprehensive details about file type, MIME type, and other technical specifications.

🔒

Privacy First

All analysis happens in your browser - no files are uploaded to our servers.

Related File Types

Explore other file types in the Video category and discover more formats:

Start Analyzing FLV Files Now

Use our free AI-powered tool to detect and analyze Flash Video files instantly with Google's Magika technology.

Try File Detection Tool