Media File Information

Each media file may contain information about the file itself, as well as multiple streams of data. To obtain information about a media file, LEADTOOLS provides the IltmmMediaInfo object/interface.

An ltmmMediaInfo object must be created externally. To set the media file for which the ltmmMediaInfo object will obtain data, call IltmmMediaInfo::put_SourceFile. IltmmMediaInfo::put_SourceFile must be called before calling other IltmmMediaInfo functions in order for a media file to be associated with the object. To determine what media file is currently associated with the object, call IltmmMediaInfo::get_SourceFile. Once a media file is associated with an IltmmMediaInfo object, information about the file and the media within that file can be obtained using several functions. General information about the title, the author of the media, the rating of the media in the file, a description, etc. can be obtained using the following functions:

IltmmMediaInfo::get_Author

IltmmMediaInfo::get_Copyright

IltmmMediaInfo::get_Description

IltmmMediaInfo::get_Rating

IltmmMediaInfo::get_Title

In addition, information about the format of the source media file, the media type contained in the file, filters, etc. can be obtained by calling the following functions:

IltmmMediaInfo::get_SourceFilter

IltmmMediaInfo::get_SourceFilterClassID

IltmmMediaInfo::get_SourceFilterDispatch

IltmmMediaInfo::get_SourceFormat

IltmmMediaInfo::get_SourceFormatName

IltmmMediaInfo::get_SourceMediaType

A source media file may contain one or more streams of data. To determine the number of available streams, call IltmmMediaInfo::get_OutputStreams. Once the number of available streams is known, this number can be used to iterate through the streams and obtain information about each one. To get information on a stream, that stream must be set as the "current" stream. This is done by calling IltmmMediaInfo::put_CurrentStream. Call IltmmMediaInfo::get_CurrentStream to get the current stream in the media file. Once the current stream is set, information on the stream type, type name, media type, duration, filter, etc. can be obtained using the following functions:

IltmmMediaInfo::get_StreamDuration

IltmmMediaInfo::get_StreamMediaType

IltmmMediaInfo::get_StreamSubtype

IltmmMediaInfo::get_StreamSubtypeName

IltmmMediaInfo::get_StreamType

IltmmMediaInfo::get_StreamTypeName

If the current stream is a video stream , the following functions can be used to obtain video information:

IltmmMediaInfo::get_VideoBitCount

IltmmMediaInfo::get_VideoBitRate

IltmmMediaInfo::get_VideoCompression

IltmmMediaInfo::get_VideoFrameRate

IltmmMediaInfo::get_VideoFrames

IltmmMediaInfo::get_VideoHeight

IltmmMediaInfo::get_VideoWidth

If the current stream is an audio stream , the following functions can be used to obtain audio information:

IltmmMediaInfo::get_AudioAvgBytesPerSec

IltmmMediaInfo::get_AudioBitsPerSample

IltmmMediaInfo::get_AudioChannels

IltmmMediaInfo::get_AudioFormatTag

IltmmMediaInfo::get_AudioSamplesPerSec

When the programmer has obtained all the necessary information for the current source media file, IltmmMediaInfo::ResetSource should be called to dissociate the media file from the ltmmMediaInfo object.

Help Version 20.0.2019.9.19
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Multimedia C API Help