Get Started Guide

  • 2021.3
  • 10/21/2021
  • Public Content

Run a GStreamer* Video Pipeline using libv4l2 in Docker* Container

Run the Sample Pipeline

  1. Connect a video camera compatible with libv4l2, such as a webcam (an Intel® RealSense™ camera is not compatible).
  2. Go to the
    AMR_containers
    folder:
    cd <edge_insights_for_amr_path>/Edge_Insights_for_Autonomous_Mobile_Robots_<version>/AMR_containers
  3. Run the command below to start the Docker container:
    sudo chmod a+rw /dev/video* ./run_interactive_docker.sh amr-ubuntu2004-full-flavour-sdk:<TAG> eiforamr
  4. Run
    gst-launch
    from the Docker container, where
    <videoX>
    points to the webcam device:
    gst-launch-1.0 v4l2src device="/dev/<videoX>" ! videoconvert ! autovideosink
    The image from the webcam is displayed.

Troubleshooting

  • If the following error is encountered:
    $ ./run_interactive_docker.sh amr-ubuntu2004-full-flasvour-sdk:<TAG> eiforamr bash: ./run_interactive_docker.sh Permission denied
    Give executable permission to the script:
    $ chmod 755 run_interactive_docker.sh
  • If the following error is encountered:
    eiforamr@edgesoftware:~/workspace$ gst-launch-1.0 v4l2src ! autovideosink Setting pipeline to PAUSED ... Pipeline is live and does not need PREROLL ... Setting pipeline to PLAYING ... ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error. Additional debug info: gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: streaming stopped, reason not-negotiated (-4) Execution ended after 0:00:00.000028689 Setting pipeline to PAUSED ... Setting pipeline to READY ... Setting pipeline to NULL ... Freeing pipeline ...
GStreamer* may want the type of decoding added. For example, for a Logitech* C922 webcam, the command is:
$ gst-launch-1.0 v4l2src ! jpegdec ! autovideosink

Summary and Next Steps

In this tutorial, you learned how to run a GStreamer* video pipeline using libv4l2 as video source.

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.