MPEG::LibMPEG3

MPEG::LibMPEG3 is a Perl interface to libmpeg3 module.
Download

MPEG::LibMPEG3 Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Benjamin R. Ginter
  • Publisher web site:
  • http://search.cpan.org/~brg/MPEG-LibMPEG3-0.01/LibMPEG3.pm

MPEG::LibMPEG3 Tags


MPEG::LibMPEG3 Description

MPEG::LibMPEG3 is a Perl interface to libmpeg3 module. MPEG::LibMPEG3 is a Perl interface to libmpeg3 module.SYNOPSIS use strict; use MPEG::LibMPEG3; my $mpeg = MPEG::LibMPEG3->new( $filename ); $mpeg->set_cpus(1); ## I only have 1 cpu but you can put whatever $mpeg->set_mmx(1); ## but it has mmx instructions printf "Audio Streams: %dn", $mpeg->astreams; for ( 0..$mpeg->astreams() - 1 ) { print " Stream #$_n"; printf "tachans : %dn", $mpeg->achans( $_ ); printf "tarate : %dn", $mpeg->arate( $_ ); printf "taformat : %sn", $mpeg->acodec( $_ ); printf "tduration: %0.2fn", $mpeg->aduration( $_ ); print "n"; } printf "Video Streams: %dn", $mpeg->vstreams; for ( 0..$mpeg->vstreams() - 1 ) { print " Stream #$_n"; printf "tWidth : %dn" , $mpeg->width( $_ ); printf "tHeight : %dn" , $mpeg->height( $_ ); printf "tAspect Ratio : %dn" , $mpeg->aspect( $_ ); printf "tFrame Rate : %0.2fn", $mpeg->fps( $_ ); printf "tTotal Frames : %dn" , $mpeg->vframes( $_ ); printf "tColor Model : %dn" , $mpeg->colormodel( $_ ); printf "tDuration : %0.2fn", $mpeg->vduration( $_ ); print "Dumping frames as YUVn"; for ( my $i = 0; $i < $mpeg->vframes; $i++ ) { my $output_rows = $mpeg->get_yuv; my $frame_yuv = sprintf( "%s-d.yuv", $file, $i ); # printf "Opening $frame_yuvn"; print '.'; open OUT, "> $frame_yuv" or die "Can't open file $frame_yuv for output: $!n"; print OUT $output_rows; close OUT; if ( $i > 1 && $i % $mpeg->fps($_) == 0 ) { printf " %0.0f sec/sn", $i/$mpeg->fps($_); } } printf " %0.2f sec/sn", $mpeg->duration; }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 uses the libmpeg3 library to parse and extract information from the bitstraems. It supports the following types of files: MPEG-1 Layer II Audio MPEG-1 Layer III Audio MPEG-2 Layer III Audio MPEG-1 program streams MPEG-2 program streams MPEG-2 transport streams AC3 Audio MPEG-2 Video MPEG-1 Video IFO files VOB filesRequirements:· Perl Requirements: · Perl


MPEG::LibMPEG3 Related Software