| 1 | package File::Headerinfo::Video; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use base qw(File::Headerinfo); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 0 | ▶ | use Video::Info; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 6 | |||
| 7 | =head1 NAME | ||
| 8 | |||
| 9 | File::Headerinfo::Video - an extractor of useful information from video files. | ||
| 10 | |||
| 11 | =head1 DESCRIPTION | ||
| 12 | |||
| 13 | I<File::Headerinfo::Video> 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<File::Headerinfo>, L<Video::Info> | ||
| 43 | |||
| 44 | =cut | ||
| 45 | |||
| 46 | 1; | ||