Media files contain properties that describe the contents of the file. In Microsoft Media Foundation, these properties can be categorized as follows:
- Media-type attributes specify the encoding parameters, such as the encoding algorithm (media subtype), video frame size, video frame rate, audio bit rate, and audio sample rate. For more information about media-type attributes, see Media Types.
- Metadata contains descriptive information for the media content, such as title, artist, composer, and genre. Metadata can also describe encoding parameters. It can be faster to access this information through metadata than through media-type attributes.
- DRM properties contain information on usage restrictions. Currently Media Foundation does not support DRM properties through metadata, with the exception of the PKEY_DRM_IsProtected property.
There are two ways to read metadata in Media Foundation:
- The IMFMetadata interface (Media Foundation version 1 metadata).
- The Windows Shell IPropertyStore interface (Shell metadata).
Shell metadata pertains not only to media files but to a much wider range of files on the system.
The following table compares the features and limitations of each metadata API.
|Media Foundation v1 Metadata||Shell Metadata|
|Requires Windows Vista or later.||Requires Windows 7. |
Note Shell metadata in general does not require Windows 7, but Media Foundation did not support Shell metadata prior to Windows 7.
|Properties are not compatible with Shell property system.||Properties are compatible with the Shell property system.|
|Properties can apply to the entire file, or at the stream level.||Only file-level properties are supported. Stream-level properties are not supported.|
|Properties can have values in multiple languages.||Values in multiple languages are not supported.|
|Property keys are wide-character strings.||Property keys are PROPERTYKEY values.|
|Property values are PROPVARIANT values.||Property values are PROPVARIANT values.|
Starting in Windows 7, Media Foundation exposes metadata through the IPropertyStore interface.
This topic lists the most common metadata properties for media files.
In Windows Vista, Media Foundation exposes metadata through the IMFMetadata interface.
If you are implementing a custom media source and want to expose Shell metadata, see Custom Metadata Providers for Media Files.