I have recently bought an OV9281 sensor and when attached to my RPi the lowest resolution mode advertises that it can get up to 300FPS.
$ rpicam-hello --list
Available cameras
-----------------
0 : ov9281 [1280x800 10-bit MONO] (/base/axi/pcie@120000/rp1/i2c@80000/ov9281@60)
Modes: 'R8' : 640x400 [309.79 fps - (0, 0)/1280x800 crop]
1280x720 [171.79 fps - (0, 0)/1280x720 crop]
1280x800 [143.66 fps - (0, 0)/1280x800 crop]
'R10_CSI2P' : 640x400 [247.83 fps - (0, 0)/1280x800 crop]
1280x720 [137.42 fps - (0, 0)/1280x720 crop]
1280x800 [114.93 fps - (0, 0)/1280x800 crop]
However the fastest I was able to run the was at 286.56FPS. The code below produced this results (code grabbed form this discussion viewtopic.php?t=369637)
$ python test_capture.py
[0:56:25.911905541] [27384] INFO Camera camera_manager.cpp:325 libcamera v0.3.2+99-1230f78d
[0:56:25.918014610] [27385] INFO RPI pisp.cpp:695 libpisp version v1.0.7 28196ed6edcf 07-12-2024 (18:22:27)
[0:56:25.918635998] [27385] WARN CameraSensorProperties camera_sensor_properties.cpp:305 No static properties available for 'ov9281'
[0:56:25.918649998] [27385] WARN CameraSensorProperties camera_sensor_properties.cpp:307 Please consider updating the camera sensor properties database
[0:56:25.920705403] [27385] INFO RPI pisp.cpp:1154 Registered camera /base/axi/pcie@120000/rp1/i2c@80000/ov9281@60 to CFE device /dev/media0 and ISP device /dev/media1 using PiSP variant BCM2712_C0
[0:56:25.922918753] [27384] INFO Camera camera.cpp:1197 configuring streams: (0) 640x480-XBGR8888 (1) 640x400-R16
[0:56:25.922997401] [27385] INFO RPI pisp.cpp:1450 Sensor: /base/axi/pcie@120000/rp1/i2c@80000/ov9281@60 - Selected sensor format: 640x400-Y8_1X8 - Selected CFE format: 640x400-Y16
[0:56:25.926034028] [27384] INFO Camera camera.cpp:1197 configuring streams: (0) 640x480-XBGR8888 (1) 1280x720-R16
[0:56:25.926141639] [27385] INFO RPI pisp.cpp:1450 Sensor: /base/axi/pcie@120000/rp1/i2c@80000/ov9281@60 - Selected sensor format: 1280x720-Y8_1X8 - Selected CFE format: 1280x720-Y16
[0:56:25.928916692] [27384] INFO Camera camera.cpp:1197 configuring streams: (0) 640x480-XBGR8888 (1) 1280x800-R16
[0:56:25.929016229] [27385] INFO RPI pisp.cpp:1450 Sensor: /base/axi/pcie@120000/rp1/i2c@80000/ov9281@60 - Selected sensor format: 1280x800-Y8_1X8 - Selected CFE format: 1280x800-Y16
[0:56:25.932174356] [27384] INFO Camera camera.cpp:1197 configuring streams: (0) 640x480-XBGR8888 (1) 640x400-MONO_PISP_COMP1
[0:56:25.932282911] [27385] INFO RPI pisp.cpp:1450 Sensor: /base/axi/pcie@120000/rp1/i2c@80000/ov9281@60 - Selected sensor format: 640x400-Y10_1X10 - Selected CFE format: 640x400-PC1M
[0:56:25.934255447] [27384] INFO Camera camera.cpp:1197 configuring streams: (0) 640x480-XBGR8888 (1) 1280x720-MONO_PISP_COMP1
[0:56:25.934343076] [27385] INFO RPI pisp.cpp:1450 Sensor: /base/axi/pcie@120000/rp1/i2c@80000/ov9281@60 - Selected sensor format: 1280x720-Y10_1X10 - Selected CFE format: 1280x720-PC1M
[0:56:25.937293611] [27384] INFO Camera camera.cpp:1197 configuring streams: (0) 640x480-XBGR8888 (1) 1280x800-MONO_PISP_COMP1
[0:56:25.937431407] [27385] INFO RPI pisp.cpp:1450 Sensor: /base/axi/pcie@120000/rp1/i2c@80000/ov9281@60 - Selected sensor format: 1280x800-Y10_1X10 - Selected CFE format: 1280x800-PC1M
[0:56:25.940889830] [27384] INFO Camera camera.cpp:1197 configuring streams: (0) 640x480-YUV420 (1) 640x400-MONO_PISP_COMP1
[0:56:25.941023348] [27385] INFO RPI pisp.cpp:1450 Sensor: /base/axi/pcie@120000/rp1/i2c@80000/ov9281@60 - Selected sensor format: 640x400-Y8_1X8 - Selected CFE format: 640x400-PC1M
Total number of frames captured: 2866
Average FPS: 286.56
How can I grab the frames up to the advertised FPS? Should I resort to C++ and interfacing with libcamera directly? Also, is it normal behaviour that many information messages?
Additional information about the RPi 5
- 8 GB RAM
- overclocked
over_voltage_delta=50000
arm_freq=3000
gpu_freq=1000
Thanks,
J
$ rpicam-hello --list
Available cameras
-----------------
0 : ov9281 [1280x800 10-bit MONO] (/base/axi/pcie@120000/rp1/i2c@80000/ov9281@60)
Modes: 'R8' : 640x400 [309.79 fps - (0, 0)/1280x800 crop]
1280x720 [171.79 fps - (0, 0)/1280x720 crop]
1280x800 [143.66 fps - (0, 0)/1280x800 crop]
'R10_CSI2P' : 640x400 [247.83 fps - (0, 0)/1280x800 crop]
1280x720 [137.42 fps - (0, 0)/1280x720 crop]
1280x800 [114.93 fps - (0, 0)/1280x800 crop]
However the fastest I was able to run the was at 286.56FPS. The code below produced this results (code grabbed form this discussion viewtopic.php?t=369637)
Code:
from picamera2 import Picamera2from time import time, sleepimport libcamera# Configurationcapture_duration = 10 # Total duration to capture frames in secondsresolution = (640, 480) # Low resolution arraysize=tuple(resolution)frame_count = 0#Picamera2cam = Picamera2()#Fastest framerate modemode=cam.sensor_modes[0]sensor={'output_size': mode['size'],'bit_depth':mode['bit_depth']}#3-colour-plane array at chosen sizemain= {'format' :'YUV420','size': size}#Configure cameraconfig=cam.create_video_configuration(main,sensor=sensor)cam.configure(config)#Set up controls for minimum noise processing and framerate matching max from sensorcam.set_controls({ 'NoiseReductionMode' : libcamera.controls.draft.NoiseReductionModeEnum.Off, 'FrameDurationLimits' : (3333, 3333), 'AeEnable' : False})sleep(2)#Start cameracam.start()# Capture framesstart_time = time()while time() - start_time < capture_duration: frame = cam.capture_array() # Example: Convert to grayscale gray_frame = frame[:size[1]] # Increment frame counter frame_count += 1# Calculate and display the average FPSend_time = time()duration = end_time - start_timeaverage_fps = frame_count / durationprint(f"Total number of frames captured: {frame_count}")print(f"Average FPS: {average_fps:.2f}")
$ python test_capture.py
[0:56:25.911905541] [27384] INFO Camera camera_manager.cpp:325 libcamera v0.3.2+99-1230f78d
[0:56:25.918014610] [27385] INFO RPI pisp.cpp:695 libpisp version v1.0.7 28196ed6edcf 07-12-2024 (18:22:27)
[0:56:25.918635998] [27385] WARN CameraSensorProperties camera_sensor_properties.cpp:305 No static properties available for 'ov9281'
[0:56:25.918649998] [27385] WARN CameraSensorProperties camera_sensor_properties.cpp:307 Please consider updating the camera sensor properties database
[0:56:25.920705403] [27385] INFO RPI pisp.cpp:1154 Registered camera /base/axi/pcie@120000/rp1/i2c@80000/ov9281@60 to CFE device /dev/media0 and ISP device /dev/media1 using PiSP variant BCM2712_C0
[0:56:25.922918753] [27384] INFO Camera camera.cpp:1197 configuring streams: (0) 640x480-XBGR8888 (1) 640x400-R16
[0:56:25.922997401] [27385] INFO RPI pisp.cpp:1450 Sensor: /base/axi/pcie@120000/rp1/i2c@80000/ov9281@60 - Selected sensor format: 640x400-Y8_1X8 - Selected CFE format: 640x400-Y16
[0:56:25.926034028] [27384] INFO Camera camera.cpp:1197 configuring streams: (0) 640x480-XBGR8888 (1) 1280x720-R16
[0:56:25.926141639] [27385] INFO RPI pisp.cpp:1450 Sensor: /base/axi/pcie@120000/rp1/i2c@80000/ov9281@60 - Selected sensor format: 1280x720-Y8_1X8 - Selected CFE format: 1280x720-Y16
[0:56:25.928916692] [27384] INFO Camera camera.cpp:1197 configuring streams: (0) 640x480-XBGR8888 (1) 1280x800-R16
[0:56:25.929016229] [27385] INFO RPI pisp.cpp:1450 Sensor: /base/axi/pcie@120000/rp1/i2c@80000/ov9281@60 - Selected sensor format: 1280x800-Y8_1X8 - Selected CFE format: 1280x800-Y16
[0:56:25.932174356] [27384] INFO Camera camera.cpp:1197 configuring streams: (0) 640x480-XBGR8888 (1) 640x400-MONO_PISP_COMP1
[0:56:25.932282911] [27385] INFO RPI pisp.cpp:1450 Sensor: /base/axi/pcie@120000/rp1/i2c@80000/ov9281@60 - Selected sensor format: 640x400-Y10_1X10 - Selected CFE format: 640x400-PC1M
[0:56:25.934255447] [27384] INFO Camera camera.cpp:1197 configuring streams: (0) 640x480-XBGR8888 (1) 1280x720-MONO_PISP_COMP1
[0:56:25.934343076] [27385] INFO RPI pisp.cpp:1450 Sensor: /base/axi/pcie@120000/rp1/i2c@80000/ov9281@60 - Selected sensor format: 1280x720-Y10_1X10 - Selected CFE format: 1280x720-PC1M
[0:56:25.937293611] [27384] INFO Camera camera.cpp:1197 configuring streams: (0) 640x480-XBGR8888 (1) 1280x800-MONO_PISP_COMP1
[0:56:25.937431407] [27385] INFO RPI pisp.cpp:1450 Sensor: /base/axi/pcie@120000/rp1/i2c@80000/ov9281@60 - Selected sensor format: 1280x800-Y10_1X10 - Selected CFE format: 1280x800-PC1M
[0:56:25.940889830] [27384] INFO Camera camera.cpp:1197 configuring streams: (0) 640x480-YUV420 (1) 640x400-MONO_PISP_COMP1
[0:56:25.941023348] [27385] INFO RPI pisp.cpp:1450 Sensor: /base/axi/pcie@120000/rp1/i2c@80000/ov9281@60 - Selected sensor format: 640x400-Y8_1X8 - Selected CFE format: 640x400-PC1M
Total number of frames captured: 2866
Average FPS: 286.56
How can I grab the frames up to the advertised FPS? Should I resort to C++ and interfacing with libcamera directly? Also, is it normal behaviour that many information messages?
Additional information about the RPi 5
- 8 GB RAM
- overclocked
over_voltage_delta=50000
arm_freq=3000
gpu_freq=1000
Thanks,
J
Statistics: Posted by josovi — Mon Dec 16, 2024 6:46 pm