Skip to main content
Skip table of contents

REUSE - Admin A/V Product Team What To expect (IVS)

This documentation is extracted from and summarizes Amazon Interactive Video Service (IVS) documentation specifically tailored for clients setting up Amazon IVS streaming on the JUNO platform. For more in-depth information, it's recommended to refer to Amazon's official IVS documentation.

Amazon IVS simplifies global video streaming by handling video processing, delivery, and playback. Streamers on the JUNO platform only need to focus on stream production, while IVS manages ingest, transcoding, and player functionality. This guide primarily targets developers looking to integrate IVS streaming into their applications, starting with basic setups or fully-equipped studios. The document provides insights into configuring video encoders for an optimal IVS streaming experience.

Prerequisites

To begin with IVS Low-Latency Streaming, follow the Getting Started steps. This process involves creating a channel and configuring streaming settings. You'll receive a channel ARN (Amazon Resource Name), a stream key, and URLs for stream ingestion and playback. It's crucial to direct your streaming application to the ingest URL.

Before diving in, it's essential to have a good grasp of:

  1. Amazon IVS fundamentals: This includes understanding What is IVS Low-Latency Streaming and following the instructions in Getting Started with IVS Low-Latency Streaming.

  2. Amazon IVS API: Familiarize yourself with the IVS Low-Latency Streaming API Reference for a comprehensive understanding of the API.

Reducing latency

To achieve reduced latency in Amazon IVS low-latency streaming, you'll need to adjust your streaming application configuration. The Amazon IVS player is essential for achieving the lowest latency, as third-party HLS video players are not supported. Refer to the Amazon IVS Player SDK documentation for details.

To prepare your streaming application for low-latency streaming, follow these steps (please note that not all options may be available in every streaming application):

  1. Adjust the video encoder settings by setting IDR/Keyframe to a 2-second interval (or 1 second for lower end-to-end latency).

    • This choice significantly impacts stream startup timing and latency of related EventBridge events like Stream Start and Recording Start. With a 2-second IDR/Keyframe interval, stream-start latency is approximately 6-7 seconds, while a 1-second interval results in a latency of approximately 3-4 seconds.

    • Remember that your video becomes available to viewers and auto-records to Amazon S3 only after the initial stream-start latency period.

  2. Be aware that opting for a shorter 1-second keyframe interval may affect quality of service (QoS) due to more frequent resolution changes and smaller segment sizes, potentially leading to increased buffering.

    • Consider these tradeoffs when deciding between a 1 or 2-second keyframe interval.

  3. Avoid setting IDR/Keyframe intervals higher than 5 seconds, as this increases stream-start latency and may lead to issues like decode errors or visual distortions for viewers during playback or rendition changes.

  4. If available, configure your encoder for zero-latency tuning within an x264 configuration.

  5. Ensure the buffer size (VBV) does not exceed the stream's average bitrate (in kilobits per second).

Do not use Third-Party streaming/forwarding services

Amazon strongly advises against using third-party streaming or forwarding services to relay content to Amazon IVS, which will introduce extra latency. For optimal low latency, stream directly to Amazon IVS.

Encoder settings

Stream Ingest: Codecs, RTMPS, and Port 443

Amazon IVS supports specific codecs for video and audio: H.264 for video and AAC (LC) for audio.

Amazon IVS employs the RTMPS protocol (Real-Time Messaging Protocol over TLS/SSL) for secure ingest. It's crucial to note that Amazon IVS streaming and playback require TLS version 1.2 or later.

To connect your video encoder to Amazon IVS ingest, you must use the RTMPS protocol on outbound port 443/TCP. Specify an IVS ingest server in the following format:

rtmps://<IVS-ingest-server>/<IVS-stream-key>

RTMPS example:

rtmps://a1b2c3d4e5f6.global-contribute.live-video.net:443/app/<IVS-stream-key>

While IVS channels can be configured to allow insecure RTMP ingest, it's recommended to use RTMPS unless specific, verified use cases require RTMP.

When using RTMP, ensure the protocol is set to rtmp:// and omit the :443 port.

RTMP example:

rtmp://a1b2c3d4e5f6.global-contribute.live-video.net/app/<IVS-stream-key>

Regarding resolution, bitrate, and FPS (frames-per-second), the stream's resolution significantly influences these factors. Here are some recommended guidelines to follow. Please note that the resolutions mentioned are for landscape orientation; adjust accordingly for portrait orientation.

Acceptable Quality (SD) 480p (852x480)

Good Quality (HD) 720p (1280x720)

High Quality (Full HD) 1080p (1920x1080)

Bitrate

Up to 1500 Kbps

Up to 4500 Kbps

Up to 8500 Kbps

FPS

30

30 or 60

30 or 60

Keyframe interval

2 seconds

2 seconds

2 seconds

Bitrate, frames per second (FPS), and resolution in video streaming are closely connected. The ideal values can be complex to determine and depend on various factors. Amazon recommends starting with the values mentioned earlier and experimenting if needed. The primary goal is to achieve smooth and clear motion in video streaming while maintaining good resolution within the available bandwidth. It's essential to note that increasing the frame rate and/or resolution can enhance video quality, but the available bandwidth limits this.

Amazon IVS supports frame rates up to 60 FPS, including European PAL standards of 25 and 50 FPS. Higher frame rates generally improve quality, provided sufficient bitrate bandwidth supports them. However, depending on the specific application, a lower frame rate may be suitable, such as for a security camera setup.

Video settings

  • Recommended settings for video encoding include:

    • IDR/Keyframe: Set to a 2-second interval (or 1 second for lower latency).

    • H.264 level: Main.

    • Scene change: Off (preferred).

    • Chroma subsample: YUV420P.

    • CABAC: Preferred.

    • ColorSpace: BT.709 (recommended for compatibility with HDTVs and computer displays). Advanced users can explore other ColorSpace options.

Audio settings

  • Supported audio settings include:

    • Codec: AAC (LC).

    • Bitrate: 96 Kbps to 320 Kbps.

    • Sample rate: 44.1 Khz or 48 Khz (matching your production audio flow).

    • Channels: Maximum 2 - Stereo (1: mono or 2: stereo audio channel support).

Rate-Control method

  • Always use CBR (Constant BitRate), not VBR (Variable BitRate), for encoding. CBR is more suitable for networks with fixed bandwidth, ensuring stable video playback for viewers. VBR can result in bitrate spikes and frame drops.

Progressive signals

  • Utilize progressive signal flows and avoid interlaced video in production and encoding. Progressive signals offer better playback quality without motion artifacts compared to interlaced signals.

Network requirements

  • Maintain a stable internet connection with consistent upload speed to prevent stream stuttering and lag for viewers.

  • Prefer wired connections over WiFi or LTE to minimize interference and latency.

  • Allocate 50% more bandwidth than the minimum required to account for bitrate fluctuations during encoding.

  • Consider using a dedicated Internet VLAN for encoding machines to avoid disruptions from network traffic, bandwidth bottlenecks, and security concerns.

work cited

Amazon Web Services. (2023). Amazon IVS Streaming Configuration. AWS. https://docs.aws.amazon.com/ivs/latest/LowLatencyUserGuide/streaming-config.html

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.