flotschie
Posts: 4
Joined: Sun Aug 24, 2014 10:36 pm

I can't get higher fps than 5

Sun Oct 05, 2014 4:27 pm

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?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26716
Joined: Sat Jul 30, 2011 7:41 pm

Re: I can't get higher fps than 5

Mon Oct 06, 2014 7:01 am

Are you saying the raspivid app does record at 90 but the Python library does not?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

flotschie
Posts: 4
Joined: Sun Aug 24, 2014 10:36 pm

Re: I can't get higher fps than 5

Mon Oct 06, 2014 12:20 pm

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 :)

Return to “Camera board”