avmetadataeditor

Last Revision:
Version 1.0, 2011-03-17
A command line application demonstrating how to use the AVFoundation metadata APIs.
Build Requirements:
Xcode 4.0 or later
Runtime Requirements:
Mac OS X v10.7 or later

avmetadataeditor demonstrates the use of the AVFoundation metadata API to perform various common tasks such as reading, writing and displaying metadata from source media files. This sample also demonstrates how to work with both QuickTime and iTunes metadata.

Usage:

avmetadataeditor [-w] [-a] [ <options> ] src dst avmetadataeditor [-p] [-o] [ <options> ] src src is a path to a local file. dst is a path to a destination file. Options:

-w, --write-metadata=PLISTFILE Use a PLISTFILE as metadata for the destination file -a, --append-metadata=PLISTFILE Use a PLISTFILE as metadata to merge with the source metadata for the destination file -p, --print-metadata=PLISTFILE Write in a PLISTFILE the metadata from the source file -f, --file-type=UTI Use UTI as output file type -o, --output-metadata Output the metadata from the source file -d, --description-metadata Output the metadata description from the source file -q, --quicktime-metadata Quicktime metadata format -u, --quicktime-user-metadata Quicktime user metadata format -i, --iTunes-metadata iTunes metadata format -h, --help Print this message and exit

Example use case:

The following steps are a good place to start working with the iTunes metadata format:

1) Use avmetadataeditor to export the original iTunes metadata to a plist:

avmetareadwrite -i -p test.plist test.m4v

2) Edit the plist file as you like then use avmetadataeditor to then export to a new file saving your modified metadata

avmetareadwrite -i -f com.apple.m4v-video -w test.plist input.m4v output.m4v

Note: If the export file type is not specified, the sample defaults to quicktime which will translate the metadata to the common metadata format. "com.apple.m4v-video" in the above example is the iTunes video file type and -i specifies output in the iTunes metadata plist format.