FPS issue for video recording using OpenCV 2 [CvbPython]

Thanks, @rtp_derahs and hi again, @aftab

I fear there is not much insight I can add to that. As far as “Movie2 for Linux” is concerned I am very sorry, but that won’t happen anytime soon. Movie2 is built on top of the DirectShow infrastructure of Windows which simply isn’t available on Linux. So it would basically have to be a rewrite based e. g. on something like Video4Linux and I fear that there isn’t a strong business case for that (not much demand as far as I can tell).

As for your performance questions: Much of it has been answered, I guess. However I am not fully on board with the hard disc limitation diagnosis. If you do the math, you are effectively trying to record something like 200 MB/s, which I agree is hard to stomach for a magnetic disc. But you wrote that when writing the data to a sequence of uncompressed *.bmp files then it works - but your disc fills up far too quick, which to me sounds like your harddisc speed is not your problem.

Judging by your FourCC code you are doing DivX encoding. DivX is an excellent codec, but for encoding it is also a very power-hungry one. Some 7 or 8 years back I did a project where we had a dual-HD (3840x1080) RGB stream to encode, 400 MB/s and a big fat Xeon CPU was barely keeping up with that - with all cores close to 100% simultaneously. Not sure how much parallelization support the codec used with OpenCV offers, but to me it sounds like this is your limiting factor.

If that is the case then your best bet would probably be to use something else for encoding. If you can live with consecutively saved images with at least some degree of compression, then try TIFF (it did perform suprisingly well on the tests I did for https://forum.commonvisionblox.com/t/different-performance-when-saving-different-formats/252/4 - but of course its compression i nowhere near what DivX could do for you…

3 Likes