Skip to content

Basler Camera using native NXP support

Introduction

The following instructions will allow you to add support for the Basler MIPI camera to your images using the software modules already present in the BSP. This will allow you to stream images and video from Basler cameras connected to a Variscite evaluation kit.

Available cameras

Preparing Yocto to use the Basler camera

There is no need to build a special Yocto image. The default Yocto build, as installed from a standard recovery SD card, already supports the Basler camera. The Yocto image supports the standard camera by default. In order to use the Basler camera an additional step is needed. Run the following commands at the shell prompt:

cd /boot
dt8mcustomboard
mv imx8mp-var-dart-dt8mcustomboard.dtb \
    imx8mp-var-dart-dt8mcustomboard-ov5640.dtb
mv imx8mp-var-dart-wbe-dt8mcustomboard.dtb \
    imx8mp-var-dart-wbe-dt8mcustomboard-ov5640.dtb
mv imx8mp-var-dart-1.x-dt8mcustomboard.dtb \
    imx8mp-var-dart-1.x-dt8mcustomboard-ov5640.dtb
ln -fs imx8mp-var-dart-dt8mcustomboard-basler-isp0.dtb \
    imx8mp-var-dart-dt8mcustomboard.dtb
ln -fs imx8mp-var-dart-wbe-dt8mcustomboard-basler-isp0.dtb \
    imx8mp-var-dart-wbe-dt8mcustomboard.dtb
ln -fs imx8mp-var-dart-1.x-dt8mcustomboard-basler-isp0.dtb \
    imx8mp-var-dart-1.x-dt8mcustomboard.dtb
# Symphony 1.x
mv imx8mp-var-som-symphony-1.x.dtb imx8mp-var-som-symphony-1.x-ov5640.dtb
mv imx8mp-var-som-wbe-symphony-1.x.dtb \
    imx8mp-var-som-wbe-symphony-1.x-ov5640.dtb
mv imx8mp-var-som-1.x-symphony-1.x.dtb \
    imx8mp-var-som-1.x-symphony-1.x-ov5640.dtb
ln -fs imx8mp-var-som-symphony-1.x-basler-isp0.dtb \
    imx8mp-var-som-symphony-1.x.dtb
ln -fs imx8mp-var-som-wbe-symphony-1.x-basler-isp0.dtb \
    imx8mp-var-som-wbe-symphony-1.x.dtb
ln -fs imx8mp-var-som-1.x-symphony-1.x-basler-isp0.dtb \
    imx8mp-var-som-1.x-symphony-1.x.dtb
# Symphony 2.x
mv imx8mp-var-som-symphony.dtb imx8mp-var-som-symphony-ov5640.dtb
mv imx8mp-var-som-wbe-symphony.dtb imx8mp-var-som-wbe-symphony-ov5640.dtb
mv imx8mp-var-som-1.x-symphony.dtb imx8mp-var-som-1.x-symphony-ov5640.dtb
ln -fs imx8mp-var-som-symphony-basler-isp0.dtb imx8mp-var-som-symphony.dtb
ln -fs imx8mp-var-som-wbe-symphony-basler-isp0.dtb \
    imx8mp-var-som-wbe-symphony.dtb
ln -fs imx8mp-var-som-1.x-symphony-basler-isp0.dtb \
    imx8mp-var-som-1.x-symphony.dtb

and reboot.

Running GStreamer

Run the following command at the shell prompt:

gst-launch-1.0 -v v4l2src device=/dev/video2 ! waylandsink

On boards with two cameras you can use the second camera by replacing /dev/video2 with /dev/video3 in the above command. Dual cameras currently can only work on VAR-DT8MCustomBoard due to hardware limitations of the Symphony board. The following command will simultaneously record two video streams from both cameras:

gst-launch-1.0 v4l2src device=/dev/video2 num-buffers=100 ! \
                 video/x-raw,width=1920,height=1080 ! vpuenc_h264 ! \
                 avimux ! filesink location=./test0_h264.avi \
                 v4l2src device=/dev/video3 num-buffers=100 ! \
                 video/x-raw,width=1920,height=1080 ! vpuenc_h264 ! \
                 avimux ! filesink location=./test1_h264.avi