NAME

FFprobe - probes information from multimedia files using ffprobe

PREREQUISITES

This module requires that the ffprobe program is present and accessible through the PATH. It is part of the ffmpeg / libav suite.

SYNOPSIS

use FFprobe; # may fail if ffprobe isn't present

my $probe = FFprobe->probe_file("/path/to/multimedia/file");
print $probe->{format}->{format_name};
print $probe->{stream}->[0]->{codec_name};

METHODS

probe_file($)

use FFprobe;
my $probe = FFprobe->probe_file("/path/to/file");

Runs ffprobe -show_format -show_streams on the filename given as argument. Returns a hashref with a structured form parsed from ffprobe's output. Sample output:

$VAR1 = {
    'format' => {
        'start_time' => '0.000000',
        'filename'   => '/path/to/input/file',
    },
    'stream' => [
        {
            'index' => '0',
            'codec_tag' => '0x0000',
        },
        {
            'index' => '1',
            'codec_tag' => '0x0000',
        }
    ]
};

The index entry may not exist if there is only one stream.

AUTHOR

Diogo Franco (Kovensky) <diogomfranco at gmail.com>

LICENSE AND COPYRIGHT

Copyright 2011 Diogo Franco.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.