MP4::File - Read/Write MP4 files
use MP4::File; $mp4 = MP4::File->new; $mp4->Modify($filename); $mp4->SetMetadataArtist("Dire Straits"); $mp4->Close; MP4::File->Optimize($filename);
Please refer to the libmp4v2 documentation for details.
$info = MP4::File->FileInfo($fileName, $trackId = 0)
$ok = MP4::File->Optimize($fileName, $newFileName = 0, $verbosity = 0)
$mp4 = MP4::File->new()
$ok = $mp4->Read($fileName, $verbosity = 0)
$ok = $mp4->Modify($fileName, $verbosity = 0, $flags = 0)
$info = $mp4->Info($trackId = 0)
$ok = $mp4->Close()
$verbosity = $mp4->GetVerbosity()
$ok = $mp4->SetVerbosity($verbosity)
$trackId = $mp4->FindTrackId($index, $type = 0, $subType = 0)
$type = $mp4->GetTrackType($trackId)
$type is one of the following constants that may be imported using:
use MP4::File qw( :constants );
$seconds = $mp4->GetTrackDuration($trackId)
$bps = $mp4->GetTrackBitRate($trackId)
$scale = $mp4->GetTrackTimeScale($trackId)
$ok = $mp4->MetadataDelete()
$ok = $mp4->DeleteMetadataName()
$ok = $mp4->DeleteMetadataArtist()
$ok = $mp4->DeleteMetadataWriter()
$ok = $mp4->DeleteMetadataComment()
$ok = $mp4->DeleteMetadataTool()
$ok = $mp4->DeleteMetadataYear()
$ok = $mp4->DeleteMetadataAlbum()
$ok = $mp4->DeleteMetadataGenre()
$ok = $mp4->DeleteMetadataGrouping()
$ok = $mp4->DeleteMetadataCoverArt()
$ok = $mp4->DeleteMetadataTrack()
$ok = $mp4->DeleteMetadataDisk()
$ok = $mp4->DeleteMetadataTempo()
$ok = $mp4->DeleteMetadataCompilation()
$string = $mp4->GetMetadataName()
$string = $mp4->GetMetadataArtist()
$string = $mp4->GetMetadataWriter()
$string = $mp4->GetMetadataComment()
$string = $mp4->GetMetadataTool()
$string = $mp4->GetMetadataYear()
$string = $mp4->GetMetadataAlbum()
$string = $mp4->GetMetadataGenre()
$string = $mp4->GetMetadataGrouping()
$number = $mp4->GetMetadataCoverArtCount()
$binary = $mp4->GetMetadataCoverArt()
($curr, $total) = $mp4->GetMetadataTrack()
($curr, $total) = $mp4->GetMetadataDisk()
$tempo = $mp4->GetMetadataTempo()
$bool = $mp4->GetMetadataCompilation()
$ok = $mp4->SetMetadataName($string)
$ok = $mp4->SetMetadataArtist($string)
$ok = $mp4->SetMetadataWriter($string)
$ok = $mp4->SetMetadataComment($string)
$ok = $mp4->SetMetadataTool($string)
$ok = $mp4->SetMetadataYear($string)
$ok = $mp4->SetMetadataAlbum($string)
$ok = $mp4->SetMetadataGenre($string)
$ok = $mp4->SetMetadataGrouping($string)
$ok = $mp4->SetMetadataCoverArt($binary)
$ok = $mp4->SetMetadataTrack($curr, $total)
$ok = $mp4->SetMetadataDisk($curr, $total)
$ok = $mp4->SetMetadataTempo($tempo)
$ok = $mp4->SetMetadataCompilation($bool)
Marcus Holland-Moritz <mhx@cpan.org>
To install MP4::File, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MP4::File
CPAN shell
perl -MCPAN -e shell install MP4::File
For more information on module installation, please visit the detailed CPAN module installation guide.