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 ltmmMediaInfo object.
An ltmmMediaInfo object must be created externally. To set the media file for which the ltmmMediaInfo object will obtain data, set the ltmmMediaInfo.SourceFile property. The ltmmMediaInfo.SourceFile property must be set before retrieving information from other ltmmMediaInfo properties in order for a media file to be associated with the object. Once a media file is associated with an ltmmMediaInfo object, information about the file and the media within that file can be found in several properties. General information about the title The name for a group of related video files (called "Chapters") on your DVD. For example, for a DVD called "My Summer Vacation," you might have the titles "Water Skiing," "New Friends," and "Hiking." For each of those titles, you might have one or more different video files., the author of the media, the rating of the media in the file, a description, etc. can be found in the following properties:
ltmmMediaInfo,Copyright property
ltmmMediaInfo,Description property
In addition, information about the format of the source media file, the media type contained in the file, filters, etc. can be found in the following properties:
ltmmMediaInfo.SourceFilter property
ltmmMediaInfo.SourceFilterClassID property
ltmmMediaInfo.SourceFilterDispatch property
ltmmMediaInfo.SourceFormat property
ltmmMediaInfo.SourceFormatName property
ltmmMediaInfo.SourceMediaType property
A source media file may contain one or more streams of data. To determine the number of available streams, read the ltmmMediaInfoOutputStreams property. 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 setting the ltmmMediaInfo.CurrentStream property. Once the current stream is set, information on the stream type, type name, media type, duration, filter, etc. can be obtained using the following properties:
ltmmMediaInfo.StreamDuration property
ltmmMediaInfo.StreamMediaType property
ltmmMediaInfo.StreamSubtype property
ltmmMediaInfo.StreamSubtypeName property
ltmmMediaInfo.StreamType property
ltmmMediaInfo.StreamTypeName property
If the current stream is a video stream The portion of the file holding the video data. The video data might be compressed to save disk space. The data has to be decompressed using a video decompressor Also known as a decoder, this is a module or algorithm to decompress data. before you can play (see) it., the following properties can be used to obtain video information:
ltmmMediaInfo.VideoBitCount property
ltmmMediaInfo.VideoBitRate property
ltmmMediaInfo.VideoCompression property
ltmmMediaInfo.VideoFrameRate property
ltmmMediaInfo.VideoFrames property
ltmmMediaInfo.VideoHeight property
ltmmMediaInfo.VideoWidth property
If the current stream is an audio stream The portion of the file holding the audio data. The audio data might be compressed to save disk space. The data has to be decompressed using an audio decompressor before you can play (hear) it., the following properties can be used to obtain audio information:
ltmmMediaInfo.AudioAvgBytesPerSec property
ltmmMediaInfo.AudioBitsPerSample property
ltmmMediaInfo.AudioChannels property
ltmmMediaInfo.AudioFormatTag property
ltmmMediaInfo.AudioSamplesPerSec property
When the programmer has obtained all the necessary information for the current source media file, ltmmMediaInfo.ResetSource should be called to dissociate the media file from the ltmmMediaInfo object.