Hello. I am trying to use two webcams in my app. I use two ofVideoGrabber, on the update method, updates both grabbers, but when draws, it flickers, shows some frames from webcam1 and some frames from webcam2.
If i use one videoGrabber, works just fine, I see that webcam.
I would like to draw both webcams. Any idea for solving this issue?
I am using Raspberry pi 4 and of 0.11.0
void ofApp::setup(){
camWidth = 320; // try to grab at this size.
camHeight = 240;
vidGrabber.setDeviceID(2);
vidGrabber.setDesiredFrameRate(60);
vidGrabber.setUseTexture(true);
vidGrabber.initGrabber(camWidth, camHeight);
vidGrabber2.setDeviceID(0);
vidGrabber2.setDesiredFrameRate(60);
vidGrabber2.setUseTexture(true);
vidGrabber2.initGrabber(camWidth, camHeight);
ofSetVerticalSync(true);
}
//--------------------------------------------------------------
void ofApp::update(){
ofBackground(100, 100, 100);
vidGrabber.update();
vidGrabber2.update();
}
//--------------------------------------------------------------
void ofApp::draw(){
ofSetHexColor(0xffffff);
vidGrabber.draw(20, 20);
vidGrabber2.draw(20, 40+camHeight);
}