GStreamer* Video Pipeline with an Intel® RealSense™ Camera#
Run a GStreamer* video pipeline using the Intel® RealSense™ plugin in a Docker* container in order to use a Intel® RealSense™ video camera as the video source.
Run the Sample Pipeline#
Connect an Intel® RealSense™ video camera.
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.
Check that EI for AMR environment is set:
echo $AMR_TUTORIALS # should output the path to EI for AMR tutorials /home/user/edge_insights_for_amr/Edge_Insights_for_Autonomous_Mobile_Robots_2023.1/AMR_containers/01_docker_sdk_env/docker_compose/05_tutorials
If nothing is output, refer to Get Started Guide for Robots Step 5 for information on how to configure the environment.
Get the stream from the Intel® RealSense™ camera using gstreamer:
docker compose -f $AMR_TUTORIALS/gstreamer_realsensesrc.tutorial.yml up
Expected output: The stream from the Intel® RealSense™ 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 to remove stopped containers:
docker compose -f $AMR_TUTORIALS/gstreamer_realsensesrc.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 gets the stream from the Intel® RealSense™ app using GStreamer*.
Troubleshooting#
In some cases, the stream may not appear due to permission issues on the host. You may see this error message:
ERROR: Pipeline doesn't want to pause.
To fix this, if you did not install the librealsense udev rules when you configured the host, install them now:
git clone https://github.com/IntelRealSense/librealsense # Copy the 99-realsense-libusb.rules files to the rules.d folder cd librealsense sudo cp config/99-realsense-libusb.rules /etc/udev/rules.d/ sudo udevadm control --reload-rules sudo udevadm trigger
Then open the
gst-launch
command.
If the problem persists, you can try any or all of the following:
Verify that $DISPLAY has the correct value.
Perform a Intel® RealSense™ hardware reset:
# Open realsense docker container docker compose -f 01_docker_sdk_env/docker_compose/01_amr/amr-sdk.all.yml run realsense bash # While in realsense container, open the realsense-viewer application realsense-viewer # In realsense-viewer menu, go to "More" and then select "Hardware Reset" # Wait for reset to complete and then close the realsense-viewer application.
Reboot the target.
For general robot issues, go to: Troubleshooting for Robot Tutorials.