Error in recording video using two logitech webcam simultaneously

I was able to record video using two webcam simultaneously. But now using same code I am getting error. It is saying that my device is in use but actually it is not. The error is:
Error using videoinput (line 391)
winvideo: The device associated with device ID 2 is already in use. A new videoinput object cannot be created for this device while it is in use.
Error in recording_video1 (line 5)
vid2 = videoinput('winvideo',2, 'YUY2_320x240');

回答 (1 件)

Image Analyst
Image Analyst 2015 年 1 月 17 日

0 投票

Try
vid2 = videoinput('winvideo',1, 'YUY2_320x240');
or
vid2 = videoinput('winvideo',3, 'YUY2_320x240');
or whatever number your second camera is.

3 件のコメント

rohan gupta
rohan gupta 2015 年 1 月 17 日
編集済み: rohan gupta 2015 年 1 月 21 日
I am using two logitech C170 webcam. For the first webcam it is
vid1 = videoinput('winvideo',1, 'YUY2_320x240');
and for the second camera it is
vid2 = videoinput('winvideo',2, 'YUY2_320x240');
when I use these webcam individually, each of them run properly. But when I try to use them simultaneously which is my requirement, I get the error as mentioned
Error using videoinput (line 391)
winvideo: The device associated with device ID 2 is already in use. A new videoinput object cannot be created for this device while it is in use.
Error in recording_video1 (line 5)
vid2 = videoinput('winvideo',2, 'YUY2_320x240');
*Can you help me with this
soyoung shin
soyoung shin 2017 年 11 月 6 日
same situation here. Did you fix the problem? I also connect two logitech cameras on my labtop and got same error..
Liew Tian Chin
Liew Tian Chin 2018 年 4 月 2 日
Any solution to this problem?

サインインしてコメントする。

質問済み:

2015 年 1 月 15 日

コメント済み:

2018 年 4 月 2 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by