Uncategorized

Unexpected performance difference between picamera and picamera2..


I’ve just tried this, and here’s what I found. I edited both scripts to encode VGA images (they actually encode different, and very large, sizes currently, so aren’t comparable as they are). I also set the framerate to 15fps, and made both run for 60 seconds.

I found the software encoder version (capture_mjpeg.py) used 95% CPU and wrote a file of 1.8GB.

The hardware encoder version (capture_mjpeg_v4l2.py) used 50% CPU and wrote a file of 3.9GB.

So the software encoder version is clearly dropping loads of frames (over half, at a guess). As far as I can see, things are probably working as expected – much more of the work happens on the Arms now and not on the proprietary Broadcom core. When using the hardware encoder, CPU usage barely changes if you increase the resolution, though it does vary approximately in proportion to the framerate. Anyway, I think that gives us the approximate performance ballpark that we can expect.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *