I am trying to build a simple test example that uses my webcam and outputs to a WIndowsFormHost. This is actually taken from the sample code but I am not sure why it’s not working. My webcam’s LED is lit up so I guess that means my webcam isn’t the problem.
Can anyone help me out with this? This is my sample code.
private void Window_Loaded(object sender, RoutedEventArgs e)
{
job = new LiveJob();
deviceSource = job.AddDeviceSource(videoDevs.Count > 0 ? videoDevs[1] : null, audioDevs.Count > 0 ? audioDevs[0] : null);
job.ActivateSource(deviceSource);
job.ApplyPreset(LivePresets.VC1HighSpeedBroadband16x9);
job.StartEncoding();
job.OutputPreviewWindow = new PreviewWindow(new HandleRef(displayPanel, displayPanel.Handle));
//Console.Read();
//job.StopEncoding();
}
Also, I get this weird error that says HREF COMException when I try to put job.StartEncoding() in a button. Anyone can tell me what this error means?

I found the solutions to my question.
This will work without a problem.
The second question which was a constant error of COMEXCEPTION. The method to solve it is via
I forgot to stop the encoding process before disposing it, causing a exception.