AOM-DB3500 Video In(MIPI CSI0/CSI1)——Camera
Contents
- 1Camera
- 2
- 3View Resolution
- 4Set Resolution
- 5Preview Camera
- 6Camera Photography
- 7Camera Screen Recording
Camera
AOM-3821 has two MIPI-CSI camera ports.
Peripheral: ROM-EC50 + CRK8F4403-V1 (IMX415) Cable: 39-pin 0.3mm pitch, unidirectional FPC. The USB on ROM-EC50 requires external 5V power supply to ensure the camera's voltage level.
| MIPI-CSI camera ports |
|---|
| Camera Number |
| Camera1 |
| Camera2 |
View Resolution
Taking port 22 as an example, you can enter the following instructions to view information such as the resolution, pixel format, Field, Number of planes, Flags, Colorspace, Transfer Function, YCbCr/HSV Encoding, Quantization, Bytes per Line and Size Image.
# v4l2-ctl -d /dev/video22 --get-fmt-video
Format Video Capture Multiplanar:
Width/Height : 3840/2160
Pixel Format : 'NV12' (Y/UV 4:2:0)
Field : None
Number of planes : 1
Flags :
Colorspace : sRGB
Transfer Function : Rec. 709
YCbCr/HSV Encoding: Rec. 709
Quantization : Full Range
Plane 0 :
Bytes per Line : 3840
Size Image : 12441600
Set Resolution
Taking port 22 as an example, you can enter the following commands to set the resolution to 1920*1080.
# v4l2-ctl -d /dev/video22 --set-fmt-video=width=1920,height=1080,\pixelformat='NV12'
Preview Camera
Taking port 22 as an example, you can set the preview of the camera video by using the following command.
# export DISPLAY=:0.0
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/aarch64-linux-gnu/
gstreamer-1.0
#gst-launch-1.0 v4l2src device=/dev/video22 \! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 \! xvimagesink
Camera Photography
Taking port 22 as an example, the following command can be used to take a camera photo, and the save address is picture.jpg in the current directory.
# gst-launch-1.0 v4l2src device=/dev/video22 num-buffers=1 \
! video/x-raw,format=NV12,width=1920,height=1080 ! jpegenc ! filesink location= picture.jpg
Camera Screen Recording
Taking port 22 as an example, the following command can be used to record videos with the camera, and the save address is video.mp4 in the current directory.
# gst-launch-1.0 -e \
v4l2src device=/dev/video22 \
! video/x-raw,format=NV12,width=1920,height=1080,framerate=25/1 \
! videoconvert \
! x264enc bitrate=5000 speed-preset=ultrafast tune=zerolatency \
! h264parse \
! mp4mux \
! filesink location= video.mp4
——Camera_img001-6c2ce321d3089f9b533f152a6515aedb.png)