Info(3pm) User Contributed Perl Documentation Info(3pm)

Video::Info - Retrieve video properties such as:
height
width
codec
fps

  use Video::Info;
  my $info = Video::Info->new(-file=>'my.mpg');
  $info->fps();
  $info->aspect();
  ## ... see methods below

Video::Info is a factory class for working with video files. When you create a new Video::Info object (see methods), something like this will happen:
1) open file, determine type. See Video::Info::Magic.
2) attempt to create object of appropriate class
(ie, MPEG::Info for MPEG files, RIFF::Info for AVI
files).
3) Probe the file for various attributes
4) return the created object, or a Video::Info object
if the appropriate class is unavailable.

Currently, Video::Info can create objects for the following filetypes:

  Module                 Filetype
  -------------------------------------------------
  Video::Info::ASF              ASF
  MP3::Info              MPEG Layer 2, MPEG Layer 3
  Video::Info::MPEG      MPEG1, MPEG2, MPEG 2.5
  Video::Info::RIFF      AVI, DivX
  Video::Info::Quicktime MOV, MOOV, MDAT, QT

And support is planned for:

  Module                 Filetype
  -------------------------------------------------
  Video::Info::Real      RealNetworks formats

CONSTRUCTORS AND FRIENDS

new(): Constructor for a Video::Info object. new() is called with the following arguments:

  Argument    Default    Description
  ------------------------------------------------------------
  -file       none        path/to/file to create an object for
  -headersize 10240       how many bytes of -file should be
                          sysread() to determine attributes?

probe(): The core of each of the manufactured modules (with the exception of MP3::Info, which we manufacture only as courtesy), is in the probe() method. probe() does a (series of) sysread() to determine various attributes of the file. You don't need to call probe() yourself, it is done for you by the constructor, new().

METHODS

These methods should be available for all manufactured classes (except MP3::Info):

Number of audio channels. 0 for no sound, 1 for mono,2 for stereo. A higher value is possible, in principle.
Name of the audio codec.
bits/second dedicated to an audio stream.
Number of audio streams. This is often >1 for files with multiple audio tracks (usually in different languages).
Sampling rate of the audio stream, in Hertz.

Name of the video codec.
Number of video frames.
average bits/second dedicated to a video stream.
Number of video streams. 0 for audio only. This may be >1 for multi-angle video and the like, but I haven't seen it yet.
How many frames/second are displayed.
video frame width, in pixels.
video frame height, in pixels.

path to the file used to create the video object
size in bytes of filename()
file type (RIFF, ASF, etc).
file length in seconds
file length in minutes, rounded down
file length in minutes + seconds, in the format MM:SS
Ben?
Title of the file content. Not the filename.
Author of the file content.
Copyright, if any.
Freetext description of the content.
This is for an MPAA rating (PG, G, etc).
Number of data packets in the file.

 Copyright (c) 2002
 Aladdin Free Public License (see LICENSE for details)
 Allen Day, <allenday@ucla.edu>
 Benjamin R. Ginter <bginter@asicommunications.com>

Video::Info::Magic Video::Info::ASF Video::Info::MPEG Video::Info::Quicktime Video::Info::RIFF

2022-12-12 perl v5.36.0