MP4::Info (3)
Leading comments
Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07) Standard preamble: ========================================================================
NAME
MP4::Info - Fetch info from MPEG-4 files (.mp4, .m4a, .m4p, .3gp)SYNOPSIS
#!perl -w use MP4::Info; my $file = 'Pearls_Before_Swine.m4a'; my $tag = get_mp4tag($file) or die "No TAG info"; printf "$file is a %s track\n", $tag->{GENRE}; my $info = get_mp4info($file); printf "$file length is %d:%d\n", $info->{MM}, $info->{SS}; my $mp4 = new MP4::Info $file; printf "$file length is %s, title is %s\n", $mp4->time, $mp4->title;
DESCRIPTION
The MP4::Info module can be used to extract tag and meta information fromNote that this module does not allow you to update the information in
- $mp4 = MP4::Info->new(FILE)
-
OOPinterface to the rest of the module. The same keys available via "get_mp4info" and "get_mp4tag" are available via the returned object (using upper case or lower case; but note that all-caps 'VERSION' will return the module version, not theMPEG-4version).
Passing a value to one of the methods will not set the value for that tag in the
MPEG-4file. - use_mp4_utf8([STATUS])
-
Tells MP4::Info whether to assume that ambiguously encoded TAGinfo isUTF-8or Latin-1. 1 isUTF-8, 0 is Latin-1. Default isUTF-8.
Function returns new status (1/0). If no argument is supplied, or an unaccepted argument is supplied, function merely returns existing status.
This function is not exported by default, but may be exported with the ":utf8" or ":all" export tag.
- get_mp4tag (FILE)
-
Returns hash reference containing the tag information from the MP4file. The following keys may be defined:
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
For compatibility with MP3::Info, the
MP3ID3v1-style keysTITLE,ARTIST,ALBUM,YEAR,COMMENT,GENREandTRACKNUMare defined as synonyms forNAM,ART,ALB,DAY,CMT,GNREand TRKN[0].Any and all of these keys may be undefined if the corresponding information is missing from the
MPEG-4file.On error, returns nothing and sets $@.
- get_mp4info (FILE)
-
Returns hash reference containing file information from the MPEG-4file. The following keys may be defined:
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: 'mp4a' - AAC, aacPlus 'alac' - Apple lossless 'drms' - Apple encrypted AAC 'samr' - 3GPP narrow-band AMR 'sawb' - 3GPP wide-band AMR 'enca' - Unspecified encrypted audio ENCRYPTED boolean for audio data is encrypted
Any and all of these keys may be undefined if the corresponding information is missing from the
MPEG-4file.On error, returns nothing and sets $@.
BUGS
Doesn't support writing tag information toIf you find a bug, please send me a patch. If you cannot figure out why it does not work for you, please put the
AUTHOR
Jonathan Harris <jhar@cpan.org>.THANKS
Chris Nandor <pudge@pobox.com> for writing MP3::InfoDan Sully at Slim Devices for cover art and iTunes/aacgain metadata patches.
Ruben Laguna for
SEE ALSO
- MP4::Info Project Page
- <search.cpan.org/~jhar/MP4-Info>
- ISO14496-12:2004 - Coding of audio-visual objects - Part 12:ISObase media file format
- <www.iso.ch/iso/en/ittf/PubliclyAvailableStandards/c038539_ISO_IEC_14496-12_2004(E).zip>
- ISO14496-14:2003 - Coding of audio-visual objects - Part 14:MP4file format
- <www.iso.org/iso/en/CatalogueDetailPage.CatalogueDetail?CSNUMBER=38538> (Not worth buying - the interesting stuff is in Part 12).
- 3GPP TS26.244 - 3GPP file format (3GP)
- <www.3gpp.org/ftp/Specs/html-info/26244.htm>
- QuickTime File Format
- <developer.apple.com/documentation/QuickTime/QTFF>
- ISO14496-1 Media Format
- <www.geocities.com/xhelmboyx/quicktime/formats/mp4-layout.txt>
- MP3::Info
- <search.cpan.org/~cnandor/MP3-Info>
COPYRIGHT and LICENSE
Copyright (c) 2004-2010, Jonathan Harris <jhar@cpan.org>This program is free software; you can redistribute it and/or modify it under the the same terms as Perl itself.