How to display video captured by OS08A20 camera via HDMI with TorizonOS

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


Displaying OS08A20 Camera Video via HDMI on Torizon OS

Overview

To display video from your OS08A20 camera via HDMI on your i.MX95 Evaluation kit with Torizon OS, you’ll need to set up both the camera capture and HDMI display using containers and GStreamer pipelines(1)(2).

Required Setup

1. Weston Container for HDMI Display

First, launch the Weston compositor container to enable HDMI display output(2):

# docker container run -d --name=weston --net=host \
    --cap-add CAP_SYS_TTY_CONFIG \
    -v /dev:/dev -v /tmp:/tmp -v /run/udev/:/run/udev/ \
    --device-cgroup-rule="c 4:* rmw" --device-cgroup-rule="c 253:* rmw" \
    --device-cgroup-rule="c 13:* rmw" --device-cgroup-rule="c 226:* rmw" \
    --device-cgroup-rule="c 10:223 rmw" --device-cgroup-rule="c 199:0 rmw" \
    --device-cgroup-rule="c 10:* rmw" \
    torizon/weston-imx95:4 \
    --developer

(2)

2. Camera Device Discovery

Identify your camera’s video device node(2)(3):

# ls /dev/video*
# v4l2-ctl --list-devices

(2)(3)

This will show available video devices and help you identify which /dev/videoX corresponds to your OS08A20 camera(2)(3).

3. Container for Camera Access

Create a container with access to the camera device and display capabilities(2):

# docker run --rm -it -v /tmp:/tmp -v /var/run/dbus:/var/run/dbus -v /dev:/dev -v /sys:/sys \
    --device /dev/<video-device> \
    --device-cgroup-rule='c 226:* rmw' --device-cgroup-rule='c 199:* rmw' \
    <your-dockerhub-username>/<container-name>

(2)

GStreamer Pipeline for Video Display

Basic Pipeline Structure

Use GStreamer to create a pipeline from camera to HDMI display(1)(3):

## gst-launch-1.0 <videosrc> ! <capsfilter> ! <videosink>

(1)(3)

Specific Pipeline Example

## gst-launch-1.0 v4l2src device=</dev/video*> ! <capsfilter> ! fpsdisplaysink video-sink=waylandsink

(2)

For your OS08A20 camera, the pipeline would look like:

# gst-launch-1.0 v4l2src device='/dev/videoX' ! "video/x-raw, format=YUY2, framerate=30/1, width=1920, height=1080" ! fpsdisplaysink video-sink=waylandsink sync=false

(3)

Key Components Explained

  • v4l2src: Captures video from Video4Linux devices(1)(3)
  • capsfilter: Defines video properties like resolution and framerate(1)(3)
  • waylandsink: Displays video on the Wayland display server (Weston) connected to HDMI(1)(3)
  • fpsdisplaysink: Shows current and average frame rates while displaying video(3)

Troubleshooting Tips

  1. Device Tree Overlays: Ensure proper device tree overlays are applied for your OS08A20 camera(4)
  2. Driver Compatibility: Verify the camera driver is compatible with your Torizon OS version(4)
  3. Kernel Logs: Check dmesg for camera-related error messages(4)
  4. Video Device Registration: Use v4l2-ctl --list-devices to confirm the camera is recognized(4)

Hardware Access Requirements

Your container needs specific bind mounts and device access(2):

  • /dev: Access to camera devices
  • /tmp: Interaction with Weston GUI
  • /sys: Kernel subsystem access
  • /var/run/dbus: System services access

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.