Skip to content

Dockerized Amazon Kinesis Video Streams WebRTC SDK optimized for Raspberry Pi ARM64, enabling easy deployment of real-time video streaming applications.

License

Notifications You must be signed in to change notification settings

AmanSikarwar/kvs-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Amazon Kinesis Video Streams C WebRTC SDK for Raspberry Pi (Dockerized)

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.

Introduction

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.

Prerequisites

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.

Cloning the Repository

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

Building the Docker Image

To build the Docker image:

  1. Navigate to the Project Directory:

    cd kvs-docker
  2. 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.

Running the Container

To run the container, provide your AWS credentials and a signaling channel name via environment variables.

Running the kvsWebrtcClientMaster Sample

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, and your_region with your AWS details (e.g., us-west-2).
  • mychannel is the signaling channel name (created automatically if it doesn’t exist).

Running GStreamer-Based Samples

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).

Environment Variables

Required

  • 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).

Optional

  • 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 to TRUE 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

Troubleshooting

  • Device Issues: Ensure --device is used and check permissions (e.g., run sudo 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.

License

This project is licensed under the MIT License. See LICENSE for details.

About

Dockerized Amazon Kinesis Video Streams WebRTC SDK optimized for Raspberry Pi ARM64, enabling easy deployment of real-time video streaming applications.

Topics

Resources

License

Stars

Watchers

Forks