Visible to Intel only — GUID: GUID-759D7576-A027-4F05-96FE-67477CE6877A
Visible to Intel only — GUID: GUID-759D7576-A027-4F05-96FE-67477CE6877A
GStreamer* Video Pipeline with libv4l2
Run a GStreamer* video pipeline using libv4l2 in a Docker* container.
Run the Sample Pipeline
Connect a video camera compatible with libv4l2, such as a webcam (an Intel® RealSense™ camera is not compatible).
Check if your installation has the amr-gstreamer Docker* image.
docker images |grep amr-gstreamer #if you have it installed, the result is: amr-gstreamer
NOTE:If the image is not installed, continuing with these steps triggers a build that takes longer than an hour (sometimes, a lot longer depending on the system resources and internet connection).If the image is not installed, Intel recommends installing the Robot Base Kit or Robot Complete Kit with the Get Started Guide for Robots.
Go to the AMR_containers folder:
cd <edge_insights_for_amr_path>/Edge_Insights_for_Autonomous_Mobile_Robots_<version>/AMR_containers
Prepare the environment setup:
source ./01_docker_sdk_env/docker_compose/common/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.tutorial.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.tutorial.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.
Did you find the information on this page useful?
Feedback Message
Characters remaining: