You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to build and installed on my laptop. And it seems that the listed camera isn't match the real devices, or at least the index which opencv uses. Below is the output:
Before inserting the USB camera:
❯ python .\test.py
OpenCV version: 4.5.5
0: HP HD Camera [(640, 480), (320, 180), (320, 240), (424, 240), (640, 360), (640, 480), (320, 180), (320, 240), (424, 240), (640, 360), (848, 480), (960, 540), (1280, 720)]
Select a camera (0 to 0): 0
Default width: 640.0, height: 480.0
[ WARN:0@16.323] global D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (539) `anonymous-namespace'::SourceReaderCB::~SourceReaderCB terminating async callback
After inserting the USB camera:
❯ python .\test.py
OpenCV version: 4.5.5
0: USB Camera [(1280, 720), (800, 600), (640, 480), (352, 288), (320, 240), (176, 144), (160, 120), (1280, 720), (800, 600), (640, 480), (352, 288), (320, 240), (176, 144), (160, 120), (1280, 720), (800, 600), (640, 480), (352, 288), (320, 240), (176, 144), (160, 120), (1280, 720), (800, 600), (640, 480), (352, 288), (320, 240), (176, 144), (160, 120)]
1: HP HD Camera [(640, 480), (320, 180), (320, 240), (424, 240), (640, 360), (640, 480), (320, 180), (320, 240), (424, 240), (640, 360), (848, 480), (960, 540), (1280, 720)]
Select a camera (0 to 1): 0
Default width: 640.0, height: 480.0
[ WARN:0@25.521] global D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (539) `anonymous-namespace'::SourceReaderCB::~SourceReaderCB terminating async callback
the test.py is the sample code in the repo README file.
After inserting the USB Camera, it seems the second webcam took the "0" index, and the integrated one became "1". But actually, the programs calls the integrated cam(i.e. HP HD Camera) when I input "0", and calls USB Camera when i input "1".
python version is 3.10.4, windows-capture-device-list is 1.1.0 and OS is windows 10.
Is there any idea how I can fix it?
The text was updated successfully, but these errors were encountered:
@Sleepy-11 I've never tested the API on a laptop. Probably the built-in camera always takes the 0 position. If you have two USB cameras, you can check whether USB cameras are listed in order. If you only have one USB camera, you can just reverse their order. Note: the index is determined by the camera list returned by DirectShow API. It may not be 100% equal to the index used by OpenCV.
@yushulx Thanks for the reply.
From my laptop view, the built-in camera could be placed on index "1" after the USB camera is inserted. And the DirectShow and OpenCV use different webcam sequence. :(
I tried to build and installed on my laptop. And it seems that the listed camera isn't match the real devices, or at least the index which opencv uses. Below is the output:
the test.py is the sample code in the repo README file.
After inserting the USB Camera, it seems the second webcam took the "0" index, and the integrated one became "1". But actually, the programs calls the integrated cam(i.e. HP HD Camera) when I input "0", and calls USB Camera when i input "1".
python version is 3.10.4, windows-capture-device-list is 1.1.0 and OS is windows 10.
Is there any idea how I can fix it?
The text was updated successfully, but these errors were encountered: