LukasBommes / mv-extractor

Extract frames and motion vectors from H.264 and MPEG-4 encoded video.
MIT License
279 stars 56 forks source link

Limit the maximal number of threads #32

Open luowyang opened 1 year ago

luowyang commented 1 year ago

VideoCap::open() sets the number of threads to whatever is returned by std::thread::hardware_concurrency() in this line. However, on machines with many cores the number of threads will exceed the maximum recommended by FFmpeg (which is 16 as defined here). This may degrade performance, and FFmpeg will issue an annoying warning says "Using a thread count greater than 16 is not recommended". It may be wiser to follow the recommendation and limit the number of threads to no larger than 16.