471,122 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,122 software developers and data experts.

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 "PrepareToEncode" (Number Error: 0XC00D2F0C),
entire code is given below:
'====================================

Imports WMEncoderLib
Public Class Form1
' Declare variables.
Dim WithEvents Encoder As WMEncoder
Dim SrcGrpColl As IWMEncSourceGroupCollection
Dim SrcGrp As IWMEncSourceGroup2
Dim SrcAud As IWMEncAudioSource
Dim SrcVid As IWMEncVideoSource
Dim ProColl As IWMEncProfileCollection
Dim Pro As IWMEncProfile
Dim PushDist As IWMEncPushDistribution
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_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 = "admin"
varPassword = "statesecret"
lngFlags = 2
'MsgBox("Credenciais")
End Function

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
' Generate the announcement file.
PushDist.GenerateMulticastInfoFile(MyNSCFile)
PushDist.GenerateAnnouncementFile(MyNSCURL, MyASXFile)

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

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) 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.SourceGroupCollection
SrcGrp = SrcGrpColl.Add("SG_1")
SrcAud = SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_AUDIO)
SrcVid = SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO)

SrcAud.SetInput("device://default_audio_device")
SrcVid.SetInput("device://default_video_device")

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

' Set up the push broadcast.
PushDist = Encoder.Broadcast

' 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.AutoRemovePublishingPoint = True

' Set the push distribution variables.
PushDist.ServerName = strServerName
PushDist.PublishingPoint = strPubPoint
PushDist.Template = strPubTemplate
Encoder.PrepareToEncode(True)
End Sub
End Class
'====================================

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

Oct 4 '06 #1
0 2688

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Michele | last post: by
3 posts views Thread by Paul Home | last post: by
5 posts views Thread by Vilmar Brazo de Oliveira | last post: by
reply views Thread by rockstar1971 | last post: by
14 posts views Thread by Nick K. | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.