Last active
May 4, 2019 14:53
-
-
Save madc/6242291 to your computer and use it in GitHub Desktop.
Find cam by device name instead of id. (openFrameworks)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string deviceName = "Logitech Camera"; | |
vector<ofVideoDevice> devices = vidGrabber.listDevices(); | |
for(vector<ofVideoDevice>::iterator it = devices.begin(); it != devices.end(); ++it) { | |
if(it->deviceName == deviceName) { | |
vidGrabber.setDeviceID(it->id); | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment