Guidance for Deploying Smart Cameras Using Amazon Kinesis Video Streams with WebRTC
Overview
This Guidance demonstrates how to use Amazon Kinesis Video Streams with WebRTC to enable low-latency, bi-directional, peer-to-peer video streaming from home surveillance cameras. Kinesis Video Streams, a managed service for real-time video processing, can store video and other media files for replay and analytics, while WebRTC facilitates direct, low-latency connections between the camera and client applications. This Guidance allows seamless, responsive home monitoring from mobile devices or web browsers, as the peer-to-peer WebRTC connection minimizes latency and bandwidth compared to traditional client-server streaming. It also includes sample applications with the included software development kit (SDK). Camera manufacturers and connected home providers can use the SDK as a starting point to build custom camera management and viewing experiences. This helps them to more easily integrate high-quality, low-latency video capabilities into their connected home offerings and provides consumers with a reliable home monitoring experience.
How it works
Live View Smart Home Surveillance Cameras
This architecture diagram shows how use Kinesis Video Streams for WebRTC, allowing for the low-latency, bi-directional, peer-to-peer streaming of video from home surveillance cameras.

Smart Home Surveillance Camera
This architecture diagram shows how to stream video from smart home cameras to Kinesis Video Streams for storage, playback, and analytics. It also shows how to send push notifications to mobile application users to notify them of events.

Well-Architected Pillars
The architecture diagram above is an example of a Solution created with Well-Architected best practices in mind. To be fully Well-Architected, you should follow as many Well-Architected best practices as possible.
Operational Excellence
This Guidance uses Kinesis Video Streams and AWS IoT Core, which allow users to identify ways of optimizing the location event ingestion workflow and ensure the workflow can scale in the event of a large influx of new events. For instance, Kinesis Video Streams sends metrics to Amazon CloudWatch, giving users visibility into video streaming data. In addition, AWS IoT Core sends metrics to CloudWatch to monitor incoming messages and alerts when ingestion stops or slows, indicating possible network or other issues. AWS IoT Core also provides fleet management capabilities to give operators insights into connected camera status.
Security
AWS Identity and Access Management (IAM) policies scope permissions for the required AWS services to the minimum level. Kinesis Video Streams allows scoping permissions to authorized users and devices; it also protects data at rest with AWS Key Management Service (AWS KMS) and in transit with TLS. Moreover, AWS IoT Core policies control device access to MQTT topics and cloud interactions. Finally, Amazon Cognito provides authentication and authorization controls for mobile applications.
Reliability
Serverless services designed across multiple Availability Zones (AZs) provide resilience against a number of failures. Specifically, it helps to ensure data ingestion into AWS IoT Core, processing by Lambda, and storage in Amazon S3, which offers versioning, object lock, and lifecycle configuration for reliability.
DynamoDB provides features like on-demand backup, point-in-time recovery, and global tables for data sync. Also, Kinesis Video Streams is built on AWS Regions and AZs, which offer low-latency, high-throughput, and highly redundant networking. This allows applications and databases to automatically failover between AZs with higher availability, fault tolerance, and scalability than traditional data centers.
Performance Efficiency
AWS IoT Core scales to accommodate increasing message ingestion while offering low latency. Lambda enables the configuration of concurrency reservations to reduce cold start times and enhance performance. And Kinesis Video Streams automatically provisions and scales all the necessary infrastructure to ingest streaming video data from millions of devices.
Cost Optimization
Kinesis Video Streams for WebRTC reduces the need for cloud-based video streaming through peer-to-peer connectivity while providing pay-as-you-go TURN service pricing when cloud streaming is required. AWS IoT Core scales pricing with usage, enabling ongoing cost optimization by identifying goals, measuring metrics, and making incremental improvements, aided by cost tagging and billing groups. Cloud storage with Amazon S3 enables agility and cost savings through unlimited scale, storage class selection, and features like the Amazon S3 Intelligent-Tiering storage class. Similarly, DynamoDB offers cost optimization through capacity modes, table classes, and cost allocation tags.
Sustainability
The majority of services comprising this Guidance are constructed using serverless technologies, thereby reducing the required compute footprint. For instance, Lambda will only execute when invoked by AWS IoT Core, and Amazon S3 can use more energy-efficient storage volumes for long-term media storage, such as thumbnail preview images. By building upon serverless services, the overall compute usage can be diminished, enabling the construction of a fully event-driven architecture that scales up and down with traffic demands, consuming less energy during periods of lower ingestion.
Furthermore, employing Kinesis Video Streams eliminates the need to maintain steady-state applications running on instances, instead automatically provisioning and elastically scaling all the infrastructure required to ingest streaming video data from millions of devices.
Additional Resources
These additional resources can assist in the development of both camera-side applications as well as web and mobile applications. Included are links to the associated GitHub repositories containing example applications.
Amazon Kinesis Video Streams
This developer guide provides an overview of the C++ Producer Library for Amazon Kinesis Video Streams, including the key objects, features, and a 3-step procedure to use the SDK. |
|
This developer guide provides a step-by-step guide on how to set up and use the Amazon Kinesis Video Streams C++ Producer SDK on a Raspberry Pi device. |
|
This developer guide provides an example for how to use HTTP Live Streaming (HLS) to view Kinesis Video Streams, including how to retrieve an HLS streaming session URL, display the stream in a web page using various players, and troubleshoot common HLS playback issues. |
Amazon Kinesis Video Streams WebRTC
This developer guide provides instructions on how to download, build, and run the Kinesis Video Streams with WebRTC SDK in C for embedded devices, including details on supported codecs and sample applications. |
|
This developer guide provides instructions for installing, using, and customizing the Kinesis Video Streams with WebRTC SDK in JavaScript for web applications. |
|
These examples includes a framework for building mobile applications with WebRTC capabilities for Android and iOS, as well as integration with Amazon Kinesis Video Streams to enable real-time video streaming. |
Disclaimer
Did you find what you were looking for today?
Let us know so we can improve the quality of the content on our pages