Download and build the Kinesis Video Streams C++ producer SDK - Amazon Kinesis Video Streams

Download and build the Kinesis Video Streams C++ producer SDK

Follow the procedures below to download and build the Kinesis Video Streams C++ producer SDK.

  1. Download the SDK. Type:

    cd ~/Downloads git clone https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp.git --single-branch -b master kvs-producer-sdk-cpp
  2. Prepare a build directory. Type:

    mkdir -p kvs-producer-sdk-cpp/build cd kvs-producer-sdk-cpp/build
  3. Build the SDK and sample applications.

    cmake .. -DBUILD_GSTREAMER_PLUGIN=ON -DBUILD_DEPENDENCIES=OFF -DALIGNED_MEMORY_MODEL=ON make -j$(nproc)
    Note

    If you encounter a build issue and want to try different CMake arguments, make sure to perform a clean build. Delete the open-source, dependency, and build folders before you try again.

  4. Confirm that libgstkvssink.so is present.

    List the files in the current directory.

    Prompt:

    ls

    Response:

    CMakeCache.txt dependency kvs_gstreamer_sample CMakeFiles kvs_gstreamer_audio_video_sample kvssink_gstreamer_sample Makefile kvs_gstreamer_file_uploader_sample libKinesisVideoProducer.so cmake_install.cmake kvs_gstreamer_multistream_sample libgstkvssink.so
  5. Confirm that GStreamer can load kvssink.

    Set the GST_PLUGIN_PATH environment variable to the directory containing libgstkvssink.so.

    export GST_PLUGIN_PATH=`pwd`

    Have GStreamer load kvssink:

    gst-inspect-1.0 kvssink

    You should see some documentation about kvssink. Use the arrow keys to navigate and press q to exit.

  6. (Optional) Update your shell's start-up script to include setting the GST_PLUGIN_PATH environment variable. This ensures GST_PLUGIN_PATH is set properly during a new terminal session. On Raspberry Pi devices, the shell's start-up script is ~/.bashrc.

    Run the following command to append the command to the end of the shell's start-up script.

    echo "export GST_PLUGIN_PATH=~/Downloads/kvs-producer-sdk-cpp/build" >> ~/.bashrc

    Type the following to run the shell's start-up script, or close the current shell and open a new one.

    source ~/.bashrc

    Confirm the GST_PLUGIN_PATH is set and you can load kvssink.

    echo $GST_PLUGIN_PATH
    gst-inspect-1.0 kvssink

Troubleshoot build issues

If you encounter a build issue and want to try different CMake arguments, make sure to perform a clean build. Delete the open-source, dependency, and build folders before you try again.

Build issues with OpenSSL

If you receive output similar to the following, it indicates that OpenSSL has incorrectly detected your system architecture.

crypto/md5/md5-aarch64.S: Assembler messages: crypto/md5/md5-aarch64.S:3: Error: unrecognized symbol type "" crypto/md5/md5-aarch64.S:6: Error: bad instruction `stp x19,x20,[sp,#-80]!' crypto/md5/md5-aarch64.S:7: Error: bad instruction `stp x21,x22,[sp,#16]' crypto/md5/md5-aarch64.S:8: Error: bad instruction `stp x23,x24,[sp,#32]' crypto/md5/md5-aarch64.S:9: Error: bad instruction `stp x25,x26,[sp,#48]'

In this example, it is attempting to build a 64-bit version (linux-aarch64) when this Raspberry Pi is actually 32-bit. Some Raspberry Pi devices have a 64-bit kernel, but a 32-bit user space.

To verify your system's architecture:

  • Review the kernel bit-ness: run uname -m

  • Review the user space bit-ness: run getconf LONG_BIT

You can also review your CPU information with cat /proc/cpuinfo or lscpu commands.

Resolution:

To resolve this issue, add the following CMake argument when building, to ensure OpenSSL builds correctly for the 32-bit ARM architecture:

-DBUILD_OPENSSL_PLATFORM=linux-armv4