radxa-pkg / radxa-overlays

Additional device tree overlays to support different hardwares on Radxa products
GNU General Public License v2.0
43 stars 31 forks source link

Raspberry pi v1.3 issue on radxa zero 3e #376

Open FAIZALR opened 2 weeks ago

FAIZALR commented 2 weeks ago

radxa-zero3-rpi-camera-v1.3.dts is overlayed and attached a raspberry pi camera.but the fps is only 15 in VGA,HD AND FHD resolution's.

RadxaYuntian commented 2 weeks ago

Please list your system download link.

FAIZALR commented 1 week ago

Please list your system download link. https://github.com/radxa-build/radxa-zero3/releases/download/b6/radxa-zero3_debian_bullseye_xfce_b6.img.xz

Iam using the std image from this link

CodeChenL commented 1 week ago

@FAIZALR How do you preview the camera

FAIZALR commented 1 week ago

@FAIZALR How do you preview the camera

I just used a opencv-python script . when i use a usb web camera iam getting 30 fps. but for the raspberry pi camera 1.3 its only 15 fps. looks like something to do with driver camera mode.

CodeChenL commented 1 week ago

Try using this command line to preview camera on your desktop gst-launch-1.0 v4l2src device=/dev/video-camera0 ! xvimagesink, there may be performance issues with opencv.

FAIZALR commented 1 week ago

gst-launch-1.0 v4l2src device=/dev/video-camera0 ! xvimagesink

1)This is giving full frame (2592 x 1944 ) video , i tired to modify this as "gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1920,height=1080,framerate=30/1 ! xvimagesink" The output image is in different colour format. photo_6176930615904027368_y .In this both case its not 30 fps.

FAIZALR commented 1 week ago

Try using this command line to preview camera on your desktop gst-launch-1.0 v4l2src device=/dev/video-camera0 ! xvimagesink, there may be performance issues with opencv.

radxa@radxa-zero3:~$ v4l2-ctl --list-formats-ext -d /dev/video0 ioctl: VIDIOC_ENUM_FMT Type: Video Capture Multiplanar

Size: Stepwise 32x32 - 2592x1944 with step 8/8

Size: Stepwise 32x32 - 2592x1944 with step 8/8

Size: Stepwise 32x32 - 2592x1944 with step 8/8

Size: Stepwise 32x32 - 2592x1944 with step 8/8

Size: Stepwise 32x32 - 2592x1944 with step 8/8

Size: Stepwise 32x32 - 2592x1944 with step 8/8

Size: Stepwise 32x32 - 2592x1944 with step 8/8

Size: Stepwise 32x32 - 2592x1944 with step 8/8

Size: Stepwise 32x32 - 2592x1944 with step 8/8

Size: Stepwise 32x32 - 2592x1944 with step 8/8

Size: Stepwise 32x32 - 2592x1944 with step 8/8

listed formats are only in the range of 2592X1944

May i know how can i get 1280X720 with 30 fps.?

CodeChenL commented 1 week ago

Try using this command line to preview camera on your desktop gst-launch-1.0 v4l2src device=/dev/video-camera0 ! xvimagesink, there may be performance issues with opencv.尝试使用此命令行在您的桌面上预览摄像头, gst-launch-1.0 v4l2src device=/dev/video-camera0 ! xvimagesink ,可能存在与 OpenCV 的性能问题。

radxa@radxa-zero3:~$ v4l2-ctl --list-formats-ext -d /dev/video0 ioctl: VIDIOC_ENUM_FMT Type: Video Capture Multiplanar类型:多平面视频捕获

