Friday, December 6, 2024

Mastering Real-Time Streaming with Amazon IVS

- Advertisement -

Using interactive live video experiences, live streaming is becoming an increasingly popular way to connect people with their favorite influencers and companies. Amazon Interactive Video Service (Amazon IVS), a fully managed live streaming solution, is used by our customers DeNA and Rooter to create engaging live stream and interactive video experiences for their audiences.

We launched Amazon IVS support for multiple hosts in live streams in March to enable even more flexibility in developing interactive experiences through the use of a resource called stage. A stage is a virtual arena where players can interact in real time with audio and video.

- Advertisement -

fortunately delay remains an important factor in engaging viewers and enriching the overall experience. The lower the latency, the more immediate and personal the connection with live audiences. Previously, Amazon IVS enabled real-time live broadcasting for up to 12 hosts via stages, with viewers via channels experiencing about 3-5 seconds of latency. This latency difference makes it difficult to create interactive experiences with direct involvement for larger audiences.

Introducing Amazon IVS Real-Time Streaming

Today, I’m thrilled to report that with Amazon IVS Real-Time Streaming, you can now deliver real-time live feeds to 10,000 viewers with up to 12 presenters from a stage, with latency as low as 300 milliseconds from host to viewer.

This functionality enables you to create interactive video experiences for social media applications or latency-sensitive use cases such as auctions.

Real-Time Streaming with Amazon IVS
Mastering Real-Time Streaming with Amazon IVS

You won’t need to make concessions any longer to give viewers real-time latency. Workarounds include utilizing several AWS services or other tools can be avoided. To serve real-time interactive live broadcasts, you can simply utilize Amazon IVS as a centralized service. You don’t even need to enable anything on your account to start using this functionality.

- Advertisement -

With the Amazon IVS Broadcast SDK, deliver real-time streams.

You must interact with a stage resource and utilize the Amazon IVS Broadcast SDK, which is available on iOS, Android, and the web, in order to broadcast real-time streams. Real-time latency for a stage can be as low as 300 ms, allowing users to join as viewers or hosts in the virtual area.

A stage can be used to create an environment where hosts and viewers can broadcast live content together. For instance, holding a singing competition, having several guests on a chat show, or asking viewers to participate as hosts and join other hosts in a Q&A session.

On the page titled “Add multiple hosts to live streams with Amazon IVS,” we provided a general overview of how to get started with a stage resource. Let me quickly recap the general flow and the proper way to deal with stage resources.

You must first build a stage. Both the console and the Amazon IVS API can be used to accomplish this programatically. An example of how to construct a stage using the AWS CLI and create-stage API is the command that follow.

$ aws ivs-realtime create-stage \

    –region us-east-1 \

    –name demo-realtime \

{

    “stage”: {

        “arn”: “arn:aws:ivs:us-east-1:xyz:stage/mEvTj9PDyBwQ”,

        “name”: “demo-realtime”,

        “tags”: {}

    }

}

A participation token is a fundamental idea for a stage resource that permits players to join as a presenter or a viewer. An authorization token known as a participation token enables your participants to post content or subscribe to a stage. By leveraging attributes, such as unique user IDs and their display names, you can construct a participation token and add more details when using the create-stage API. Participants’ tokens and stage information are returned by the API.

$ aws ivs-realtime create-stage \

    –region us-east-1 \

    –name demo-realtime \

    –participant-token-configurations userId=test-1,capabilities=PUBLISH,SUBSCRIBE,attributes={demo-attribute=test-1}

{

    “participantTokens”: [

        {

            “attributes”: {

                “demo-attribute”: “test-1”

            },

            “capabilities”: [

                “PUBLISH”,

                “SUBSCRIBE”

            ],

            “participantId”: “p7HIfs3v9GIo”,

            “token”: “TOKEN”,

            “userId”: “test-1”

        }

    ],

    “stage”: {

        “arn”: “arn:aws:ivs:us-east-1:xyz:stage/mEvTj9PDyBwQ”,

        “name”: “demo-realtime”,

        “tags”: {}

    }

}

