i have a problem with capture frames from 2 different cameras in the same time. I know that is probably impossible (or it's quite difficult) to connect in this way 2 USB cams, but connecting one USB cam and one IPcam maybe is easier. Of course if they works separatly i don't have problems. For example this code doesn't work:
int main() {
const std::string videoStreamAddress = "http://........../img/video.mjpeg"; cv::VideoCapture camera0(0); cv::VideoCapture camera1(1); camera0.open(videoStreamAddress); cv::Mat3b frame0; cv::Mat3b frame1; while (true) { camera0 >> frame0; camera1 >> frame1; cv::imshow("Video0", frame0); cv::imshow("Video1", frame1); int c = cvWaitKey(40); if (27 == char(c)) break; }
return 0; }
I hope that anybody can help me