Visible to Intel only — GUID: GUID-A74697C9-AE70-43B5-BED1-CCA166949E21
Visible to Intel only — GUID: GUID-A74697C9-AE70-43B5-BED1-CCA166949E21
Run a GStreamer* Video Pipeline using libv4l2 in Docker* Container
Run the Sample Pipeline
Connect a video camera compatible with libv4l2, such as a webcam (an Intel® RealSense™ camera is not compatible).
Go to the AMR_containers folder:
cd <edge_insights_for_amr_path>/Edge_Insights_for_Autonomous_Mobile_Robots_<version>/AMR_containers
Prepare environment setup:
source 01_docker_sdk_env/docker_compose/05_tutorials/config/docker_compose.source export CONTAINER_BASE_PATH=`pwd` export ROS_DOMAIN_ID=27 sudo chmod a+rw /dev/video*
Get the stream from the webcam using GStreamer*:
CHOOSE_USER=eiforamr docker-compose -f 01_docker_sdk_env/docker_compose/05_tutorials/gstreamer_libv4l2.demo.yml up
Expected output: The stream from the webcam is displayed.
To close this, do one of the following:
Type Ctrl-c in the terminal where you did the up command.
Run this command in another terminal:
CHOOSE_USER=eiforamr docker-compose -f 01_docker_sdk_env/docker_compose/05_tutorials/gstreamer_libv4l2.demo.yml down
For an explanation of what happened, open the yml file:
The first 23 lines are from the EI for AMR infrastructure.
Line 26 plays the stream from the webcam using GStreamer*.
Troubleshooting
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
If the following error is encountered:
amr-gstreamer | Setting pipeline to PAUSED ... amr-gstreamer | error: XDG_RUNTIME_DIR not set in the environment.
Try this:
mkdir -pv ~/.cache/xdgr export XDG_RUNTIME_DIR=$PATH:~/.cache/xdgr
For general robot issues, go to: Troubleshooting for Robot Tutorials.