GStreamer Dataset Capture
This guide walks you through how to capture videos and images from the phyFLEX-i.MX 95 Libra development kit with a VM-020 phyCAM-L camera using GStreamer.
The examples shown in this guide are based on PHYTEC's Dataset Collection demo for capturing small hardware objects such as screws, nuts, washers, etc.
Setup Camera
-
Ensure the camera is connected to CSI1 port X32
-
Ensure "/boot/overlays.txt" is set to:
# cat /boot/overlays.txt fit_overlay_conf=conf-imx95-phyflex-libra-rdk-lvds-ph128800t006-zhc01.dtbo#conf-imx95-phyflex-libra-rdk-neoisp.dtbo#conf-imx95-phyflex-libra-rdk-vm020-fpdlink-port0-csi1.dtbo -
Run this command if you need to set "/boot/overlays.txt" to the proper setting
# echo 'fit_overlay_conf=conf-imx95-phyflex-libra-rdk-lvds-ph128800t006-zhc01.dtbo#conf-imx95-phyflex-libra-rdk-neoisp.dtbo#conf-imx95-phyflex-libra-rdk-vm020-fpdlink-port0-csi1.dtbo' > /boot/overlays.txtThen
rebootafter applying the setting. -
Test that the camera feed is displayed on the monitor using the following examples provided in the BSP
# cd /root/gstreamer-examples/isp/ # ./capture-libcamera-liveview-csi1.shYou should see a live feed of the camera on the monitor.
Live Stream View
GStreamer Capture
-
Ensure adequate lighting is placed upon the tray and keep wiring away from the camera’s field of view
-
Ensure the camera’s exposure mode is set to auto
v4l2-ctl -d /dev/v4l-subdev21 --set-ctrl=auto_exposure=0You can confirm the current exposure mode setting with this command:
# v4l2-ctl -d /dev/v4l-subdev21 --get-ctrl=auto_exposure auto_exposure: 0 (Auto Mode)Manual Exposure Auto Exposure 

-
Start the dataset capture using the following GStreamer commands
Record a video:
gst-launch-1.0 -e libcamerasrc ! video/x-raw,format=NV21,width=1920,height=1200,framerate=30/1 ! videoconvert ! v4l2h264enc ! h264parse ! mp4mux ! filesink location=add_objects.mp4Capture an image:
gst-launch-1.0 libcamerasrc ! video/x-raw,format=NV21,width=1920,height=1200 ! jpegenc ! multifilesink location=image.jpgAuto-Annotations with Video Propagation
It’s recommended to capture videos for your dataset to take advantage of auto-annotations using video propagation capabilities in EdgeFirst Studio.
-
Once you have captured some samples for your dataset, copy the files to your PC
Next Steps
Now that you have captured some videos or images using GStreamer, let's take a look at importing the captures into EdgeFirst Studio to begin the annotation process.