Added a gstreamer app sample (kvsWebRTCAndDirectStream.c) to support streaming video to KVS with WebRTC SDK (for real-time use) and Stream Producer SDK (for video ingestion), simultaneously from 1 camera source.
This sample is currently only tested on Raspberry Pi 3B equipped with USB Camera.
- AWS Account with configured:
- Kinesis Video Streams
- IAM role with appropriate permissions
- Physical webcam required: The application uses
autovideosrcand will not fallback tovideotestsrcif no camera is connected
-
Clone this repository to your Raspberry Pi with submodules:
git clone --recurse-submodules https://github.com/aws-samples/amazon-kinesis-video-streams-demos.gitOr if already cloned, initialize submodules:
git submodule update --init --recursive -
Copy the sample file to the WebRTC SDK samples directory:
cp kvsWebRTCAndDirectStream.c amazon-kinesis-video-streams-webrtc-sdk-c/samples/ -
Configure your AWS credentials on the Raspberry Pi
Refer to each SDK main repository for the details of how to build. -DALIGNED_MEMORY_MODEL=ON flag might need to be used on Raspberry Pi 4B and 5B.
- https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c
- https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp
cd amazon-kinesis-video-streams-producer-sdk-cpp
mkdir -p build
cd build
cmake .. -DBUILD_DEPENDENCIES=OFF
make -j
cd amazon-kinesis-video-streams-webrtc-sdk-c
mkdir -p build
cd build
cmake .. -DBUILD_DEPENDENCIES=OFF
make -j
-
Configure your AWS credentials on the Raspberry Pi
-
Configure GStreamer plugin path with the path where you build the KVS Streams Producer app, e.g.,
export GST_PLUGIN_PATH=/home/pi/amazon-kinesis-video-streams-producer-sdk-cpp/build -
Go to
amazon-kinesis-video-streams-webrtc-sdk-c/build/and run./samples/kvsWebRTCAndDirectStream <signaling channel name> <kvs stream name>
The following screenshots demonstrate WebRTC and Stream Producer running simultaneously:
Real-time WebRTC streaming through the signaling channel
Near real-time video ingestion to Kinesis Video Stream
WebRTC connection and streaming logs
Kinesis Video Stream ingestion logs showing successful simultaneous operation
This project uses components from AWS Kinesis Video Streams SDKs which are licensed under the Apache License 2.0.