AM62P CSI

From Variscite Wiki
Warning: This page is designed to be used with a 'release' URL parameter.

This page is using the default release am62p-yocto-scarthgap-6.6.58_10.01.10.04-v1.0.
To view this page for a specific Variscite SoM and software release, please follow these steps:

  1. Visit variwiki.com
  2. Select your SoM
  3. Select the software release
VAR-SOM-AM62P Camera

Testing MIPI-CSI2 cameras

Camera Probe

Run the following command to see if you have the camera(s) detected

# v4l2-ctl --list-devices

This should produce the following output

j721e-csi2rx (platform:30102000.ticsi2rx):
        /dev/video2
        /dev/video3
        /dev/video4
        /dev/video5
        /dev/video6
        /dev/video7
        /dev/media0

wave5-dec (platform:30210000.video-codec):
        /dev/video0
        /dev/video1

The camera interface is /dev/video2

Testing Camera Preview on Display

The driver is implemented using V4L2’s Media Controller (MC) API. In the MC API, each element in the media pipeline is configured individually by the user-space application. For more information, see: https://software-dl.ti.com/processor-sdk-linux/esd/AM62PX/10_01_10_04/exports/docs/linux/Foundational_Components/Kernel/Kernel_Drivers/Camera/CSI2RX.html?highlight=media%20ctl

The pipeline is configured individually by the user-space application.

At a minimum, the pixel format, resolution, and framerate must be configured:

# cam -c1 --stream <resolution>,pixelformat=UYVY -C1

After configuring the pipeline, it can be confirmed by reading it back:

# media-ctl --get-v4l2 '"ov5640 0-003c":0'

The following examples show how to preview the camera on the display for different resolutions:


  • VGA 640x480@30fps:
# cam -c1 --stream width=640,height=480,pixelformat=UYVY -C1
# gst-launch-1.0 v4l2src device="/dev/video2" ! video/x-raw, width=640, height=480, format=UYVY ! autovideosink


  • NTSC 480p 720x480@30fps:
# cam -c1 --stream width=720,height=480,pixelformat=UYVY -C1
# gst-launch-1.0 v4l2src device="/dev/video2" ! video/x-raw, width=720, height=480, format=UYVY ! autovideosink


  • HD 720p 1280x720@30fps:
# cam -c1 --stream width=1280,height=720,pixelformat=UYVY -C1
# gst-launch-1.0 v4l2src device="/dev/video2" ! video/x-raw, width=1280, height=720, format=UYVY ! autovideosink


  • Full HD 1080p 1920x1080@15fps:
# cam -c1 --stream width=1920,height=1080,pixelformat=UYVY -C1
# gst-launch-1.0 v4l2src device="/dev/video2" ! video/x-raw, width=1920, height=1080, format=UYVY ! autovideosink


  • Full HD 1080p 1920x1080@30fps:
# cam -c1 --stream width=1920,height=1080,pixelformat=UYVY -C1
# gst-launch-1.0 v4l2src device="/dev/video2" ! video/x-raw, width=1920, height=1080, format=UYVY ! autovideosink


  • QSXGA 1944p 2592x1944@15fps:
# cam -c1 --stream width=2592,height=1944,pixelformat=UYVY -C1
# gst-launch-1.0 v4l2src device="/dev/video2" ! video/x-raw, width=2592, height=1944, format=UYVY ! autovideosink


Testing Camera Preview on Display using libcamera

Using libcamera the pipeline configuration is no need.

The following examples show how to preview the camera on the display for different resolutions:


  • VGA 640x480@30fps:
# gst-launch-1.0 libcamerasrc ! video/x-raw, width=640, height=480, format=UYVY ! autovideosink


  • NTSC 480p 720x480@30fps:
# gst-launch-1.0 libcamerasrc ! video/x-raw, width=720, height=480, format=UYVY ! autovideosink


  • HD 720p 1280x720@30fps:
# gst-launch-1.0 libcamerasrc ! video/x-raw, width=1280, height=720, format=UYVY ! autovideosink


  • Full HD 1080p 1920x1080@15fps:
# gst-launch-1.0 libcamerasrc ! video/x-raw, width=1920, height=1080, format=UYVY ! autovideosink


  • Full HD 1080p 1920x1080@30fps:
# gst-launch-1.0 libcamerasrc ! video/x-raw, width=1920, height=1080, format=UYVY ! autovideosink


  • QSXGA 1944p 2592x1944@15fps:
# gst-launch-1.0 libcamerasrc ! video/x-raw, width=2592, height=1944, format=UYVY ! autovideosink


Testing Camera JPEG Snapshot

To capture JPEG snapshot run one of the pipelines below depending upon the required picture resolution.


  • VGA 640x480:
# cam -c1 --stream width=640,height=480,pixelformat=UYVY -C1
# yavta -c1 -n5 -Fframe.raw -s 640x480 -f UYVY /dev/video2
# ffmpeg -f rawvideo -pixel_format uyvy422 -video_size 640x480 -i frame.raw -frames:v 1 test_640x480.jpg
# rm frame.raw


  • NTSC 480p 720x480:
# cam -c1 --stream width=720,height=480,pixelformat=UYVY -C1
# yavta -c1 -n5 -Fframe.raw -s 720x480 -f UYVY /dev/video2
# ffmpeg -f rawvideo -pixel_format uyvy422 -video_size 720x480 -i frame.raw -frames:v 1 test_720x480.jpg
# rm frame.raw


  • HD 720p 1280x720:
# cam -c1 --stream width=1280,height=720,pixelformat=UYVY -C1
# yavta -c1 -n5 -Fframe.raw -s 1280x720 -f UYVY /dev/video2
# ffmpeg -f rawvideo -pixel_format uyvy422 -video_size 1280x720 -i frame.raw -frames:v 1 test_1280x720.jpg
# rm frame.raw


  • Full HD 1080p 1920x1080:
# cam -c1 --stream width=1920,height=1080,pixelformat=UYVY -C1
# yavta -c1 -n5 -Fframe.raw -s 1920x1080 -f UYVY /dev/video2
# ffmpeg -f rawvideo -pixel_format uyvy422 -video_size 1920x1080 -i frame.raw -frames:v 1 test_1920x1080.jpg
# rm frame.raw


  • QSXGA 1944p 2592x1944:
# cam -c1 --stream width=2592,height=1944,pixelformat=UYVY -C1
# yavta -c1 -n5 -Fframe.raw -s 2592x1944 -f UYVY /dev/video2
# ffmpeg -f rawvideo -pixel_format uyvy422 -video_size 2592x1944 -i frame.raw -frames:v 1 test_2592x1944.jpg
# rm frame.raw