By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,184 Members | 1,596 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,184 IT Pros & Developers. It's quick & easy.

Windows Media Encoder SDK (push server error)

P: n/a
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.WMEncoder

Private Sub frm_main_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Encoder = New WMEncoderLib.WMEncoder
End Sub
Private Function OnAcquireCredentials(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 = "statesecret"
lngFlags = "2"
'MsgBox("Credenciais")
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.IWMEncPushDistribution
PushDist = Encoder.Broadcast

' 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.ServerName = sServerName
PushDist.PublishingPoint = sPubPoint
PushDist.Template = sPubTemplate

' Specify whether to destroy the publishing point.
PushDist.AutoRemovePublishingPoint = True

' Initialize the encoding session.
Encoder.PrepareToEncode(True)

' Generate the announcement file.
PushDist.GenerateMulticastInfoFile(sMyNSCFile)
PushDist.GenerateAnnouncementFile(sMyNSCURL, sMyASXFile)

' Start encoding.
Encoder.Start()
btn_start.Text = "Conect"
MsgBox("Click OK to stop broadcasting.")
btn_start.Enabled = 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.EventArgs) Handles btn_start.Click
btn_start.Text = "Processing ..... "
btn_start.Enabled = False

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

Enc_Main()

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

End Sub
End Class

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

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

Thanx

Crisco

Oct 2 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.