8

I'm attempting to stream audio and video live from my PC to a publishingpoint on a hosted service. I've written all the code that I think it should have (At the moment it's just test code in a small Console app). The code itself does not throw an error, it runs just fine, video is pulled from my webcam, however when trying to send the stream to the publishingpoint I get a DCOM error in the System Event logs "DCOM was unable to communicate with the computer streamwebtown.com using any of the configured protocols." I tried to do the same thing using the actual Expression Encoder 4 client application that comes with the SDK and the video/audio feed works just fine to the same publishingpoint. I've searched the internet far and wide to see if someone else has run into this problem but have come up empty. Asking the community if they have any ideas?

Code from 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;
}
  • This can be likely caused by firewalls in the middle. For testing: First try and run the app as administrator. Then run the app with windows firewall turned off, lastly: run the app without any firewall (or the least amount of-) in the network. – Polity Nov 09 '11 at 05:44
  • Thanks for your reply, that was my first assumption as well so I shut down the firewall completely on my side without success. –  Nov 09 '11 at 17:26

1 Answers1

4

I have found the answer, it was not authenticating against the server at all. So changed my code to the following and it suddenly worked just 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;
    }

  • 2
    I guess you realize you can't add a bounty to yourself... +15 to recover rep in goodwill – makerofthings7 Nov 11 '11 at 18:42
  • 1
    Yeah, I knew that going into it. It's just rep on a web-site, not as important as it could be :) Thanks for the +1 though :) –  Nov 14 '11 at 20:09