PrepareToEncode Encoder SDK (push server) failed???

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Crisco www.misericordia.com.br

    #1

    PrepareToEncode Encoder SDK (push server) failed???

    Hi

    I m working on WEBRADIO Software. im using Windows media encoder 9 SDK
    on Windows 2003 server using VB.NET.


    My current scenario is my soundcard . My application will push my
    server the live audio on specific port.

    I am using Windows media encoder sdk sample (entire code), currently i
    am facing problem in "PrepareToEncod e" (Number Error: 0XC00D2F0C),
    entire code is given below:
    '============== =============== =======

    Imports WMEncoderLib
    Public Class Form1
    ' Declare variables.
    Dim WithEvents Encoder As WMEncoder
    Dim SrcGrpColl As IWMEncSourceGro upCollection
    Dim SrcGrp As IWMEncSourceGro up2
    Dim SrcAud As IWMEncAudioSour ce
    Dim SrcVid As IWMEncVideoSour ce
    Dim ProColl As IWMEncProfileCo llection
    Dim Pro As IWMEncProfile
    Dim PushDist As IWMEncPushDistr ibution
    Dim strServerName As String
    Dim strPubPoint As String
    Dim strPubTemplate As String
    Dim MyNSCFile As String
    Dim MyNSCURL As String
    Dim MyASXFile As String
    Private Function Encoder_OnAcqui reCredentials(B yVal strRealm As
    String, ByVal strSite As String, ByVal varUser As Object, ByVal
    varPassword As Object, ByVal lngFlags As Long) As Boolean
    'strRealm = ""
    'strSite = "media.site.com .br"
    varUser = "admin"
    varPassword = "statesecre t"
    lngFlags = 2
    'MsgBox("Creden ciais")
    End Function

    Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
    System.EventArg s) Handles Button1.Click
    ' Generate the announcement file.
    PushDist.Genera teMulticastInfo File(MyNSCFile)
    PushDist.Genera teAnnouncementF ile(MyNSCURL, MyASXFile)

    ' Start encoding.
    Encoder.Start()
    MsgBox("Click OK to stop broadcasting.")
    Encoder.Stop()
    End Sub

    Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
    System.EventArg s) Handles MyBase.Load
    ' Create a WMEncoder object.
    Encoder = New WMEncoder

    ' Retrieve the source group collection and add sources.
    ' Use the default devices for the audio and video sources.
    SrcGrpColl = Encoder.SourceG roupCollection
    SrcGrp = SrcGrpColl.Add( "SG_1")
    SrcAud = SrcGrp.AddSourc e(WMENC_SOURCE_ TYPE.WMENC_AUDI O)
    SrcVid = SrcGrp.AddSourc e(WMENC_SOURCE_ TYPE.WMENC_VIDE O)

    SrcAud.SetInput ("device://default_audio_d evice")
    SrcVid.SetInput ("device://default_video_d evice")

    ' Retrieve the profile collection. This example uses the 3rd
    profile.
    ProColl = Encoder.Profile Collection
    Pro = ProColl.Item(2)
    SrcGrp.Profile = Pro

    ' Set up the push broadcast.
    PushDist = Encoder.Broadca st

    ' Specify the push distribution variables, including the
    Windows Media
    ' server name, publishing point, and announcement files.
    ' Provide real values for the following placeholders.
    strServerName = "media.site.com .br"
    strPubPoint = "webradio"
    strPubTemplate = "tmp_online "
    MyNSCFile = ""
    MyNSCURL = ""
    MyASXFile = ""

    ' Remove the publishing point when the broadcast is over.
    PushDist.AutoRe movePublishingP oint = True

    ' Set the push distribution variables.
    PushDist.Server Name = strServerName
    PushDist.Publis hingPoint = strPubPoint
    PushDist.Templa te = strPubTemplate
    Encoder.Prepare ToEncode(True)
    End Sub
    End Class


    '============== =============== =======

    Could anybody please help me out.
    Any hints/ ideas will be highly appreciated.


    Thnx
    Crisco

Working...