Windows Media Encoder SDK (push server error)

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

    Windows Media Encoder SDK (push server error)

    Hi, friends!

    I am develop a simple encoder app, one form with one button that start
    the encoder.

    This is my code:

    =============== =============== =============== =============== =

    Option Explicit On

    Class frm_main

    Dim WithEvents Encoder As WMEncoderLib.WM Encoder

    Private Sub frm_main_Load(B yVal sender As System.Object, ByVal e As
    System.EventArg s) Handles MyBase.Load
    Encoder = New WMEncoderLib.WM Encoder
    End Sub


    Private Function OnAcquireCreden tials(ByVal 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 = "admn"
    varPassword = "statesecre t"
    lngFlags = "2"
    'MsgBox("Creden ciais")
    End Function



    Private Sub Enc_Main()
    ' Create a WMEncoder object.
    'Dim Encoder As WMEncoder
    'Encoder = New WMEncoder

    ' Configure the encoding session including the input sources
    and profile.

    ' Create a push distribution object.
    Dim PushDist As WMEncoderLib.IW MEncPushDistrib ution
    PushDist = Encoder.Broadca st

    ' Declare variables.
    Dim sServerName As String
    Dim sPubPoint As String
    Dim sPubTemplate As String
    Dim sMyNSCFile As String
    Dim sMyNSCURL As String
    Dim sMyASXFile As String
    Dim sBrdcstInfo As String

    ' Provide values for the following variables.
    sServerName = "media.site.com .br:8080"
    sPubPoint = "online"
    sPubTemplate = "webradio"
    sMyNSCFile = ""
    sMyNSCURL = ""
    sMyASXFile = ""
    sBrdcstInfo = ""

    ' Specify the server name, publishing point, an existing
    publishing point,
    ' and then generate an NSC file and announcement file.
    PushDist.Server Name = sServerName
    PushDist.Publis hingPoint = sPubPoint
    PushDist.Templa te = sPubTemplate

    ' Specify whether to destroy the publishing point.
    PushDist.AutoRe movePublishingP oint = True

    ' Initialize the encoding session.
    Encoder.Prepare ToEncode(True)

    ' Generate the announcement file.
    PushDist.Genera teMulticastInfo File(sMyNSCFile )
    PushDist.Genera teAnnouncementF ile(sMyNSCURL, sMyASXFile)

    ' Start encoding.
    Encoder.Start()
    btn_start.Text = "Conect"
    MsgBox("Click OK to stop broadcasting.")
    btn_start.Enabl ed = True
    btn_start.Text = "Press to Connect"

    Encoder.Stop()
    End Sub



    Private Sub btn_start_Click (ByVal sender As System.Object, ByVal e
    As System.EventArg s) Handles btn_start.Click
    btn_start.Text = "Processing ..... "
    btn_start.Enabl ed = False

    '----------------------------

    Enc_Main()

    '------------------------------

    End Sub
    End Class

    =============== =============== =============== =============== =

    I don“t know why the instruction "Encoder.Prepar eToEncode(True) "
    faults. Where do I make a mistake?

    Thanx

    Crisco

Working...