# amazon-kinesis-video-streams-producer-sdk-cpp **Repository Path**: lukezhqin/amazon-kinesis-video-streams-producer-sdk-cpp ## Basic Information - **Project Name**: amazon-kinesis-video-streams-producer-sdk-cpp - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-07-28 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
Key Features • Build • Run • Documentation • Related • License
## Key Features * C++ SDK * GStreamer Plugin (kvssink) * JNI Amazon Kinesis Video Streams Producer SDK for C/C++ makes it easy to build an on-device application that securely connects to a video stream, and reliably publishes video and other media data to Kinesis Video Streams. It takes care of all the underlying tasks required to package the frames and fragments generated by the device's media pipeline. The SDK also hand les stream creation, token rotation for secure and uninterrupted streaming, processing acknowledgements returned by Kinesis Video Streams, and other tasks. ## Build ### Download To download run the following command: `git clone --recursive https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp.git` Note: If you miss running git clone with --recursive, run `git submodule update --init` in the amazon-kinesis-video-streams-producer-sdk-cpp/open-source directory You will also need to install `pkg-config`, `CMake`, `m4` and a build enviroment. If you are building the GStreamer plugin you will also need GStreamer and GStreamer (Development Libraries). Refer to the [FAQ](#FAQ) for platform specific instructions. ### Configure Create a build directory in the newly checked out repository, and execute CMake from it. `mkdir -p amazon-kinesis-video-streams-producer-sdk-cpp/build; cd amazon-kinesis-video-streams-producer-sdk-cpp/build; cmake .. ` If you are building on Windows you need to generate `NMake Makefiles`, you should run `cmake .. -G "NMake Makefiles"` GStreamer and JNI is NOT built by default, if you wish to build both you MUST execute `cmake .. -DBUILD_GSTREAMER_PLUGIN=ON -DBUILD_JNI=TRUE` By default we download all the libraries from GitHub and build them locally, so should require nothing to be installed ahead of time. If you do wish to link to existing libraries you can do `cmake .. -DBUILD_DEPENDENCIES=OFF` Libraries needed to build producer are: Curl, Openssl and Log4cplus. If you want to build the gstreamer plugin you will need to have gstreamer in your system. On Mac OS you can get the libraries using homebrew ``` $ brew install pkg-config openssl cmake gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly log4cplus gst-libav ``` On Ubuntu and Raspberry Pi OS you can get the libraries by running ``` $ sudo apt-get install libssl-dev libcurl4-openssl-dev liblog4cplus-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools ``` #### Cross-Compilation If you wish to cross-compile `CC` and `CXX` are respected when building the library and all its dependencies. See our [.travis.yml](.travis.yml) for an example of this. Every commit is cross compiled to ensure that it continues to work. #### CMake Arguments You can pass the following options to `cmake ..`. * `-DBUILD_GSTREAMER_PLUGIN` -- Build kvssink GStreamer plugin * `-DBUILD_JNI` -- Build C++ wrapper for JNI to expose the functionality to Java/Android * `-DBUILD_DEPENDENCIES` -- Build depending libraries from source * `-DBUILD_TEST=TRUE` -- Build unit/integration tests, may be useful for confirm support for your device. `./tst/webrtc_client_test` * `-DCODE_COVERAGE` -- Enable coverage reporting * `-DCOMPILER_WARNINGS` -- Enable all compiler warnings * `-DADDRESS_SANITIZER` -- Build with AddressSanitizer * `-DMEMORY_SANITIZER` -- Build with MemorySanitizer * `-DTHREAD_SANITIZER` -- Build with ThreadSanitizer * `-DUNDEFINED_BEHAVIOR_SANITIZER` Build with UndefinedBehaviorSanitizer * `-DALIGNED_MEMORY_MODEL` Build for aligned memory model only devices. Default is OFF. ### Build To build the library run make in the build directory you executed CMake. ``` make ``` On Windows you should run `nmake` instead of `make` In your build directory you will now have shared objects for all the targets you have selected ## Run ### GStreamer Plugin (kvssink) #### Loading Element The GStreamer plugin is located in your `build` directory. To load this plugin set the following environment variables. This should be run from the root of the repo, NOT the `build` directory. ``` export GST_PLUGIN_PATH=`pwd`/build export LD_LIBRARY_PATH=`pwd`/open-source/local/lib ``` The equivalent for Windows is ``` set GST_PLUGIN_PATH=%CD%\build set PATH=%PATH%;%CD%\open-source\local\bin;%CD%\open-source\local\lib ``` Now if you execute `gst-inspect-1.0 kvssink` you should get information on the plugin like ```text Factory Details: Rank primary + 10 (266) Long-name KVS Sink Klass Sink/Video/Network Description GStreamer AWS KVS plugin Author AWS KVS