Movie Maker Timeline Control

GetMediaInfo Method

Description

Get the duration, media information of media file.

Syntax

Public Function GetMediaInfo( _
   ByVal strMediaFile as string, _
   ByVal iDuration as float, _
   ByVal iWidth as long, _
   ByVal iHeight as long, _
   ByVal iFrameRate as float, _
   ByVal iVideoBitRate as long, _
   ByVal iAudioBitRate as long, _
   ByVal iAudioSampleRate as long, _
   ByVal iAudioChannels as long, _
   ByVal iVideoStreamCount as long, _
   ByVal iAudioStreamCount as long, _
   ByVal strMediaContainer as string, _
   ByVal strVideoStreamFormat as string, _
   ByVal strAudioStreamFormat as string
)

 

Parameter

strMediaFile
   the path of video/audio file

iDuration
    return the duration of media file

iWidth
    return the width of media file

iHeight
    return the height of media file

iFrameRate
    return the frame rate of media file

iVideoBitRate
    return the video bitrate of media file

iAudioBitRate
    return the audio bitrate of media file

iAudioSampleRate
    return the audio sample rate of media file

iAudioChannels
    return the audio channel of media file

iVideoStreamCount
    return the video steam count of media file

strMediaContainer
    return the string of container name

strVideoStreamFormat
    return the string of video stream

strAudioStreamFormat
    return the string of audio stream

 

Return Value

iDuration
    return the duration of media file

iWidth
    return the width of media file

iHeight
    return the height of media file

iFrameRate
    return the frame rate of media file

iVideoBitRate
    return the video bitrate of media file

iAudioBitRate
    return the audio bitrate of media file

iAudioSampleRate
    return the audio sample rate of media file

iAudioChannels
    return the audio channel of media file

iVideoStreamCount
    return the video steam count of media file

strMediaContainer
    return the string of container name

strVideoStreamFormat
    return the string of video stream

strAudioStreamFormat
    return the string of audio stream



 

Example

Visual Basic Syntax
Dim iclipDuration As Single
Dim iWidth As Long
Dim iHeight As Long
Dim iFrameRate As Single
Dim strAudioStreamFormat As String
Dim iVideoBitrate As Long
Dim iAudioBitrate As Long
Dim iAudioSampleRate As Long
Dim iAudioChannel As Long
Dim iVideoStreamCount As Long
Dim iAudioStreamCount As Long
Dim strMediaContainer As String
Dim strVideoStreamFormat As String

TimelineControl1.GetMediaInfo "c:\yourfile.mpg", iclipDuration, iWidth, iHeight, iFrameRate, iVideoBitrate, iAudioBitrate, iAudioSampleRate, iAudioChannel, iVideoStreamCount, iAudioStreamCount, strMediaContainer, strVideoStreamFormat, strAudioStreamFormat