I've found some of my old code that can be used as example:
https://gist.github.com/mmozeiko/a5adab1ad11ea6d0643ceb67bb8e3e19
If you run it without arguments it will enumerate available devices:
| C:\tets>test.exe
Detected 1 devices:
Integrated Webcam = \\?\usb#vid_0bda&pid_5686&mi_00#6&153a3df0&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
|
To capture to file you run with that long path:
| C:\tets>test.exe "\\?\usb#vid_0bda&pid_5686&mi_00#6&153a3df0&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global"
Size = 848x480
|
And output is written to image.jpg file.