Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:vim4:add-ons:vim4-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
Last revision Both sides next revision
products:sbc:vim4:add-ons:vim4-mipi-camera [2023/07/05 02:53]
nick
products:sbc:vim4:add-ons:vim4-mipi-camera [2023/09/28 03:24]
nick [Record Video via Gstreamer]
Line 1: Line 1:
 +~~tag> VIM4 OpenCV V4l2 MIPI ISP ~~
 +
 {{indexmenu_n>50}} {{indexmenu_n>50}}
  
Line 26: Line 28:
  
 ```shell ```shell
-gst-launch-1.0 v4l2src device=/dev/video50 io-mode=mmap num-buffers=300 ! video/x-raw,format=NV12 ! amlvenc bitrate=8000 ! h264parse ! qtmux ! filesink location=test_50.mp4+gst-launch-1.0 v4l2src device=/dev/video50 io-mode=mmap num-buffers=300 ! video/x-raw,format=NV21,width=3840,height=2160,framerate=30/! amlvenc bitrate=8000 ! h264parse ! qtmux ! filesink location=test_50.mp4
 ``` ```
  
Line 140: Line 142:
 WIP: WIP:
  
-====== New VIM4 MIPI Camera Usage ====== 
- 
-===== Linux ===== 
- 
-==== Enable Overlays ==== 
- 
-If you want to use the OS08A10 MIPI camera, you need to enable it in [[products:sbc:vim4:configurations:device-tree-overlay|overlays]], you need to add ''vim4n-os08a10'' to ''fdt_overlays'' in ''/boot/dtb/amlogic/kvim4.dtb.overlay.env''. 
- 
-``` 
-$ cat /boot/dtb/amlogic/kvim4.dtb.overlay.env  
-fdt_overlays=vim4n-os08a10 
-``` 
- 
-And then reboot to take effect. 
- 
-==== Video Node ==== 
- 
-The video node is ''/dev/media0''. 
- 
-==== Get Frames via Mediactl API ==== 
- 
-You can get the test source code here: https://github.com/numbqq/v4l2_media_test 
- 
-Download and build the test source code: 
- 
-<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: 
- 
-```shell 
-$ ffplay -f rawvideo -pixel_format nv21 -video_size 3840x2160 /tmp/dst_mif_0.yuv 
- 
-``` 
- 
-===== Android ===== 
-WIP: 
  
Last modified: 2024/05/18 03:12 by nick