RIFF::Info - Probe DivX, AVI, and ASF files for attributes like:
-video codec -audio codec -frame height -frame width -frame count
and more!
use RIFF::Info; my $video; $video = RIFF::Info->new($filename); #like this $video = RIFF::Info->new($filename,$headersize); #or this $self->probe; #parse the video file $video->vcodec; #video codec $video->acodec; #audio codec ...
RIFF::Info has one constructor, new(). It must be called with a filename, and an optional header size (see BUGS). Returns a RIFF::Info object if the file was opened successfully.
Call probe() on the RIFF::Info object to parse the file. This does a series of sysread()s on the file to figure out what the properties are.
Now, call one (or more) of these methods to get the low-down on your file:
method returns --------------------------------------------------- achans() number of audio channels acodec() audio codec acodecraw() audio codec numeric ID arate() audio bitrate astreams() number of audio streams fps() frames/second height() frame width in pixels scale() video bitrate type() type of file data. RIFF or AVI. vcodec() video codec vframes() number of frames vrate() video bitrate vstreams() number of video streams width() frame height in pixels
The default header_size() (10K) may not be large enough to successfully extract the video/audio attributes for all RIFF files. If this module fails you, consider increasing the RIFF header size. If it still fails, let me know.
Audio codec name mapping is incomplete. If you know the name that corresponds to an audio codec ID that I don't, tell me.
Allen Day <allenday@ucla.edu> Copyright (c) 2002, Allen Day
You may enjoy this module under the same terms as Perl itself.
This was written with liberal snarfing from transcode, a linux video stream processing tool available from:
http://www.theorie.physik.uni-goettingen.de/~ostreich/transcode/
To install RIFF::Info, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RIFF::Info
CPAN shell
perl -MCPAN -e shell install RIFF::Info
For more information on module installation, please visit the detailed CPAN module installation guide.