.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Info 3pm" .TH Info 3pm "2010-07-30" "perl v5.10.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" MP4::Info \- Fetch info from MPEG\-4 files (.mp4, .m4a, .m4p, .3gp) .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& #!perl \-w \& use MP4::Info; \& my $file = \*(AqPearls_Before_Swine.m4a\*(Aq; \& \& my $tag = get_mp4tag($file) or die "No TAG info"; \& printf "$file is a %s track\en", $tag\->{GENRE}; \& \& my $info = get_mp4info($file); \& printf "$file length is %d:%d\en", $info\->{MM}, $info\->{SS}; \& \& my $mp4 = new MP4::Info $file; \& printf "$file length is %s, title is %s\en", \& $mp4\->time, $mp4\->title; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The MP4::Info module can be used to extract tag and meta information from \&\s-1MPEG\-4\s0 audio (\s-1AAC\s0) and video files. It is designed as a drop-in replacement for MP3::Info. .PP Note that this module does not allow you to update the information in \s-1MPEG\-4\s0 files. .ie n .IP "$mp4 = MP4::Info\->new(\s-1FILE\s0)" 4 .el .IP "\f(CW$mp4\fR = MP4::Info\->new(\s-1FILE\s0)" 4 .IX Item "$mp4 = MP4::Info->new(FILE)" \&\s-1OOP\s0 interface to the rest of the module. The same keys available via \&\f(CW\*(C`get_mp4info\*(C'\fR and \f(CW\*(C`get_mp4tag\*(C'\fR are available via the returned object (using upper case or lower case; but note that all-caps '\s-1VERSION\s0' will return the module version, not the \s-1MPEG\-4\s0 version). .Sp Passing a value to one of the methods will \fBnot\fR set the value for that tag in the \s-1MPEG\-4\s0 file. .IP "use_mp4_utf8([\s-1STATUS\s0])" 4 .IX Item "use_mp4_utf8([STATUS])" Tells MP4::Info whether to assume that ambiguously encoded \s-1TAG\s0 info is \s-1UTF\-8\s0 or Latin\-1. 1 is \s-1UTF\-8\s0, 0 is Latin\-1. Default is \s-1UTF\-8\s0. .Sp Function returns new status (1/0). If no argument is supplied, or an unaccepted argument is supplied, function merely returns existing status. .Sp This function is not exported by default, but may be exported with the \f(CW\*(C`:utf8\*(C'\fR or \f(CW\*(C`:all\*(C'\fR export tag. .IP "get_mp4tag (\s-1FILE\s0)" 4 .IX Item "get_mp4tag (FILE)" Returns hash reference containing the tag information from the \s-1MP4\s0 file. The following keys may be defined: .Sp .Vb 10 \& ALB Album \& APID Apple Store ID \& ART Artist \& CMT Comment \& COVR Album art (typically JPEG or PNG data) \& CPIL Compilation (boolean) \& CPRT Copyright statement \& DAY Year \& DISK Disk number & total (2 integers) \& GNRE Genre \& GRP Grouping \& NAM Title \& RTNG Rating (integer) \& TMPO Tempo (integer) \& TOO Encoder \& TRKN Track number & total (2 integers) \& WRT Author or composer .Ve .Sp For compatibility with MP3::Info, the \s-1MP3\s0 ID3v1\-style keys \&\s-1TITLE\s0, \s-1ARTIST\s0, \s-1ALBUM\s0, \s-1YEAR\s0, \s-1COMMENT\s0, \s-1GENRE\s0 and \s-1TRACKNUM\s0 are defined as synonyms for \s-1NAM\s0, \s-1ART\s0, \s-1ALB\s0, \s-1DAY\s0, \s-1CMT\s0, \s-1GNRE\s0 and TRKN[0]. .Sp Any and all of these keys may be undefined if the corresponding information is missing from the \s-1MPEG\-4\s0 file. .Sp On error, returns nothing and sets \f(CW$@\fR. .IP "get_mp4info (\s-1FILE\s0)" 4 .IX Item "get_mp4info (FILE)" Returns hash reference containing file information from the \s-1MPEG\-4\s0 file. The following keys may be defined: .Sp .Vb 5 \& VERSION MPEG version (=4) \& LAYER MPEG layer description (=1 for compatibility with MP3::Info) \& BITRATE bitrate in kbps (average for VBR files) \& FREQUENCY frequency in kHz \& SIZE bytes in audio stream \& \& SECS total seconds, rounded to nearest second \& MM minutes \& SS leftover seconds \& MS leftover milliseconds, rounded to nearest millisecond \& TIME time in MM:SS, rounded to nearest second \& \& COPYRIGHT boolean for audio is copyrighted \& ENCODING audio codec name. Possible values include: \& \*(Aqmp4a\*(Aq \- AAC, aacPlus \& \*(Aqalac\*(Aq \- Apple lossless \& \*(Aqdrms\*(Aq \- Apple encrypted AAC \& \*(Aqsamr\*(Aq \- 3GPP narrow\-band AMR \& \*(Aqsawb\*(Aq \- 3GPP wide\-band AMR \& \*(Aqenca\*(Aq \- Unspecified encrypted audio \& ENCRYPTED boolean for audio data is encrypted .Ve .Sp Any and all of these keys may be undefined if the corresponding information is missing from the \s-1MPEG\-4\s0 file. .Sp On error, returns nothing and sets \f(CW$@\fR. .SH "BUGS" .IX Header "BUGS" Doesn't support writing tag information to \s-1MPEG\-4\s0 files. .PP If you find a bug, please send me a patch. If you cannot figure out why it does not work for you, please put the \s-1MP4\s0 file in a place where I can get it (preferably via \s-1FTP\s0, or \s-1HTTP\s0) and send me mail regarding where I can get the file, with a detailed description of the problem. I will keep a copy of the file only for as long as necessary to debug the problem. .SH "AUTHOR" .IX Header "AUTHOR" Jonathan Harris . .SH "THANKS" .IX Header "THANKS" Chris Nandor for writing MP3::Info .PP Dan Sully at Slim Devices for cover art and iTunes/aacgain metadata patches. .PP Ruben Laguna for \s-1PSP\s0 support. .SH "SEE ALSO" .IX Header "SEE ALSO" .IP "MP4::Info Project Page" 4 .IX Item "MP4::Info Project Page" .IP "\s-1ISO\s0 14496\-12:2004 \- Coding of audio-visual objects \- Part 12: \s-1ISO\s0 base media file format" 4 .IX Item "ISO 14496-12:2004 - Coding of audio-visual objects - Part 12: ISO base media file format" .IP "\s-1ISO\s0 14496\-14:2003 \- Coding of audio-visual objects \- Part 14: \s-1MP4\s0 file format" 4 .IX Item "ISO 14496-14:2003 - Coding of audio-visual objects - Part 14: MP4 file format" (Not worth buying \- the interesting stuff is in Part 12). .IP "3GPP \s-1TS\s0 26.244 \- 3GPP file format (3GP)" 4 .IX Item "3GPP TS 26.244 - 3GPP file format (3GP)" .IP "QuickTime File Format" 4 .IX Item "QuickTime File Format" .IP "\s-1ISO\s0 14496\-1 Media Format" 4 .IX Item "ISO 14496-1 Media Format" .IP "MP3::Info" 4 .IX Item "MP3::Info" .SH "COPYRIGHT and LICENSE" .IX Header "COPYRIGHT and LICENSE" Copyright (c) 2004\-2010, Jonathan Harris .PP This program is free software; you can redistribute it and/or modify it under the the same terms as Perl itself.