Ask Your Question
0

VideoCapture with CAP_DSHOW for camera path

asked 2017-11-02 05:24:25 -0600

pak23 gravatar image

Hello, I want to initialize VideoCapture class with arguments const String &filename, int apiPreference = CAP_DSHOW. I want to use camera device path (my camera: "\\?\usb#vid_041e&pid_4095&mi_00#6&26faed27&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global"). Is there any way to use VideoCapture with camera device path and apiPreference CAP_DSHOW? I have checked that CAP_DSHOW is correct apiPreference for my camera (it works when I create VideoCapture with index argument). I know that when I create VideoCapture I should use double "\\" for string. I have checked source files for OpenCV 3.3 and I don't see possibility to create VidecoCapture with filename argument and apiPreference = CAP_DSHOW. Anybody know how to do it? I'm using Windows 10 and Opencv 3.3.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-11-02 05:59:35 -0600

berak gravatar image

updated 2017-11-02 06:00:04 -0600

sad as it is, what you want is impossible. you cannot use your usb device id string, but have to use a number, 0,1,2,..

(even if you avoid opencv's VideoCapture, and write your own DShow graph, you'll have to use the "canonical" name, like "HD Webcam", not the usb device string)

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-11-02 05:22:15 -0600

Seen: 1,584 times

Last updated: Nov 02 '17