Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:edge2:add-ons:edge2-mipi-camera

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
products:sbc:edge2:add-ons:edge2-mipi-camera [2024/11/14 01:08]
nick [Table]
products:sbc:edge2:add-ons:edge2-mipi-camera [2025/09/02 04:01] (current)
gray
Line 6: Line 6:
  
 ===== Linux ===== ===== Linux =====
 +
  
 <WRAP important > <WRAP important >
Line 22: Line 23:
  
 Edit ''/boot/dtb/rockchip/rk3588s-khadas-edge2.dtb.overlay.env'' to setup ''fdt_overlays=cam2-4lane''. Edit ''/boot/dtb/rockchip/rk3588s-khadas-edge2.dtb.overlay.env'' to setup ''fdt_overlays=cam2-4lane''.
 +
 +<tabbox Fenix 1.7.4 or older version>
  
 About IMX585 and IMX678, the two cameras were disabled by default. So V11 or V12 hardware version should replace ''cam2-4lane'' by ''imx585'' or ''imx678'': About IMX585 and IMX678, the two cameras were disabled by default. So V11 or V12 hardware version should replace ''cam2-4lane'' by ''imx585'' or ''imx678'':
Line 31: Line 34:
  
 Edit ''/boot/dtb/rockchip/rk3588s-khadas-edge2.dtb.overlay.env'' to setup ''fdt_overlays=imx585-cam2-4lane'' or ''fdt_overlays=imx678-cam2-4lane''. Edit ''/boot/dtb/rockchip/rk3588s-khadas-edge2.dtb.overlay.env'' to setup ''fdt_overlays=imx585-cam2-4lane'' or ''fdt_overlays=imx678-cam2-4lane''.
 +
 +<tabbox Fenix 1.7.5 or later version>
 +
 +We enbale imx585 and imx678 by default, so just add overlay node ''cam2-4lane'' can let CAM2 interface support 4K@60fsp.
 +
 +</tabbox>
  
 You need to reboot the device to take effect. You need to reboot the device to take effect.
  
 </WRAP> </WRAP>
- 
  
 ==== Upgrade System ==== ==== Upgrade System ====
Line 53: Line 61:
 ==== Record Video with Gstreamer ==== ==== Record Video with Gstreamer ====
  
-<tabbox kernel 5.10.66> 
  
 Record video from ''CAM1'': Record video from ''CAM1'':
  
 ```shell ```shell
-gst-launch-1.0 v4l2src device=/dev/video33 io-mode=dmabuf num-buffers=300 ! mpph264enc ! h264parse ! qtmux ! filesink location=/tmp/video33.mp4+gst-launch-1.0 v4l2src device=/dev/video42 io-mode=dmabuf min-buffers=64 num-buffers=300 ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/! mpph264enc ! h264parse ! qtmux ! filesink location=/tmp/video42.mp4
 ``` ```
  
Line 64: Line 71:
  
 ```shell ```shell
-gst-launch-1.0 v4l2src device=/dev/video24 io-mode=dmabuf num-buffers=300 ! mpph264enc ! h264parse ! qtmux ! filesink location=/tmp/video24.mp4 +gst-launch-1.0 v4l2src device=/dev/video33 io-mode=dmabuf min-buffers=64 num-buffers=300 ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1 ! mpph264enc ! h264parse ! qtmux ! filesink location=/tmp/video33.mp4
-``` +
- +
-Record video from ''CAM3'': +
- +
-```shell +
-gst-launch-1.0 v4l2src device=/dev/video42 io-mode=dmabuf num-buffers=300 ! mpph264enc ! h264parse ! qtmux ! filesink location=/tmp/video42.mp4 +
-``` +
- +
-<tabbox Other version> +
- +
-Record video from ''CAM1'': +
- +
-```shell +
-gst-launch-1.0 v4l2src device=/dev/video42 io-mode=dmabuf num-buffers=300 ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1 ! mpph264enc ! h264parse ! qtmux ! filesink location=/tmp/video42.mp4 +
-``` +
- +
-Record video from ''CAM2'': +
- +
-```shell +
-gst-launch-1.0 v4l2src device=/dev/video33 io-mode=dmabuf num-buffers=300 ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1 ! mpph264enc ! h264parse ! qtmux ! filesink location=/tmp/video33.mp4+
 ``` ```
 For 4K@60fps, framerate should be set 60/1 For 4K@60fps, framerate should be set 60/1
Line 91: Line 78:
  
 ```shell ```shell
-gst-launch-1.0 v4l2src device=/dev/video51 io-mode=dmabuf num-buffers=600 ! video/x-raw,format=NV12,width=3840,height=2160,framerate=60/1 ! mpph264enc ! h264parse ! qtmux ! filesink location=/tmp/video51.mp4+gst-launch-1.0 v4l2src device=/dev/video51 io-mode=dmabuf min-buffers=64 num-buffers=600 ! video/x-raw,format=NV12,width=3840,height=2160,framerate=60/1 ! mpph264enc ! h264parse ! qtmux ! filesink location=/tmp/video51.mp4
 ``` ```
-</tabbox> 
  
 /* /*
Line 183: Line 169:
 sudo apt install v4l-utils sudo apt install v4l-utils
 ``` ```
- 
-<tabbox kernel 5.10.66> 
- 
-Capture frame from ''CAM1'': 
- 
-```shell 
-v4l2-ctl -d /dev/video33 --set-fmt-video=width=3840,height=2160,pixelformat=NV12 --stream-mmap=3 --stream-skip=3 --stream-to=/tmp/data33.yuv --stream-count=1 --stream-poll 
-``` 
- 
-Capture frame from ''CAM2'': 
- 
-```shell 
-v4l2-ctl -d /dev/video24 --set-fmt-video=width=3840,height=2160,pixelformat=NV12 --stream-mmap=3 --stream-skip=3 --stream-to=/tmp/data24.yuv --stream-count=1 --stream-poll 
-``` 
- 
-Capture frame from ''CAM3'': 
- 
-```shell 
-v4l2-ctl -d /dev/video42 --set-fmt-video=width=3840,height=2160,pixelformat=NV12 --stream-mmap=3 --stream-skip=3 --stream-to=/tmp/data42.yuv --stream-count=1 --stream-poll 
-``` 
- 
-<tabbox Other version> 
  
 Capture frame from ''CAM1'': Capture frame from ''CAM1'':
Line 223: Line 187:
 v4l2-ctl -d /dev/video51 --set-fmt-video=width=3840,height=2160,pixelformat=NV12 --stream-mmap=3 --stream-skip=3 --stream-to=/tmp/data51.yuv --stream-count=1 --stream-poll v4l2-ctl -d /dev/video51 --set-fmt-video=width=3840,height=2160,pixelformat=NV12 --stream-mmap=3 --stream-skip=3 --stream-to=/tmp/data51.yuv --stream-count=1 --stream-poll
 ``` ```
- 
-</tabbox> 
  
 It will capture a ''3840x2160 NV12'' format frame to file ''/tmp/dataXX.yuv''. It will capture a ''3840x2160 NV12'' format frame to file ''/tmp/dataXX.yuv''.
Line 235: Line 197:
  
 ``` ```
 +
 +==== Camera Interfaces Performance ====
 +
 +<tabbox IMX415>
 +|        ^  CAM2 2lane, connect one camera separately ^ CAM2 2lane, connect three camera simultaneously ^ CAM2 4lane, connect one camera separately ^ CAM2 4lane, connect three camera simultaneously ^ CMA2 4lane, connect 2 cameras to CAM3 and CAM2 separately ^
 +^  CAM1  |                  4K@30fps                  |                      4K@30fps                                   4K@30fps                  |                      4K@25fps                               |
 +^  CAM2  |                  4K@30fps                  |                      4K@30fps                                   4K@60fps                  |                      4K@50fps                      4K@60fps   |
 +^  CAM3  |                  4K@60fps                  |                      4K@60fps                                   4K@60fps                  |                      4K@60fps                      4K@60fps   |
 +<tabbox OS08A10>
 +|        ^  CAM2 2lane, connect one camera separately ^ CAM2 2lane, connect three camera simultaneously ^ CAM2 4lane, connect one camera separately ^ CAM2 4lane, connect three camera simultaneously ^ CMA2 4lane, connect 2 cameras to CAM3 and CAM2 separately ^
 +^  CAM1  |                  4K@30fps                  |                      4K@30fps                                   4K@30fps                  |                      4K@30fps                               |
 +^  CAM2  |                  4K@30fps                  |                      4K@30fps                                   4K@46fps                  |                      4K@46fps                      4K@46fps   |
 +^  CAM3  |                  4K@60fps                  |                      4K@46fps                                   4K@60fps                  |                      4K@46fps                      4K@46fps   |
 +<tabbox IMX585>
 +|        ^  CAM2 2lane, connect one camera separately ^ CAM2 2lane, connect three camera simultaneously ^ CAM2 4lane, connect one camera separately ^ CAM2 4lane, connect three camera simultaneously ^ CMA2 4lane, connect 2 cameras to CAM3 and CAM2 separately ^
 +^  CAM1  |                  4K@30fps                  |                      4K@18fps                                   4K@30fps                  |                      4K@15fps                               |
 +^  CAM2  |                  4K@30fps                  |                      4K@23fps                                   4K@60fps                  |                      4K@30fps                      4K@60fps   |
 +^  CAM3  |                  4K@60fps                  |                      4K@60fps                                   4K@60fps                  |                      4K@60fps                      4K@60fps   |
 +<tabbox IMX678>
 +|        ^  CAM2 2lane, connect one camera separately ^ CAM2 2lane, connect three camera simultaneously ^ CAM2 4lane, connect one camera separately ^ CAM2 4lane, connect three camera simultaneously ^ CMA2 4lane, connect 2 cameras to CAM3 and CAM2 separately ^
 +^  CAM1  |                  4K@30fps                  |                      4K@30fps                                   4K@30fps                  |                      4K@25fps                               |
 +^  CAM2  |                  4K@30fps                  |                      4K@30fps                                   4K@60fps                  |                      4K@50fps                      4K@60fps   |
 +^  CAM3  |                  4K@60fps                  |                      4K@60fps                                   4K@60fps                  |                      4K@60fps                      4K@60fps   |
 +
 +</tabbox>
  
 ===== Android ===== ===== Android =====
Last modified: 2024/11/14 01:08 by nick