Menu
Amazon Kinesis Video Streams
Developer Guide

Example: Using GStreamer with Kinesis Video Streams

The C++ Producer Library contains a demo application for using GStreamer, an open source multimedia framework, with Amazon Kinesis Video Streams.

The following procedure demonstrates how to set up and use the GStreamer demo. The application sends the video data to Kinesis Video Streams on the following platforms:

  • A built-in camera on a macOS computer

  • A USB camera on a Linux or Raspberry Pi device

Note

The GStreamer example is not currently available for Windows systems.

Prerequisites

The GStreamer example typically requires the following components, which you can install using the following commands:

  • Automake: brew install automake

  • Autoconf: brew install autoconf automake

  • CMake: brew install cmake

  • GStreamer: brew install gstreamer gst-plugins-base gst-plugins-bad gst-plugins-good gst-plugins-ugly

  • GNU Bison: brew install bison && brew link bison --force

For a more comprehensive list of requirements, see Prerequisites in the C++ Producer SDK documentation, or the README.md file in the SDK itself.

Running the GStreamer Example

  1. Create a directory, and then clone the example source code from the GitHub repository.

    $ git clone https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp
  2. Run the following script in the /kinesis-video-native-build directory to build the C++ Producer SDK:

    ./install-script

    This script installs the prerequisites for the SDK and builds the binaries, including the GStreamer example. For information about building the example on Ubuntu, see the "Troubleshooting" section of the README.md file in the SDK.

  3. After the C++ Procedure SDK is installed and configured, run the application using the following command (also in the /kinesis-video-native-build directory):

    export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY export AWS_DEFAULT_REGION=<AWS region> ./kinesis_video_gstreamer_sample_app stream_name

    Supply the following information for the application parameters:

    • AWS_ACCESS_KEY_ID: The access key ID for your account. See Prerequisites.

    • AWS_SECRET_ACCESS_KEY: The secret access key for your account. See Prerequisites.

    • AWS_DEFAULT_REGION: Your AWS Region, for example, us-west-2.

    • stream_name: The name of the Kinesis video stream to send camera data to. The stream will be created if it doesn't exist.

  4. The demo application starts. In a few seconds, you will see video data from your camera in the Kinesis Video Streams console for your stream.

    Note

    If the application fails to acquire your camera, you might see a Failed to negotiate pipeline error. For troubleshooting information, see the README.md file in the SDK.