Expression Encoder 4 SDK throws DCOM error during streaming

I am trying to transfer audio and video live from my computer to a publishing point on a hosted service. I wrote all the code that I think should have (for now, he's just testing the code in a small console application). The code itself does not produce errors, it works fine, the video is extracted from my webcam, however, when I try to send a stream to the publication point, I get a DCOM error in the system event logs "DCOM could not contact streamwebtown.com using any of the configured protocols " I tried to do the same using the actual Expression Encoder 4 client application that comes with the SDK, and the video / audio channel works fine with the same publishing point. I searched the Internet around the world to see if someone else ran into this problem but came up empty. Ask the community if they have any ideas?

Code from the application:

static void Main(string[] args) { EncoderDevice video = EncoderDevices.FindDevices(EncoderDeviceType.Video).Count > 0 ? EncoderDevices.FindDevices(EncoderDeviceType.Video)[0] : null; EncoderDevice audio = EncoderDevices.FindDevices(EncoderDeviceType.Audio).Count > 0 ? EncoderDevices.FindDevices(EncoderDeviceType.Audio)[0] : null; LiveJob job = new LiveJob(); if (video != null && audio != null) { LiveDeviceSource source = job.AddDeviceSource(video, audio); job.ActivateSource(source); PushBroadcastPublishFormat publishingPoint = new PushBroadcastPublishFormat(); publishingPoint.PublishingPoint = new Uri("http://streamwebtown.com/abc"); publishingPoint.UserName = "user"; publishingPoint.Password = PullPW("Stream"); job.ApplyPreset(LivePresets.VC1Broadband16x9); job.PublishFormats.Add(publishingPoint); job.StartEncoding(); Console.ReadKey(); job.StopEncoding(); } } private static SecureString PullPW(string pw) { SecureString s = new SecureString(); foreach (char c in pw) s.AppendChar(c); return s; } 
+8
c # expression-encoder-sdk
source share
1 answer

I found the answer, it did not authenticate to the server at all. So I changed my code to the next one and it suddenly worked fine.

 static void Main(string[] args) { 
EncoderDevice video = EncoderDevices.FindDevices(EncoderDeviceType.Video).Count > 0 ? EncoderDevices.FindDevices(EncoderDeviceType.Video)[0] : null; EncoderDevice audio = EncoderDevices.FindDevices(EncoderDeviceType.Audio).Count > 0 ? EncoderDevices.FindDevices(EncoderDeviceType.Audio)[0] : null; LiveJob job = new LiveJob(); job.AcquireCredentials += new EventHandler(job_AcquireCredentials); if (video != null && audio != null) { LiveDeviceSource source = job.AddDeviceSource(video, audio); job.ActivateSource(source); PushBroadcastPublishFormat publishingPoint = new PushBroadcastPublishFormat(); publishingPoint.PublishingPoint = new Uri("http://streamwebtown.com/abc");
  WindowsMediaOutputFormat wmof = new WindowsMediaOutputFormat(); VideoProfile vProfile = new AdvancedVC1VideoProfile(); AudioProfile aProfile = new WmaAudioProfile(); wmof.VideoProfile = vProfile; wmof.AudioProfile = aProfile; job.ApplyPreset(LivePresets.VC1Broadband16x9); job.PublishFormats.Add(publishingPoint); job.OutputFormat = wmof; job.PreConnectPublishingPoint(); job.StartEncoding(); //After finished encoding dispose of all objects. Console.ReadKey(); job.StopEncoding(); job.Dispose(); video.Dispose(); audio.Dispose(); source.Dispose(); } } static void job_AcquireCredentials(object sender, AcquireCredentialsEventArgs e) { e.UserName = "user"; e.Password = PullPW("Stream"); e.Modes = AcquireCredentialModes.None; } private static SecureString PullPW(string pw) { SecureString s = new SecureString(); foreach (char c in pw) s.AppendChar(c); return s; } 

code>
+4
source share

All Articles