File Coverage

blib/lib/File/Headerinfo/Video.pm
Criterion Covered Total %
statement 7 9 77.7
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 10 12 83.3


line stmt bran cond sub pod time code
1             package File::Headerinfo::Video;
2              
3 1     1   8 use strict;
  1         1  
  1         57  
4 1     1   5 use base qw(File::Headerinfo);
  1         1  
  1         97  
5 1     1   453 use Video::Info;
  0            
  0            
6              
7             =head1 NAME
8              
9             File::Headerinfo::Video - an extractor of useful information from video files.
10              
11             =head1 DESCRIPTION
12              
13             I uses Video::Info to read the headers of video clips (of various kinds) and a few audio files, and extract from them the useful information we crave. It can handle all the types that Video::Info can handle, including quicktime files, mpegs, DivX, AVI and ASF files.
14              
15             =cut
16              
17             sub parse_file {
18             my $self = shift;
19             my $info = Video::Info->new(-file => $self->path);
20             return unless $info;
21             $self->width( $info->width );
22             $self->height( $info->height );
23             $self->duration( $info->duration );
24             $self->fps( $info->fps );
25             $self->filesize( $info->filesize );
26             $self->filetype( lc($info->type) );
27             $self->vcodec( $info->vcodec );
28             $self->datarate( $info->vrate );
29             $self->freq( $info->afrequency );
30             undef $info;
31             }
32              
33             =head1 COPYRIGHT
34              
35             Copyright 2004 William Ross (wross@cpan.org)
36              
37             This library is free software; you can redistribute it
38             and/or modify it under the same terms as Perl itself.
39              
40             =head1 SEE ALSO
41              
42             L, L
43              
44             =cut
45              
46             1;