The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

FLV::Info - Extract metadata from Flash Video files

SYNOPSIS

use FLV::Info;
my $reader = FLV::Info->new();
$reader->parse('video.flv');
my %info = $reader->get_info();
print "$info{video_count} video frames\n";
print $reader->report();

DESCRIPTION

This module reads Macromedia FLV files and reports metadata about those files.

LEGAL

This work is based primarily on the file specification provided by Macromedia. Use of that specification is governed by terms indicated at the licensing URL specified below.

http://download.macromedia.com/pub/flash/flash_file_format_specification.pdf

http://www.macromedia.com/licensing/developer/

LICENSE

Copyright 2006 Clotho Advanced Media, Inc., <cpan@clotho.com>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

METHODS

$pkg->new()

Creates a new instance.

$self->parse($filename)
$self->parse($filehandle)

Reads the specified file. If the file does not exist or is an invalid FLV stream, an exception will be thrown via croak().

There is no return value.

$self->get_info()

Returns a hash with all FLV metadata. Any fields that are multivalued are concatenated with a slash (/) with the most common values specified first. For example, a common case is the video_type which is often interframe/keyframe since interframes are more common than keyframes. A less common case could be audio_type of mono/stereo if the FLV was mostly one-channel but had some packets of two-channel audio.

$self->report()

Returns a summary of all FLV metadata as a string. This is a human-readable version of the data returned by get_info().

SEE ALSO

FLVTool2

This is a rather nice Ruby implementation that can read and write FLV files. This code helped me figure out that the FLV documentation was wrong for the order of attributes in video tags. It also helped me understand the meta tags.

http://inlet-media.de/flvtool2

AMF::Perl

This is a Perl implementation of the http://www.amfphp.org/ project to create an open source representation of the Flash remote communication protocol. This module leverages a small part of AMF::Perl to parse FLV meta tags.

COMPATIBILITY

This module should work with FLV v1.0 and FLV v1.1 files. All other versions will certainly fail.

AUTHOR

Clotho Advanced Media Inc., cpan@clotho.com

Primary developer: Chris Dolan