FFprobe - probes information from multimedia files using ffprobe
ffprobe
This module requires that the ffprobe program is present and accessible through the PATH. It is part of the ffmpeg / libav suite.
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};
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:
ffprobe -show_format -show_streams
$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.
index
Diogo Franco (Kovensky) <diogomfranco at gmail.com>
<diogomfranco at gmail.com>
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.
To install FFprobe, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FFprobe
CPAN shell
perl -MCPAN -e shell install FFprobe
For more information on module installation, please visit the detailed CPAN module installation guide.