.. |br| raw:: html
.. _tx8-bsp-camera: Camera Guide ============ .. note:: To enable camera support when building Yocto images see: - QS8M with Raspberry Pi camera: :ref:`yocto-guide/nxp/build:local.conf` section in NXP Yocto BSP. - Basler cameras: :ref:`basler-camera-yocto` in NXP Yocto BSP. Camera Enablement ----------------- .. list-table:: :header-rows: 1 * - Module - Camera - Precompiled Image - Yocto Enablement * - QS8M-MQ00 - `RaspberryPi Camera`_ - n.a. - :ref:`yocto-guide/nxp/build:Raspberry Pi Camera` * - QSXM-MM60 - `Basler daA2500-60mci`_ - *qsxm-mm60-basler* in `Download Area`_ - :ref:`yocto-guide/nxp/build:Basler Camera` * - QSXP-ML81 - `Basler daA3840-30mc`_ - *qsxp-ml81-basler* in `Download Area`_ - :ref:`yocto-guide/nxp/build:Basler Camera` Camera DTB ---------- To enable camera support you need to load the appropriate FDT overlay according to the following table. .. list-table:: :header-rows: 1 :widths: 25 25 50 * - Module - Camera Supported - FDT overlay * - qs8m on qsbase2 or qsbase4 - `RaspberryPi Camera`_ - qs8m-cam * - qsxm-* on qsbase4 - `RaspberryPi Camera`_ - qs8m-cam * - qsxp-ml81 on qsbase4 - `RaspberryPi Camera`_ - qsxp-cam * - qsxm-mm60 on qsbase3 - `Basler daA2500-60mci`_ - /TBD/ * - qsxp-ml81 on qsbase3 - `Basler daA3840-30mc`_ - /TBD/ Stream Camera ------------- To stream a camera live video on your weston desktop follow the instructions listed below. .. list-table:: :header-rows: 1 :widths: 15 15 70 * - Module - Camera - Stream Options * - qs8m, qsxm - `RaspberryPi Camera`_ - Start camera stream from serial terminal: .. prompt:: :prompts: # gst-launch-1.0 -v v4l2src ! \ "video/x-bayer,format=rggb,width=640,height=480,framerate=30/1" ! \ bayer2rgb ! videoconvert ! autovideosink sync=false Capture a single .jpg frame from camera stream. .. prompt:: :prompts: # gst-launch-1.0 -v v4l2src num-buffers=1 ! \ "video/x-bayer,format=rggb,width=640,height=480,framerate=30/1" ! \ bayer2rgb ! videoconvert ! jpegenc ! filesink location=test-cap.jpg * - qsxp-ml81 - `RaspberryPi Camera`_ - Start imx8-isp into background: .. prompt:: :prompts: # /opt/imx8-isp/bin/start_isp.sh & Start camera stream from serial terminal: .. prompt:: :prompts: # gst-launch-1.0 v4l2src device=/dev/video2 ! waylandsink * - qsxm-mm60, qsxp-ml81 - `Basler daA2500-60mci`_, `Basler daA3840-30mc`_ - Start pylon viewer from serial terminal: .. prompt:: :prompts: # export DISPLAY=:0; pylon Enable the camera and click on the camera icon to stream a live video. **Live-stream** the camera with gstreamer: .. prompt:: :prompts: # gst-launch-1.0 -v v4l2src device=/dev/video2 ! waylandsink You can also **record** the camera stream using the VPU: .. prompt:: :prompts: # gst-launch-1.0 v4l2src device=/dev/video2 ! \ "video/x-raw, format=NV12, width=1920, height=1080, framerate=30/1" ! \ vpuenc_h264 ! mpegtsmux name=mux ! filesink location=test_1080.ts .. _`RaspberryPi Camera`: https://www.raspberrypi.org/products/camera-module-v2/ .. _`Download Area`: https://www.karo-electronics.com/downloads .. _`Basler daA2500-60mci`: https://www.baslerweb.com/en/products/cameras/area-scan-cameras/dart/daa2500-60mci-s-mount/ .. _`Basler daA3840-30mc`: https://www.baslerweb.com/en/products/cameras/area-scan-cameras/dart/daa3840-30mc-s-mount/