'Declare object of class MediaManagerPro
Dim oMediaManagerPro As New MediaManagerPro()
'Get the rooth path
Dim strRootPath As String = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath)
'set the directory path info for ffmpeg and flvtoo files
oMediaManagerPro.FLVTool_Path = HttpContext.Current.Server.MapPath("~\flvtool\flvtool2.exe")
oMediaManagerPro.FFMPEG_Path = HttpContext.Current.Server.MapPath("~\ffmpeg\ffmpeg.exe")
'Set source file info
oMediaManagerPro.SourceFile_Path = strRootPath & "\contents\Source"
oMediaManagerPro.SourceFile_Name = "GuitarPlayer.mpg"
'set output file info
oMediaManagerPro.OutputFile_Path = strRootPath & "\contents\flv"
oMediaManagerPro.OutputFile_Name = "GuitarPlayer.flv"
'set outpu to buffering for flv videos
Dim output As String = oMediaManagerPro.Set_Buffering()
'set meta information for flv file
oMediaManagerPro.Video_Bitrate = 300
oMediaManagerPro.Audio_Bitrate = 64
oMediaManagerPro.Audio_SamplingRate = 22050
Dim oMediaInfo As MediaInfo = oMediaManagerPro.ConvertTo_FLV()
' retrieve video informatioin
If oMediaInfo.Error_Code > 0 Then
HttpContext.Current.Response.Write((":: Video processing failed ::<br/>Error code: " & oMediaInfo.Error_Code & "<br />Error Message: ") + oMediaInfo.Error_Message)
Exit Sub
End If