View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Allen Day > Video-Info-0.993 > Video::Info::RIFF



Annotate this POD


New  5
Open  0
View/Report Bugs
Module Version: 1.07   Source  


Video::Info::RIFF - Probe DivX and AVI files for attributes like:

 -video codec
 -audio codec
 -frame height
 -frame width
 -frame count

and more!


  use Video::Info::RIFF;

  my $video;

  $video = Video::Info::RIFF->new(-file=>$filename);                          #like this
  $video = Video::Info::RIFF->new(-file=>$filename,-headersize=>$headersize); #or this

  $video->vcodec;                         #video codec
  $video->acodec;                         #audio codec


RIFF stands for Resource Interchange File Format, in case you were wondering. The morbidly curious can find out more below in REFERENCES.


Video::Info::RIFF has one constructor, new(). It is called as: -file => $filename, #your RIFF file -headersize => $headersize #optional RIFF header size to parse Returns a Video::Info::RIFF object if the file was opened successfully.

The Video::Info::RIFF object to parses the file by method probe(). 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
 afrequency()        sampling rate of audio streams, in Hertz
 astreams()          number of audio streams
 filename()          path file used to create object
 filesize()          size in bytes of filename()
 expectedsize()      expected size in bytes of filename(),
                     according to the RIFF header
 fourcc()            RIFF Four Character Code
 fps()               frames/second
 height()            frame height in pixels
 probe()             try to determine filetype
 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 width 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, increase 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.


 Copyright (c) 2002
 Aladdin Free Public License (see LICENSE for details)
 Allen Day <>


Transcode, a linux video stream processing tool:

Microsoft RIFF:

syntax highlighting: