Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:vim-5:add-ons:vim-5-mipi-camera

Differences

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

Link to this comparison view

products:sbc:vim-5:add-ons:vim-5-mipi-camera [2026/09/15 02:20]
nick ↷ Page name changed from products:sbc:vim-5:add-ons:new-vim4-mipi-camera to products:sbc:vim-5:add-ons:vim-5-mipi-camera
products:sbc:vim-5:add-ons:vim-5-mipi-camera [2026/09/15 02:24] (current)
nick
Line 1: Line 1:
-~~tag> VIM4 MIPI OS08A10 IMX415 ISP IP~~+~~tag> VIM-5 MIPI OS08A10 IMX415 IMX585 IMX678 ISP IP~~
  
 {{indexmenu_n>52}} {{indexmenu_n>52}}
  
-====== New VIM4 MIPI camera usage ====== +====== VIM 5 MIPI camera usage ======
- +
-<WRAP important > +
-There are two [[../configurations/identify-version#vim4-versions-differences-reference-table| different VIM4 versions ]]: VIM4 and New VIM4. Both versions have different [[/tag/isp|ISP IP core]], so the usage of MIPI camera is also different. +
-</WRAP>+
  
 ===== Linux ===== ===== Linux =====
Line 13: Line 9:
 ==== Upgrade system ==== ==== Upgrade system ====
  
-Please follow the [[products:sbc:vim4:configurations:upgrade-system|documentation ]]to upgrade your system to latest version+Please follow the [[products:sbc:vim-5:configurations:upgrade-system|documentation ]]to upgrade your system to latest version.
- +
- +
-==== Enable overlays ==== +
- +
-<WRAP important > +
-From version **1.7.5**, cameras are auto detected by default, no need any setup, you can just skip the overlay setup. +
-</WRAP> +
- +
-If you want to use the MIPI camera, you need to enable it in [[products:sbc:vim4:configurations:device-tree-overlay|overlays]].\\ +
-[[gh>khadas/khadas-linux-kernel-dt-overlays/tree/main/overlays/vim4/5.4]] +
- +
-  * Add ''vim4n-os08a10'' to ''fdt_overlays'' in ''/boot/dtb/amlogic/kvim4.dtb.overlay.env'' to enable ''OS08A10'' +
-  * Add ''vim4n-imx415'' to ''fdt_overlays'' in ''/boot/dtb/amlogic/kvim4.dtb.overlay.env'' to enable ''IMX415'' +
- +
-Enable ''OS08A10'': [[gh>/khadas/khadas-linux-kernel-dt-overlays/blob/main/overlays/vim4/5.4/vim4n-os08a10.dts]] +
- +
-``` +
-$ cat /boot/dtb/amlogic/kvim4.dtb.overlay.env  +
-fdt_overlays=vim4n-os08a10 +
-``` +
- +
-Enable ''IMX415'': [[gh>/khadas/khadas-linux-kernel-dt-overlays/blob/main/overlays/vim4/5.4/vim4n-imx415.dts]] +
-``` +
-$ cat /boot/dtb/amlogic/kvim4.dtb.overlay.env  +
-fdt_overlays=vim4n-imx415 +
-``` +
- +
-And then reboot to take effect.+
  
 ==== Video node ==== ==== Video node ====
  
-The video node is ''/dev/media0''.+The video node is ''/dev/video60''.
  
 ==== Record video via gstreamer ==== ==== Record video via gstreamer ====
  
 <WRAP important > <WRAP important >
-Only for 5.15 kernel.+Only for 6.12 kernel.
 </WRAP> </WRAP>
  
Line 57: Line 25:
  
 ```shell ```shell
-gst-launch-1.0 -e v4l2src device=/dev/media0  io-mode=dmabuf num-buffers=300 ! video/x-raw,format=NV21,width=1920,height=1080,framerate=30/1 ! amlvenc bitrate=8000 ! h264parse ! qtmux ! filesink location=~/test-h264.mp4 +gst-launch-1.0 -e v4l2src device=/dev/video60 io-mode=dmabuf num-buffers=300 ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1 ! amlvenc bitrate=8000 ! h264parse ! qtmux ! filesink location=test-h264.mp4
 ``` ```
  
Line 65: Line 32:
  
 ```shell ```shell
-gst-launch-1.0 -e v4l2src device=/dev/media0  io-mode=dmabuf num-buffers=300 ! video/x-raw,format=NV21,width=1920,height=1080,framerate=30/1 ! amlvenc bitrate=8000 ! h265parse ! qtmux ! filesink location=~/test-h265.mp4 +gst-launch-1.0 -e v4l2src device=/dev/video60 io-mode=dmabuf num-buffers=300 ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1 ! amlvenc bitrate=8000 ! h265parse ! qtmux ! filesink location=test-h265.mp4
 ``` ```
  
 ==== Get Frames via Mediactl API ==== ==== Get Frames via Mediactl API ====
  
-Download and build the test source code: [[gh>numbqq/v4l2_media_test]]+TODO
  
-<tabbox 5.4 kernel> 
- 
- 
-```shell 
-$ git clone https://github.com/numbqq/v4l2_media_test 
-$ cd v4l2_media_test 
-$ git checkout e0482794337c01935593a91b621f9c42123cf175 
-$ g++ v4l2_test_raw.cpp -o v4l2_test_raw  -Wall -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast -pthread -fPIE -lispaml -ldl -lmediaAPI -ltuning -lm -fPIC -D_FORTIFY_SOURCE=2 -O3 
-$ ls v4l2_test_raw 
-v4l2_test_raw 
-``` 
- 
-<tabbox 5.15 kernel> 
- 
-```shell 
-$ git clone https://github.com/numbqq/v4l2_media_test 
-$ cd v4l2_media_test 
-$ g++ v4l2_test_raw.cpp -o v4l2_test_raw  -Wall -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast -pthread -fPIE -lispaml -ldl -lmediaAPI -ltuning -llens -lm -fPIC -D_FORTIFY_SOURCE=2 -O3 
-$ ls v4l2_test_raw 
-v4l2_test_raw 
-``` 
- 
-</tabbox> 
- 
-Test: 
- 
-```shell 
-$ ./v4l2_test_raw -p 0 -n 10 -m /dev/media0 
-``` 
- 
-It will capture 10 frames to file ''/tmp/dst_mif_0.yuv''. 
- 
-Preview the file: 
- 
-<WRAP important > 
-It doesn't work on VIM4, you need to copy the file and execute the command on your host PC. 
-</WRAP> 
- 
- 
-```shell 
-$ ffplay -f rawvideo -pixel_format nv12 -video_size 3840x2160 /tmp/dst_mif_0.yuv 
-``` 
  
 ==== Preview video on ubuntu desktop ==== ==== Preview video on ubuntu desktop ====
- 
-<tabbox Ubuntu 24.04> 
  
 You can use gstreamer ''waylandsink'' to preview the video on Ubuntu Wayland desktop: You can use gstreamer ''waylandsink'' to preview the video on Ubuntu Wayland desktop:
  
 ```shell ```shell
-gst-launch-1.0 v4l2src device=/dev/media0 io-mode=mmap  ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1 ! videoconvert ! waylandsink+gst-launch-1.0 v4l2src device=/dev/video60 io-mode=mmap  ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1 ! videoconvert ! waylandsink
 ``` ```
  
Line 129: Line 51:
  
 ```shell ```shell
-gst-launch-1.0 -v v4l2src device=/dev/media0 io-mode=mmap ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1 ! fpsdisplaysink video-sink=waylandsink sync=false text-overlay=false+gst-launch-1.0 -v v4l2src device=/dev/video60 io-mode=mmap ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1 ! fpsdisplaysink video-sink=waylandsink sync=false text-overlay=false
 ``` ```
- 
-<tabbox Ubuntu 22.04> 
- 
-You can use gstreamer ''clutterautovideosink'' to preview the video on Ubuntu Wayland desktop: 
- 
-```shell 
-gst-launch-1.0 v4l2src device=/dev/media0 io-mode=mmap ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1 ! clutterautovideosink 
-``` 
- 
-You can use the command below to check display fps: 
- 
-```shell 
-gst-launch-1.0 -v v4l2src device=/dev/media0 io-mode=mmap ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1 ! fpsdisplaysink video-sink=clutterautovideosink sync=false text-overlay=true 
-``` 
- 
-You press ''Alt + F7'' and then move mouse to move the windown. 
- 
- 
-</tabbox> 
- 
- 
  
  
Last modified: 2026/09/15 02:20 by nick