Size: Stepwise 32x32 - 2592x1944 with step 8/8大小:逐步 32x32 - 2592x1944,步长 8/8 [1]: '422P' (Planar YUV 4:2:2)[1]: '422P'(平面 YUV 4:2:2) Size: Stepwise 32x32 - 2592x1944 with step 8/8大小:逐步 32x32 - 2592x1944,步长 8/8 [2]: 'NV16' (Y/CbCr 4:2:2)[2]: 'NV16'(Y/CbCr 4:2:2) Size: Stepwise 32x32 - 2592x1944 with step 8/8大小:逐步 32x32 - 2592x1944,步长 8/8 [3]: 'NV61' (Y/CrCb 4:2:2)[3]: 'NV61'(Y/CrCb 4:2:2) Size: Stepwise 32x32 - 2592x1944 with step 8/8大小:逐步 32x32 - 2592x1944,步长 8/8 [4]: 'YM16' (Planar YUV 4:2:2 (N-C))[4]: 'YM16'(平面 YUV 4:2:2(N-C)) Size: Stepwise 32x32 - 2592x1944 with step 8/8大小:逐步 32x32 - 2592x1944,步长 8/8 [5]: 'NV21' (Y/CrCb 4:2:0)[5]: 'NV21'(Y/CbCr 4:2:0) Size: Stepwise 32x32 - 2592x1944 with step 8/8大小:逐步 32x32 - 2592x1944,步长 8/8 [6]: 'NV12' (Y/CbCr 4:2:0) Size: Stepwise 32x32 - 2592x1944 with step 8/8大小:逐步 32x32 - 2592x1944,步长 8/8 [7]: 'NM21' (Y/CrCb 4:2:0 (N-C)) Size: Stepwise 32x32 - 2592x1944 with step 8/8大小:逐步 32x32 - 2592x1944,步长 8/8 [8]: 'NM12' (Y/CbCr 4:2:0 (N-C)) Size: Stepwise 32x32 - 2592x1944 with step 8/8大小:逐步 32x32 - 2592x1944,步长 8/8 [9]: 'YU12' (Planar YUV 4:2:0)[9]: 'YU12'(平面 YUV 4:2:0) Size: Stepwise 32x32 - 2592x1944 with step 8/8大小:逐步 32x32 - 2592x1944,步长 8/8 [10]: 'YM24' (Planar YUV 4:4:4 (N-C))[10]: 'YM24'(平面 YUV 4:4:4(N-C)) Size: Stepwise 32x32 - 2592x1944 with step 8/8大小:逐步 32x32 - 2592x1944,步长 8/8

listed formats are only in the range of 2592X1944列出格式仅限于 2592X1944 范围

May i know how can i get 1280X720 with 30 fps.?请问如何获取 1280X720 分辨率,30 帧每秒的视频?

Hi @FAIZALR , The corresponding node of the camera should be /dev/video-camera0 or the device node of its link, instead of/dev/video0, which may be the reason why you have a partial color

FAIZALR commented 6 days ago

Try using this command line to preview camera on your desktop gst-launch-1.0 v4l2src device=/dev/video-camera0 ! xvimagesink, there may be performance issues with opencv.尝试使用此命令行在您的桌面上预览摄像头, gst-launch-1.0 v4l2src device=/dev/video-camera0 ! xvimagesink ,可能存在与 OpenCV 的性能问题。

