Info::MPEG(3pm) | User Contributed Perl Documentation | Info::MPEG(3pm) |
Video::Info::MPEG - Basic MPEG bitstream attribute parser.
use strict; use Video::Info::MPEG; my $video = Video::Info::MPEG->new( -file => $filename ); $video->probe(); print $file->type; ## MPEG ## Audio information print $file->acodec; ## MPEG Layer 1/2 print $file->acodecraw; ## 80 print $file->achans; ## 1 print $file->arate; ## 128000 (bits/sec) print $file->astreams ## 1 ## Video information printf "%0.2f", $file->fps ## 29.97 print $file->height ## 240 print $file->width ## 352 print $file->vstreams ## 1 print $file->vcodec ## MPEG1 print $file->vframes ## 529 print $file->vrate ## 1000000 (bits/sec)
The Moving Picture Experts Group (MPEG) is a working group in charge of the development of standards for coded representation of digital audio and video.
MPEG audio and video clips are ubiquitous but using Perl to programmatically collect information about these bitstreams has to date been a kludge at best.
This module parses the raw bitstreams and extracts information from the packet headers. It supports Audio, Video, and System (multiplexed audio and video) packets so it can be used on nearly every MPEG you encounter.
Video::Info::MPEG is a derived class of Video::Info, a factory module "designed to meet your multimedia needs for many types of files".
These methods are inherited from Video::Info. While Video::Info may have changed since this documentation was written, they are provided here for convenience.
So you secretly desire to be the evil Spock, eh? Well rub your goatee and read on.
There are some MPEG-specific attributes that don't yet fit nicely into Video::Info. I am documenting them here for the sake of completeness.
Note that if you use these, you may have to make changes when new versions of this package are released. There will be elegant ways to access them in the future but we wanted to get this out there.
These apply to audio bitstreams:
Mono Stereo Dual Channel Intensity stereo on bands 4-31/32 Intensity stereo on bands 8-31/32 Intensity stereo on bands 12-31/32 Intensity stereo on bands 16-31/32 Intensity stereo off, M/S stereo off Intensity stereo on, M/S stereo off Intensity stereo off, M/S stereo on Intensity stereo on, M/S stereo on
No Emphasis 50/15us Unknown CCITT J 17 Undefined
These apply to video:
Forbidden 1/1 (VGA) 4/3 (TV) 16/9 (Large TV) 2.21/1 (Cinema) Reserved
Benjamin R. Ginter, <bginter@asicommunications.com> Allen Day, <allenday@ucla.edu>
Copyright (c) 2001-2002 Aladdin Free Public License (see LICENSE for details) Benjamin R. Ginter <bginter@asicommunications.com>, Allen Day <allenday@ucla.edu>
Video::Info Video::Info::RIFF Video::Info::ASF
2022-12-12 | perl v5.36.0 |