[SEO Subhead]
This Guidance demonstrates betting and gaming setups that deliver video and data streams at low latencies using Amazon Interactive Video Service (Amazon IVS). As an online sports betting or casino content provider, you need to deliver your live streaming workloads to customers worldwide with the lowest possible latency. This Guidance provides multiple latency-optimized configurations for connecting all the required components, from studio to consumer, to enable low-latency delivery.
Please note: [Disclaimer]
Architecture Diagram
-
Less than 300 millisecond latency
-
Sub 2 second latency
-
2–5 second latency
-
3–5 second latency
-
Less than 300 millisecond latency
-
This architecture diagram shows how to build a betting and gaming architecture to deliver video and data streams with lower than 300ms latency using Amazon Interactive Video Service (Amazon IVS).
Step 1
Live video is captured from mobile or desktop source devices integrated with the Amazon Interactive Video Service (Amazon IVS) Real-Time Streaming broadcast SDK. It is then encoded and sent as an input to an Amazon IVS stage. An encoder device or an application like OBS Studio can also send video.Step 2
Amazon IVS receives the encoded video through Real Time Messaging Protocol (RTMP) over a TLS/SSL connection (RTMPS), WebRTC-HTTP ingestion protocol (WHIP), or WebRTC.
Step 3
Game metadata is sent to a REST API layer for additional storage and processing and to a player. AWS Direct Connect uses a dedicated connection for a secure and low-latency data (REST or WebSocket) transfer between your on-premises studio and AWS.Step 4
Amazon Elastic Kubernetes Service (Amazon EKS) processes REST APIs and WebSockets for game metadata, lobby or chat, and API functionality. It handles players’ API calls and maintains WebSocket connections to players for dealer module messages.Step 5
Network Load Balancer offers ultralow latencies for latency-sensitive applications to process API communication between players and the application. The timed metadata is sent to the Amazon IVS endpoint.Step 6
Amazon CloudFront acts as an endpoint for inbound data flow and customer API requests during the video stream.Step 7
AWS WAF protects the endpoints and APIs from distributed denial of service (DDoS) attacks.Step 8
Players maintain WebSocket connections to the backend API for lobby or chat and game action calls.
Step 9
The Amazon IVS player on the client device receives the video stream and metadata. The video and metadata are sent to client applications running the Amazon IVS broadcast SDK through WebRTC. Your viewers can watch live streams globally through the Amazon IVS content delivery network. The Amazon IVS broadcast SDK optimizes performance, reducing the impact on your app and on user devices.
-
Sub 2 second latency
-
This architecture diagram shows how to build a betting and gaming architecture to deliver video and data streams with sub 2 second latency using Amazon IVS.
Step 1
Direct Connect uses a dedicated connection for secure and low-latency data (REST or WebSocket) and video (RTMPS or SRT) transfer between your on-premises studio and AWS.
Step 2
Applications based on Amazon Elastic Compute Cloud (Amazon EC2), like Nginx and Ffmpeg, process video and transcode it into adaptive bitrate streaming–supported HLS, LL-HLS, CMAF, and DASH protocols. Amazon EC2 is chosen over containers to reduce any potential network impact on video latency.1Step 3
Amazon EKS processes REST APIs and WebSockets for game metadata, lobby or chat, and API functionality. It handles players’ API calls and maintains a WebSocket connection to players for dealer module messages.
Step 4
Network Load Balancer offers ultralow latencies for latency-sensitive applications and distributes the traffic for API metadata services to enable scaling and route traffic to healthy endpoints.
Step 5
CloudFront distribution delivers your live stream to viewers with low latency and high transfer speeds by using http-based protocols like HLS, LL-HLS, DASH, and CMAF. It also acts as an endpoint for customer API requests during the video stream.
Step 6
AWS Global Accelerator distributes LL-HLS, DASH, maximum segment size (MSS), WebRTC, or CMAF video traffic to consumers.22 Improving Real-Time Communication (RTC) Client Experience with AWS Global Accelerator
Step 7
The consumer receives the data and video streams through public endpoints and performs synchronization using video timestamps.
Step 8
AWS WAF protects the endpoints and APIs from DDoS attacks.
Step 9
Players maintain WebSocket connections to the backend API for lobby or chat and game action calls.
-
2–5 second latency
-
This architecture diagram shows how to build a betting and gaming architecture to deliver video and data streams with 2-5 second latency using Amazon IVS.
Step 1
Live video is captured from mobile or desktop source devices integrated with the Amazon IVS broadcast SDK. It is then encoded and sent as an input to an Amazon IVS video ingest server. An encoder device or an application like OBS Studio can also send video.
Step 2
Amazon IVS handles video processing (ingesting and transcoding) and synchronizes the metadata with the audio and video frames. As a result, all viewers get the metadata at the same time, relative to the stream.
Step 3
Amazon IVS HTTP Live Streaming (HLS) playback delivers the live stream and metadata to the Amazon IVS player on a client’s device through the HLS protocol.
Step 4
Direct Connect uses a dedicated connection for a secure and low-latency data (REST or WebSocket) transfer between your on-premises studio and AWS.
Step 5
Amazon EKS processes REST APIs and WebSockets for game metadata, lobby or chat, and API functionality. It handles players’ API calls and maintains WebSocket connections to players for dealer module messages.
Step 6
Network Load Balancer offers ultralow latencies for latency-sensitive applications to process API communication between players and the application. The timed metadata is sent to the Amazon IVS endpoint.
Step 7
CloudFront acts as an endpoint for inbound data flow and customer API requests during the video stream.
Step 8
AWS WAF protects endpoints and APIs from DDoS attacks.
Step 9
Players maintain WebSocket connections to the backend API for lobby or chat and game action calls.
Step 10
The Amazon IVS player on the client device receives the video stream and metadata. Your viewers can watch live streams globally through the Amazon IVS content delivery network. The Amazon IVS broadcast SDK optimizes performance, reducing the impact on your app and on user devices.
-
3–5 second latency
-
This architecture diagram shows how to build a betting and gaming architecture to deliver video and data streams with 3-5 second latency using Amazon IVS.
Step 1
Live video is captured from mobile or desktop source devices, encoded, and sent as an input to AWS Elemental MediaLive.Step 2
Direct Connect uses a dedicated connection for secure and low-latency data (REST or WebSocket) and video (RTMPS or Secure Reliable Transport (SRT)) transfer between your on-premises studio and AWS.
Step 3
The video is ingested to MediaLive through the provided endpoint with the following protocols supported: URL_PULL, RTMP_PUSH, RTMP_PULL, and RTP_PUSH.
Step 4
AWS Elemental MediaPackage ingests the MediaLive adaptive bitrate output and packages the live stream into HLS, Dynamic Adaptive Streaming over HTTP (DASH), and Common Media Application Format (CMAF) protocols. These are then delivered to three MediaPackage custom endpoints.1Step 5
Amazon EKS processes the REST APIs and WebSockets for game metadata, lobby or chat, and API functionality. It handles players’ API calls and maintains WebSocket connections to players for dealer module messages.
Step 6
Network Load Balancer offers ultralow latencies for latency-sensitive applications and distributes the traffic for API metadata services to enable scaling and route traffic to healthy endpoints.
Step 7
CloudFront acts as an endpoint for inbound data flow and customer API requests during the video stream. A CloudFront distribution uses the MediaPackage custom endpoints as its origin and delivers your live stream to viewers using http-based protocols such as HLS, low-latency HLS (LL-HLS), DASH, and CMAF.
Step 8
AWS WAF protects endpoints and APIs from DDoS attacks.
Step 9
Players maintain WebSocket connections to the backend API for lobby or chat and game action calls.
Get Started
Well-Architected Pillars
The AWS Well-Architected Framework helps you understand the pros and cons of the decisions you make when building systems in the cloud. The six pillars of the Framework allow you to learn architectural best practices for designing and operating reliable, secure, efficient, cost-effective, and sustainable systems. Using the AWS Well-Architected Tool, available at no charge in the AWS Management Console, you can review your workloads against these best practices by answering a set of questions for each pillar.
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
Amazon CloudWatch monitors the performance and health of the video streaming infrastructure, enabling proactive identification of performance bottlenecks and other production issues. CloudFront acts as a content delivery network, improving the reliability and speed of content delivery to end users. And Direct Connect provides a dedicated network connection, enhancing the stability and predictability of data transfer between on-premises and AWS environments. Additionally, this Guidance uses MediaLive, MediaPackage, and Amazon IVS for video processing and streaming. Together, these managed services enable efficient monitoring, reliable content delivery, low-latency network connectivity, and a repeatable deployment model.
-
Security
This Guidance uses managed services that provide secure endpoints, encryption by default, and least-privilege access policies to protect data and video livestreams. For example, CloudFront provides DDoS protection and SSL/TLS encryption for data in transit. Amazon IVS, which does not store data, encrypts data in transit through HTTPS API endpoints using server-side encryption. Global Accelerator also provides traffic encryption and access controls and integrates with AWS Shield Standard. Additionally, Direct Connect enhances data transfer security by establishing a dedicated, private network connection between your on-premises infrastructure and AWS. AWS WAF then lets you define unexpected access-based criteria to filter. Finally, AWS Identity and Access Management (IAM) policies are scoped down to the minimum permissions required, limiting unauthorized access to resources.
-
Reliability
This Guidance uses services that provide a robust, scalable, managed, and fault-tolerant architecture. For example, the CloudFront global network maintains content availability, even if one AWS Region experiences issues. The Network Load Balancer improves application availability by distributing traffic across multiple targets and improving fault tolerance. Additionally, MediaLive, MediaPackage, and Amazon IVS work together to provide reliable video processing, packaging, and delivery with built-in redundancy to handle potential failures. Finally, Amazon EKS supports easy scaling of backend services to meet varying demand, enhancing the overall reliability of the system. Together, these services create a highly available and resilient infrastructure capable of handling the high-traffic demands of real-time video streaming and betting operations.
-
Performance Efficiency
This Guidance uses services designed to handle the demands of low-latency video streaming and real-time betting applications. For example, Direct Connect ensures stable and fast connectivity between on-premises systems and AWS, crucial for live video ingestion. And as a global content delivery network, CloudFront minimizes latency for delivery to users worldwide. Additionally, MediaLive, MediaPackage, and Amazon IVS provide an optimized video processing and delivery pipeline, reducing encoding and packaging times while maintaining high-quality streams. Global Accelerator further enhances performance by intelligently routing user traffic to the nearest point of presence. Together, these services deliver smooth, low-latency video streams and responsive betting experiences to users, regardless of their geographic locations.
-
Cost Optimization
This Guidance uses flexible, scalable services that align costs with actual usage. For example, CloudFront and Global Accelerator provide pay-as-you-go pricing for content delivery, and MediaLive and MediaPackage use an on-demand model for video processing and packaging. Likewise, Amazon IVS uses pay-per-minute pricing for live video streaming. Additionally, Amazon EKS enables efficient resource utilization through containerization, potentially lowering compute costs compared to traditional server deployments. Finally, the CloudFront global network removes the need for maintaining multiple content distribution points, reducing infrastructure costs. And because all these services can automatically scale based on demand, you can optimize costs during periods of varying traffic.
-
Sustainability
This Guidance uses managed services like CloudFront, MediaLive, MediaPackage, and Amazon IVS, which automatically scale for demand, minimizing unnecessary resource consumption. Additionally, these services provide self-managed data planes that facilitate low-latency delivery of high-quality images without needing separate points of presence, reducing your carbon footprint.
Related Content
[Title]
Disclaimer
The sample code; software libraries; command line tools; proofs of concept; templates; or other related technology (including any of the foregoing that are provided by our personnel) is provided to you as AWS Content under the AWS Customer Agreement, or the relevant written agreement between you and AWS (whichever applies). You should not use this AWS Content in your production accounts, or on production or other critical data. You are responsible for testing, securing, and optimizing the AWS Content, such as sample code, as appropriate for production grade use based on your specific quality control practices and standards. Deploying AWS Content may incur AWS charges for creating or using AWS chargeable resources, such as running Amazon EC2 instances or using Amazon S3 storage.
References to third-party services or organizations in this Guidance do not imply an endorsement, sponsorship, or affiliation between Amazon or AWS and the third party. Guidance from AWS is a technical starting point, and you can customize your integration with third-party services when you deploy the architecture.