This is an old revision of the document!
Please follow the documentation to upgrade your system to latest version.
If you want to use the MIPI camera, you need to enable it in overlays.
vim4n-os08a10
to fdt_overlays
in /boot/dtb/amlogic/kvim4.dtb.overlay.env
to enable OS08A10
vim4n-imx415
to fdt_overlays
in /boot/dtb/amlogic/kvim4.dtb.overlay.env
to enable IMX415
Enable OS08A10
:
$ cat /boot/dtb/amlogic/kvim4.dtb.overlay.env fdt_overlays=vim4n-os08a10
Enable IMX415
:
$ cat /boot/dtb/amlogic/kvim4.dtb.overlay.env fdt_overlays=vim4n-imx415
And then reboot to take effect.
The video node is /dev/media0
.
Test source code: numbqq/v4l2_media_test
Download and build the test source code:
$ 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
$ 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
Test:
$ ./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:
$ ffplay -f rawvideo -pixel_format nv21 -video_size 3840x2160 /tmp/dst_mif_0.yuv