You can use the API to programmatically create participant tokens in addition to the create-stage API. PUBLISH and SUBSCRIBE are the two capability values that are currently available for a participant token. When establishing the participant token, you must include a PUBLISH capability if you wish to invite a participant to host. Your host’s audio and video can be added to a stream using the PUBLISH attribute.

Here’s a sample of how to create a participant token.

$ aws ivs-realtime create-participant-token \

    –region us-east-1 \

      –capabilities PUBLISH \

      –stage-arn ARN \

      –user-id test-2

{

    “participantToken”: {

        “capabilities”: [

            “PUBLISH”

        ],

        “expirationTime”: “2023-07-23T23:48:57+00:00”,

        “participantId”: “86KGafGbrXpK”,

        “token”: “TOKEN”,

        “userId”: “test-2”

    }

}

If a participant token has been created, it must be distributed to each client using, for instance, a WebSocket message. Then, using the Amazon IVS Broadcast SDK in your client applications, you can use this participant token to allow your users to join the stage as hosts or watchers. You can watch and examine the example demo for iOS or Android, as well as the supporting serverless applications for real-time demo, to find out more about how you can interact with a stage resource.

Right now, you can use a stage to broadcast real-time live feeds to 10,000 spectators. You can utilize your stage as the input for a channel and the Amazon IVS Low-Latency Streaming feature if you need to expand the stream to a larger audience. With a channel, you can send millions of users high concurrency video from a single source with low latency—up to 5 seconds. The Amazon IVS Broadcast SDK documentation page, which includes details for iOS, Android, and the web, contains further information on how to publish a stage to a channel.

Amazon IVS Real-Time Streaming Capability with Layered Encoding

Customers want live streams that are of high quality. However, a number of variables, including the strength of their network connections and the efficiency of their devices, affect the live stream’s quality.

The most frequent case is that viewers will only see a single version of the video, which is larger than their ideal viewing environment. For instance, viewers with fast connections can enjoy the live broadcast if the host can provide high-quality video, but viewers with slower connections would encounter loading issues or perhaps be unable to view the videos. However, viewers with fast connections will see less-than-optimal footage while those with slower connections will have a better experience if the host can only create low-quality video.

AMAZON IVS
image credit to aws

With this announcement, we also made the layered encoding option for Amazon IVS Real-Time Streaming available in order to fix the problem. When you publish to a stage using multilayer encoding (also known as simulcast), Amazon IVS will instantly deliver several versions of the video and audio. By doing this, you can be confident that your visitors will be able to watch the stream in the highest possible quality given their network setup.

Real-Time Streaming with Amazon IVS
image credit to aws

Customer feedback

Customers provided us with a lot of input regarding Amazon IVS Real-Time streaming during the private preview period.

Whatnot is a live streaming marketplace and shopping platform that connects collectors and enthusiasts with their local communities to purchase and sell the things they’re passionate about. One of our main engineering challenges is expanding live video auctions to our global community. The integrity and thrill of our auction experience depend on ensuring real-time latency. We can reliably extend our operations globally by utilizing Amazon IVS Real-Time Streaming, ensuring a smooth and excellent real-time video experience throughout our entire user base, whether on web or mobile platforms. Director of Engineering Ludo Antonov.

Now available

All AWS Regions where Amazon IVS is offered also offer Amazon IVS Real-Time Streaming. You pay an hourly charge for the time that hosts or viewers are connected to the stage resource as a participant while using Amazon IVS Real-Time Streaming.

On the Amazon IVS page, you can find out more about the advantages, use cases, starting procedures, and costs for the Real-Time Streaming and Low-Latency Streaming features.

- Advertisement -
agarapuramesh
agarapurameshhttps://govindhtech.com
Agarapu Ramesh was founder of the Govindhtech and Computer Hardware enthusiast. He interested in writing Technews articles. Working as an Editor of Govindhtech for one Year and previously working as a Computer Assembling Technician in G Traders from 2018 in India. His Education Qualification MSc.
RELATED ARTICLES

Recent Posts

Popular Post

Govindhtech.com Would you like to receive notifications on latest updates? No Yes