Difference between revisions of "AOM-DB3500 Video In(MIPI CSI0/CSI1)——Camera"

From ESS-WIKI
Jump to: navigation, search
(Created page with " === '''Camera''' === AOM-3821 has two MIPI-CSI camera ports. {| border="1" cellpadding="1" cellspacing="1" style="width: 500px;" |- | colspan="4" | '''MIPI-CSI camera ports...")
 
Line 29: Line 29:
 
<pre># v4l2-ctl -d /dev/video22 --get-fmt-video
 
<pre># v4l2-ctl -d /dev/video22 --get-fmt-video
 
Format Video Capture Multiplanar:
 
Format Video Capture Multiplanar:
&nbsp;Width/Height : 3840/2160
+
&nbsp;Width/Height&nbsp;: 3840/2160
&nbsp;Pixel Format : 'NV12' (Y/UV 4:2:0)
+
&nbsp;Pixel Format&nbsp;: 'NV12' (Y/UV 4:2:0)
&nbsp;Field : None
+
&nbsp;Field&nbsp;: None
&nbsp;Number of planes : 1
+
&nbsp;Number of planes&nbsp;: 1
&nbsp;Flags :
+
&nbsp;Flags&nbsp;:
&nbsp;Colorspace : sRGB
+
&nbsp;Colorspace&nbsp;: sRGB
&nbsp;Transfer Function : Rec. 709
+
&nbsp;Transfer Function&nbsp;: Rec. 709
 
&nbsp;YCbCr/HSV Encoding: Rec. 709
 
&nbsp;YCbCr/HSV Encoding: Rec. 709
&nbsp;Quantization : Full Range
+
&nbsp;Quantization&nbsp;: Full Range
&nbsp;Plane 0 :
+
&nbsp;Plane 0&nbsp;:
&nbsp;Bytes per Line : 3840
+
&nbsp;Bytes per Line&nbsp;: 3840
&nbsp;Size Image : 12441600&nbsp;</pre>
+
&nbsp;Size Image&nbsp;: 12441600&nbsp;</pre>
  
 
=== '''Set Resolution''' ===
 
=== '''Set Resolution''' ===
  
 
Taking port 22 as an example, you can enter the following commands to set the resolution to 1920*1080.
 
Taking port 22 as an example, you can enter the following commands to set the resolution to 1920*1080.
<pre># v4l2-ctl -d /dev/video22 --set-fmt-video=width=1920,height=1080,\pixel�format='NV12'</pre>
+
<pre># v4l2-ctl -d /dev/video22 --set-fmt-video=width=1920,height=1080,\pixelformat='NV12'</pre>
  
 
=== '''Preview Camera''' ===
 
=== '''Preview Camera''' ===
Line 53: Line 53:
 
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/aarch64-linux-gnu/
 
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/aarch64-linux-gnu/
 
gstreamer-1.0
 
gstreamer-1.0
#gst-launch-1.0 v4l2src device=/dev/video22 \! video/x-raw,for�mat=NV12,width=1920,height=1080,framerate=30/1 \! xvimagesink</pre>
+
#gst-launch-1.0 v4l2src device=/dev/video22 \! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 \! xvimagesink</pre>
  
 
=== '''Camera Photography''' ===
 
=== '''Camera Photography''' ===
Line 59: Line 59:
 
Taking port 22 as an example, the following command can be used to take a camera&nbsp;photo, and the save address is picture.jpg in the current directory.
 
Taking port 22 as an example, the following command can be used to take a camera&nbsp;photo, and the save address is picture.jpg in the current directory.
 
<pre># gst-launch-1.0 v4l2src device=/dev/video22 num-buffers=1 \
 
<pre># gst-launch-1.0 v4l2src device=/dev/video22 num-buffers=1 \
! video/x-raw,format=NV12,width=1920,height=1080 ! jpegenc ! filesink loca�tion= picture.jpg</pre>
+
! video/x-raw,format=NV12,width=1920,height=1080&nbsp;! jpegenc&nbsp;! filesink location= picture.jpg</pre>
  
 
=== '''Camera Screen Recording''' ===
 
=== '''Camera Screen Recording''' ===

Revision as of 09:12, 4 January 2026

Camera

AOM-3821 has two MIPI-CSI camera ports.

MIPI-CSI camera ports
Camera Number Video Port Note AOM-DB3500 Number
Camera1 22 (I2C 4)4 Lane CSI0_FPC
Camera2 31 (I2C 8)4 Lane CSI1_FPC

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