网络摄像头,出现“视频源”对话框 [英] webcam, Video Source dialog comes up

查看:272
本文介绍了网络摄像头,出现“视频源”对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,已经看到无数人遇到相同的问题,但没有答案。我的SendMessage在带有一台摄像机的Windows 7笔记本电脑上弹出视频源对话框。我安装了Cyber​​ Link YouCam。

So have seen a ton of people with the same issue's but no answers. My SendMessage pop's up the "Video Source" dialog box on a windows 7 laptop with one camera. I have Cyber Link YouCam installed.

如果我卸载Cyber​​Link YouCam,视频源对话框将消失。似乎操作系统正在运行,好像YouCam是同一设备的第二个驱动程序。我的问题是如何停止显示视频源对话框?在对话框中选择一个选项后,我不会得到对话框(直到重新启动应用程序),因此必须在某处进行设置。

If I uninstall Cyber Link YouCam the "Video Source" dialog goes away. It appears to be the OS is acting as though YouCam is a second driver for the same device. My question is how do I stop the dialog box for "Video Source" from appearing? Once I choose an option in the dialog I don't get the dialog box (until I restart the application) so there must be a setting somewhere being set.

尽管调试发现这部分代码(请参阅下面的整个部分)似乎是调用对话框的代码-SendMessage(deviceHandle,WM_CAP_CONNECT,deviceno ,(((IntPtr)0).ToInt32())

Though debugging found this bit of code (see whole section below) is the one that seems to be the one that calls the dialog box - SendMessage (deviceHandle, WM_CAP_CONNECT, deviceno, ((IntPtr) 0).ToInt32 ())

 public void StartWebCam (int height, int width, int handleofthepicturebox, int deviceno)
        {

        string deviceIndex = "" + deviceno;

        deviceHandle = capCreateCaptureWindowA (ref deviceIndex, WS_VISIBLE | WS_CHILD, 0, 0, width, height, handleofthepicturebox, 0);


        if (SendMessage (deviceHandle, WM_CAP_CONNECT, deviceno, ((IntPtr) 0).ToInt32 ()) > 0)
            {


            SendMessage (deviceHandle, WM_CAP_SET_SCALE, -1, 0);
            SendMessage (deviceHandle, WM_CAP_SET_PREVIEWRATE, 0x42, 0);
            SendMessage (deviceHandle, WM_CAP_SET_PREVIEW, -1, 0);

            }
        else
            {
            // nothing failed maybe some clean up needed
            }

        }

同样,问题是-如何阻止视频源对话框出现?

So again the question is - how do I stop the dialog box for "Video Source" from appearing?

推荐答案

我开发了一种表单,用于在Windows XP上使用avicap32显示两个实时捕获。我在我的情况下发现的修复程序也可能适用于您的情况。

I developed a form to display two live captures with avicap32 on Windows XP. There is a chance the fix I found in my case also applies to yours.

对于avicap来说,可以以编程方式管理您的网络摄像头,这一切基于注册表。这是线程我发现可以指导我并实现我想要的目标。

In the case of avicap, it is possible to programmatically manage your webcams, and all that is registry-based. Here is the thread I found to guide me and achieve what I wanted.

在此线程中, HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\的作用\Control\MediaResources\msvideo\MSVideo.VFWWDM\DevicePath 注册表项会突出显示,用于选择活动的网络摄像头。

In this thread, the role of the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\MediaResources\msvideo\MSVideo.VFWWDM\DevicePath registry key is highlighted for the selection of the active webcam.

这也许是一条有用的信息:我必须将其值设置为小写,以避免弹出视频源对话框。

And here is maybe a helpful piece of info: I had to set the value in lowercase to avoid the Video Source dialog popping up.

我是通过监视注册表项来确定的在使用 WM_CAP_CONNECT 调用 SendMessage 之前和之后。

I determined it by monitoring the registry key before and after the call to SendMessage with WM_CAP_CONNECT.

据我所知(和谷歌搜索),没有人提供修复程序,因此即使我可能回答得有点晚,也可以告诉我们它是否也对您有用。

To the best of my knowledge (and googling), nobody else has offered a fix, so even though I might be answering a little late, it would be great if you could tell us whether it worked for you as well.

这篇关于网络摄像头,出现“视频源”对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