VideoCapture open starts many threads
Hy,
I've noticed that when opening a video file using the VideoCapture class (in C++), about eight new threads are created. As I need 7 video files simultaneously this results in about 50 threads running. I was wondering why this happens and what the threads do (because I can't find anything about this online).
Thanks
os ? opencv version ?
I'm sorry, ubuntu 14.04 and opencv 2.4.11
Could you add your CMAKE configuration? I am interested in what build options you have used (might give a clue to where to look for the solution)
Maybe I don't undestand your question but I think this is expected. On my win7, VideoCapture from cam opens 5 threads. In opencv many operations are in parallel. If you use cv::cvtColor you will see 4 threads more. In addiction the codec could have internal threads.
Yes, I understand that it is to make the decoding process faster. But decoding one video creates many threads. I can imagine quite a few use cases where you do not want to use your entire computational power to decode the video. It just seemed a little bit strange to have this as a default behaviour.
@genzm you should be able to force your application only to use a single thread. If you built with OpenMP for example you can do it like this. Exactly the reason why I am asking your CMAKE output.