我碰到了墙:/ ...我正试图从网络摄像头预览并拍摄快照(我仍然没有做到那么远......),我现在仍然坚持现场直播。 ..我不想使用一些不允许用于商业用途的未知库或库。无论如何现在我用MS Expression Encoder进行实验,但我无法添加源设备,什么时候应该执行LiveJob.AddDeviceSource应用程序被杀死而没有任何f ***!@ ^%#error;(...有我的代码:< / p>
private void startLivePreview()
{
try
{
// find audio devs
var a_Devices = EncoderDevices.FindDevices(EncoderDeviceType.Audio);
if (a_Devices.Count < 1)
{
throw new Exception("No avaiable audio devices. Sorry but there must be at least one...");
}
EncoderDevice a_Dev = a_Devices[1];
//camLiveSource = camLiveJob.AddDeviceSource(camDevice, null); // I do not need audio so null it...
camLiveSource = camLiveJob.AddDeviceSource(camDevice, a_Dev); // this line kills the app
camLiveSource.PickBestVideoFormat(new Size(640, 480), 15);
camLiveJob.OutputFormat.VideoProfile.Size = new Size(imgPrev.Size.Width, imgPrev.Size.Height);
SourceProperties sp = camLiveSource.SourcePropertiesSnapshot();
lblInfoPrev.Text = sp.Size.Width.ToString() + "x" + sp.Size.Height.ToString() + " @ " + sp.FrameRate.ToString("0.00") + "fps";
camLiveSource.PreviewWindow = new PreviewWindow(new HandleRef(imgPrev, imgPrev.Handle));
camLiveJob.ActivateSource(camLiveSource);
}
catch (Exception ee)
{
MessageBox.Show(ee.Message);
}
}
没什么特别的,就像在互联网上可以找到的所有例子一样......任何人都可以提供帮助吗?我认为MS libs可以正常工作,但是他们不会(甚至LiveSourceSample不起作用,应用程序在同一行被杀)...
我想使用一些东西来抓取可以在商业应用中使用的网络摄像头的图片。我根本不需要音频(如果我能通过&#34; null&#34;作为AddDeviceSource中的音频设备,我会很高兴))
这些是我系统上的A-V设备:
Video devices:
- [0] Name: >Screen Capture Source< *- this must been installed with MS Expression Encoder 4*
- [1] Name: >WebCam SC-03FFL11939N< *- built-in laptop camera*
Audio devices devices:
- [0] Name: >Microphone (Realtek High Definition Audio)<
- [1] Name: >Mix stereo (Realtek High Definition Audio)<
- [2] Name: >Speakers (Realtek High Definition Audio)<