.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" 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" '' . ds C` . ds C' '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 >0, 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. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Info 3pm" .TH Info 3pm "2023-07-20" "perl v5.36.0" "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, 0\s0 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, ARTIST, ALBUM, YEAR, COMMENT, GENRE\s0 and \s-1TRACKNUM\s0 are defined as synonyms for \s-1NAM, ART, ALB, DAY, CMT, GNRE\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 14496\-12:2004\s0 \- 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 14496\-14:2003\s0 \- 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 26.244\s0 \- 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 14496\-1\s0 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.