radxa@radxa-zero3:~$ v4l2-ctl --list-formats-ext -d /dev/video0 ioctl: VIDIOC_ENUM_FMT Type: Video Capture Multiplanar类型:多平面视频捕获 Size: Stepwise 32x32 - 2592x1944 with step 8/8大小:逐步 32x32 - 2592x1944,步长 8/8 [1]: '422P' (Planar YUV 4:2:2)[1]: '422P'(平面 YUV 4:2:2) Size: Stepwise 32x32 - 2592x1944 with step 8/8大小:逐步 32x32 - 2592x1944,步长 8/8 [2]: 'NV16' (Y/CbCr 4:2:2)[2]: 'NV16'(Y/CbCr 4:2:2) Size: Stepwise 32x32 - 2592x1944 with step 8/8大小:逐步 32x32 - 2592x1944,步长 8/8 [3]: 'NV61' (Y/CrCb 4:2:2)[3]: 'NV61'(Y/CrCb 4:2:2) Size: Stepwise 32x32 - 2592x1944 with step 8/8大小:逐步 32x32 - 2592x1944,步长 8/8 [4]: 'YM16' (Planar YUV 4:2:2 (N-C))[4]: 'YM16'(平面 YUV 4:2:2(N-C)) Size: Stepwise 32x32 - 2592x1944 with step 8/8大小:逐步 32x32 - 2592x1944,步长 8/8 [5]: 'NV21' (Y/CrCb 4:2:0)[5]: 'NV21'(Y/CbCr 4:2:0) Size: Stepwise 32x32 - 2592x1944 with step 8/8大小:逐步 32x32 - 2592x1944,步长 8/8 [6]: 'NV12' (Y/CbCr 4:2:0) Size: Stepwise 32x32 - 2592x1944 with step 8/8大小:逐步 32x32 - 2592x1944,步长 8/8 [7]: 'NM21' (Y/CrCb 4:2:0 (N-C)) Size: Stepwise 32x32 - 2592x1944 with step 8/8大小:逐步 32x32 - 2592x1944,步长 8/8 [8]: 'NM12' (Y/CbCr 4:2:0 (N-C)) Size: Stepwise 32x32 - 2592x1944 with step 8/8大小:逐步 32x32 - 2592x1944,步长 8/8 [9]: 'YU12' (Planar YUV 4:2:0)[9]: 'YU12'(平面 YUV 4:2:0) Size: Stepwise 32x32 - 2592x1944 with step 8/8大小:逐步 32x32 - 2592x1944,步长 8/8 [10]: 'YM24' (Planar YUV 4:4:4 (N-C))[10]: 'YM24'(平面 YUV 4:4:4(N-C)) Size: Stepwise 32x32 - 2592x1944 with step 8/8大小:逐步 32x32 - 2592x1944,步长 8/8 listed formats are only in the range of 2592X1944列出格式仅限于 2592X1944 范围 May i know how can i get 1280X720 with 30 fps.?请问如何获取 1280X720 分辨率,30 帧每秒的视频?

Hi @FAIZALR , The corresponding node of the camera should be /dev/video-camera0 or the device node of its link, instead of/dev/video0, which may be the reason why you have a partial color

Thank you for your response. As you suggested in the forum, I switched to using /dev/video-camera0 instead of /dev/video0, but unfortunately, the issue still persists. While I am able to get a proper RGB image in my OpenCV Python script, the color format is still incorrect when using v4l2, indicating a mismatch in the expected color formats.

I am only getting 15 FPS in OpenCV Python/C++, even after setting the camera resolution to 640x480 and fps to 30 in code . I think 15 FPS is typically associated with the full camera resolution (2592x1944). I was expecting 30 FPS at 640x480, but this is not the case.

The output of v4l2-ctl -d /dev/video0 --list-formats-ext clearly shows that all the formats listed are for the full resolution (2592x1944)this makesthe camera at 15 FPS. Could you please assist with getting 30 FPS at standard resolutions such as 640x480, 1280x720, or 1920x1080? These are common resolutions and should be supported on the Radxa Zero3e, especially considering the NPU capabilities to use in this SBC.

I would appreciate it if Radxa could provide better support for Raspberry Pi Camera v1.3 and v2, as these cameras are widely available and commonly used for DIY projects.

CodeChenL commented 5 days ago

Thanks for the feedback, I have reproduced the issue and I will try to improve the speed of rpi camera v1.3

CodeChenL commented 5 days ago

@Ken-Vamrs , after testing, this appears to be not related to hardware acceleration at the user level, please help to check this problem.

FAIZALR commented 4 days ago

@Ken-Vamrs , after testing, this appears to be not related to hardware acceleration at the user level, please help to check this problem.

media-ctl -d 0 -V "'m00_b_ov5647 2-0036':0[fmt:SGBRG10_1X10/1296x972]" media-ctl -d 0 -V "'rkisp-isp-subdev':0[fmt:SGBRG10_1X10/1296x972]" media-ctl -d 0 -V "'rkisp-isp-subdev':0[crop:(0,0)/1296x972]" v4l2-ctl -d /dev/video0 --set-fmt-video=width=1296,height=972 This helped as temporary solution. kindly check this