简体   繁体   English

OpenCV:如何能够使用2个不同的应用程序从同一台摄像机捕获帧?

[英]OpenCV: how to be capable to capture frames from same camera with 2 different apps?

So I have 2 diffrent apps that use web-cameras (on Windows) I created tham bouth but I need them to be separate, stand alone apps. 因此,我有2个使用网络摄像头的不同应用程序(在Windows上),我创建了tham bouth,但我需要它们是单独的独立应用程序。 I want tham bouth to be capable to capture from same camera. 我希望Tham Bouth能够从同一台摄像机捕获。 What should I add to my capturing OpenCV code? 我应该在捕获的OpenCV代码中添加些什么?

Not sure, but i think the only way is to use COM (on windows) because you can't create two capture filters per one device. 不确定,但是我认为唯一的方法是使用COM(在Windows上),因为您不能在一个设备上创建两个捕获过滤器。 But you can create a splitter filter, put it in a DirectShow graph and share access to it through COM. 但是您可以创建一个拆分器过滤器,将其放入DirectShow图中,并通过COM共享对其的访问。 I don't know how to do it exactly, just an idea. 我不知道该怎么做,只是一个想法。

使用SplitCam

You can't. 你不能 Only one application can access any device at a time - even with common I/O devices like hard disks. 一次只能使用一个应用程序访问任何设备-即使使用硬盘等常见的I / O设备也可以。

If multiple applications could access a device simultaneously, it would be confused whose instructions to follow. 如果多个应用程序可以同时访问一个设备,那么将会令人困惑。

You can use SplitCam, though. 不过,您可以使用SplitCam。 It will connect to the webcam (and no other application can). 它将连接到网络摄像头(其他任何应用程序都无法连接)。 But it will create virtual devices that other applications can connect to. 但是它将创建其他应用程序可以连接的虚拟设备。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM