GStreamer* Audio Pipeline#

Run a GStreamer* audio pipeline using GStreamer* plugins in a Docker* container.

Run the Sample Application#

  1. 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).

  2. If the image is not installed, Intel® recommends installing the Robot Base Kit or Robot Complete Kit with the Get Started Guide for Robots.

  3. 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.

  4. Run an automated yml file that opens a GStreamer* sample application inside the EI for AMR Docker* container.

    docker compose -f $AMR_TUTORIALS/gstreamer_audio.tutorial.yml up
    

    Expected output:

    #gst-launch-1.0 filesrc location=/data_samples/media_samples/sample.ogg ! oggdemux ! vorbisdec ! audioconvert ! audioresample ! Testsink
    error: XDG_RUNTIME_DIR not set in the environment.
    Setting pipeline to PAUSED ...
    Pipeline is PREROLLING ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    Got EOS from element "pipeline0".
    Execution ended after 0:01:14.349609320
    Setting pipeline to PAUSED ...
    Setting pipeline to READY ...
    Setting pipeline to NULL ...
    Freeing pipeline ...
    
  5. To close this, do 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_audio.tutorial.yml down
      
  6. 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 audio file using GStreamer*.

  7. To use your own audio, use the same yml file but update line 26 to target your own file.

    For example, copy the file:

    cp test.ogg ${CONTAINER_BASE_PATH}/01_docker_sdk_env/docker_compose/05_tutorials/test.ogg
    

    And update line 26 to:

    gst-launch-1.0 filesrc location=${CONTAINER_BASE_PATH}/01_docker_sdk_env/docker_compose/05_tutorials/test.ogg ! oggdemux ! vorbisdec ! audioconvert ! audioresample ! testsink
    

Troubleshooting#

For general robot issues, go to: Troubleshooting for Robot Tutorials.