mijoo94
Posts: 3
Joined: Thu Sep 16, 2021 1:45 pm

HQ camera low frame rate with 1080p resolution via v4l2 driver (3 fps)

Thu Sep 16, 2021 2:09 pm

Hi,

i am trying to make an application for the Raspi HQ Camera. The application should make a single shot and a video stream.

everything is fine except the very low frame rate when i use 1080p resolution. I already checked a topic for someone who had the same problem, but unfortunatly that couldn't help me. viewtopic.php?t=190220

The problem as far as i know is that V4l2 driver on raw capture mode is set on default max as 1280 x 720 for the video capture and any other resolution above than this resolution the driver will consider that as a single shot so the image processing will take another algo to preocess the image which leads to low preformance.

My question is how can i change the default mode on the v4l2 driver and set that to another value so i can get more frames?
i already tried this and it didn't work for me:

Code: Select all

sudo modprobe bcm2835-v4l2 max_video_width=1920 max_video_height=1080
i would like to stream a video with RGB24 pixel format something like that:

Code: Select all

v4l2-ctl -v width=1920,height=1080,pixelformat=RGB24
now when i stream using v4l2-ctl i get only 2.85 Fps

Code: Select all

v4l2-ctl --stream-mmap=3 --stream-to=/dev/null --stream-count=250
When i use pixelformat = h264 i get 30 fps but i really want to capture in raw format :(

Please help me <3 thnx!

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11831
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: HQ camera low frame rate with 1080p resolution via v4l2 driver (3 fps)

Thu Sep 16, 2021 2:19 pm

bcm2835-v4l2 is already loaded by default, so unless you've manually removed it with "sudo rmmod bcm2835-v4l2" then your modprobe line will be doing nothing.

It's probably easier to create a file of /etc/modprobe.d/bcm2835-v4l2.conf (you'll need sudo) containing

Code: Select all

options bcm2835-v4l2 max_video_width=1920
options bcm2835-v4l2 max_video_height=1080
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

mijoo94
Posts: 3
Joined: Thu Sep 16, 2021 1:45 pm

Re: HQ camera low frame rate with 1080p resolution via v4l2 driver (3 fps)

Thu Sep 16, 2021 2:38 pm

It worked!

Thank you so much for the quick reply.

You saved my day <3

User avatar
HermannSW
Posts: 4627
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: HQ camera low frame rate with 1080p resolution via v4l2 driver (3 fps)

Thu Sep 16, 2021 8:07 pm

mijoo94 wrote:
Thu Sep 16, 2021 2:38 pm
It worked!
So how do you record?
Which framerate are you able to get with 1080p?
https://github.com/Hermann-SW/memrun
https://stamm-wilbrandt.de/2wheel_balancing_robot
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/en/Raspberry_camera.html

mijoo94
Posts: 3
Joined: Thu Sep 16, 2021 1:45 pm

Re: HQ camera low frame rate with 1080p resolution via v4l2 driver (3 fps)

Fri Sep 17, 2021 9:25 am

Hi,

-i created a QT c++ App and used this code from the Linux kernel documentation https://www.kernel.org/doc/html/v4.11/m ... ure.c.html
My GUI App is able to control the HQ Raspi Camera (Brightness, Sharpness ...etc), live stream and single shot.

-After fixing the default settings from the v4l2 driver now i get 18 fps when i shoot on 1080p resolution.
if i capture a video using v4l2-ctl i get 28 fps. So i think my code is not good :(

Code: Select all

pi@raspberrypi:~ $ v4l2-ctl -v width=1920,height=1080,pixelformat=RGB24
pi@raspberrypi:~ $ v4l2-ctl --stream-mmap=3 --stream-to=/dev/null --stream-count=250
<<<<<<<<<<<<<<<<<<<<<<<<<<<< 26.15 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 28.05 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 28.70 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.03 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.22 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.36 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.45 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.52 fps
best regards
majd

Return to “Camera board”