VideoCapure::open(const String & filename) blocked 30s, Camera not running /On multi-thread, open() do like single-thread
Hello.
I’ve making multi-threading program for multi-viewer of cameras. On thread, to connect and get frame and show on MFC windows.
function of I've use : VideoCapture::open, VideoCapture::read(), and show function using windows c++ api.
I have 2 questions. Additionally i was use OpenCV v3.4.4.
When it camera was down, open(url) function return not immediately. After about 30 seconds, it was return. How can i set this open function running as non-blocked?(like as when it camera not working return -1 immediately)
I've made multi-threads for multi-viewers on one Process. So, multi thread try to connect at the same time to use VideoCapture::open(url) fucntion. Then return from open() was not seems like independent each threads.
- 1st thread open() takes 3sec,
- 2nd thread open() takes 6sec,
- ...
- #n th thread open() takes 3*n sec
- i’ve check these time as :
time1 = currenttimecheck();
open("rtsp://ip:port/name");
diff = currenttimechekc() - time1;
> this "diff" was not similar each threads
I think open() function taken time have to similar each thread, but the result was not. Like as when 1st camera connection was finish, 2nd connection was start......... do until last connection.
Please help.
why exactly ? it does not sound, like you're doing any computer-vision at all.
why, exactly ? which kind of bottleneck are you trying to mend with that ?
1- it means I’m using v3.4.4 OpenCV library. 2- bottleneck is open() of VideoCaptur class