This project provides a Dockerized version of the Amazon Kinesis Video Streams C WebRTC SDK, optimized for the Raspberry Pi. It allows you to build and run the SDK in a portable, containerized environment on the Raspberry Pi’s ARM64 architecture.
The Amazon Kinesis Video Streams C WebRTC SDK is a pure C implementation of a WebRTC client designed to integrate with Amazon Kinesis Video Streams. The kvs-docker
project packages this SDK and its dependencies into a Docker container, simplifying deployment and use on a Raspberry Pi for real-time video streaming applications.
Before you begin, ensure you have the following:
-
Raspberry Pi: Running a 64-bit OS, such as Raspberry Pi OS 64-bit.
-
Docker: Installed on your Raspberry Pi. To install Docker, run:
curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh
-
AWS Account: With access to Amazon Kinesis Video Streams.
-
AWS Credentials: An AWS access key ID and secret access key.
To get started with kvs-docker
, clone this GitHub repository to your Raspberry Pi:
git clone https://github.com/amansikarwar/kvs-docker.git
cd kvs-docker
To build the Docker image:
-
Navigate to the Project Directory:
cd kvs-docker
-
Build the Image: Run the following command to build the Docker image:
docker build -t kvs-webrtc-sdk-arm64 .
This creates an image named
kvs-webrtc-sdk-arm64
containing the compiled SDK and its samples.
To run the container, provide your AWS credentials and a signaling channel name via environment variables.
This sample sends H264/Opus frames over WebRTC:
docker run -it --rm \
-e AWS_ACCESS_KEY_ID=your_access_key \
-e AWS_SECRET_ACCESS_KEY=your_secret_key \
-e AWS_DEFAULT_REGION=your_region \
kvs-webrtc-sdk-arm64 \
/kvs-webrtc-sdk/build/samples/kvsWebrtcClientMaster mychannel
- Replace
your_access_key
,your_secret_key
, andyour_region
with your AWS details (e.g.,us-west-2
). mychannel
is the signaling channel name (created automatically if it doesn’t exist).
The kvsWebrtcClientMasterGstSample
sample captures video/audio from hardware devices:
docker run -it --rm \
-e AWS_ACCESS_KEY_ID=your_access_key \
-e AWS_SECRET_ACCESS_KEY=your_secret_key \
-e AWS_DEFAULT_REGION=your_region \
--device /dev/video0 \
kvs-webrtc-sdk-arm64 \
/kvs-webrtc-sdk/build/samples/kvsWebrtcClientMasterGstSample mychannel audio-video devicesrc
- Use
--device /dev/video0
to grant camera access (adjust the path as needed).
AWS_ACCESS_KEY_ID
: Your AWS access key ID.AWS_SECRET_ACCESS_KEY
: Your AWS secret access key.AWS_DEFAULT_REGION
: Your AWS region (e.g.,us-west-2
).
AWS_SESSION_TOKEN
: For temporary AWS credentials.AWS_KVS_LOG_LEVEL
: Log level (e.g.,2
for DEBUG).AWS_KVS_CACERT_PATH
: Path to a custom SSL certificate.DEBUG_LOG_SDP
: Set toTRUE
to debug SDP messages.
Example with logging:
docker run -it --rm \
-e AWS_ACCESS_KEY_ID=your_access_key \
-e AWS_SECRET_ACCESS_KEY=your_secret_key \
-e AWS_DEFAULT_REGION=your_region \
-e AWS_KVS_LOG_LEVEL=2 \
kvs-webrtc-sdk-arm64 \
/kvs-webrtc-sdk/build/samples/kvsWebrtcClientMaster mychannel
-
Device Issues: Ensure
--device
is used and check permissions (e.g., runsudo chmod 666 /dev/video0
). -
Container Logs: Run
docker logs <container-id>
to inspect runtime messages. -
Common Errors: Look for messages related to missing libraries or permission issues.
-
Network Errors: Confirm internet access and AWS endpoint reachability.
-
Build Failures: Check logs for dependency or architecture issues.
This project is licensed under the MIT License. See LICENSE for details.