Page 1 of 1

I can't get higher fps than 5

Posted: Sun Oct 05, 2014 4:27 pm
by flotschie
Hi,

I can't get more than 5 fps out of my PiCamera. I know it should be possible, e.g. with that command:

raspivid -w 640 -h 480 -fps 90 -t 10000 -o test90fps.h264

I use the Python OpenCv API, maybe that is the reason? Here is a bit of my Code:

Code: Select all

with picamera.PiCamera() as camera:
        stream = io.BytesIO()
       
        #camera settings
        camera.resolution = (50,50)         
        camera.iso = 200
        time.sleep(2)       
        camera.framerate = 30
        camera.exposure_mode = 'off'
   
        for foo in camera.capture_continuous(stream, format='jpeg', use_video_port=True):
            stream.truncate()
            stream.seek(0)
            img = process(stream)
What am I doing wrong?

Re: I can't get higher fps than 5

Posted: Mon Oct 06, 2014 7:01 am
by jamesh
Are you saying the raspivid app does record at 90 but the Python library does not?

Re: I can't get higher fps than 5

Posted: Mon Oct 06, 2014 12:20 pm
by flotschie
Hi Jamesh,

in the meantime someone showed me that link here. Most of the things discussed there are way beyond my knowledge, but I think I figured out the following:

It seems that the OpenCV Library uses the raspistill command to "capture_continuos" single frames/images. raspistill is pretty slow and can not do more than 5 fps.

raspivid - which is way faster - is creating a video file where things are handled differently. It seems that is why it's not possbile to capture single frames with that method because the handling of the data is different.

And also it seems raspivid is not used in OpenCv, or at least not in that way that I can get many single frames per second.

I also found this link here. It seems it could solve my problem, I will have a look at it later.

In the meantime, any hints and suggestions, or explanations which can contribute to my understanding of this topic, are welcome :)