DEV Community

Cover image for Broadcasting to an Amazon IVS Real-Time Stream with WHIP from OBS

Broadcasting to an Amazon IVS Real-Time Stream with WHIP from OBS

Todd Sharp on February 22, 2024

Until recently, broadcasting to an Amazon Interactive Video Service (Amazon IVS) real-time stage required developers to utilize one of our Broadcas...
Collapse
 
mavipe profile image
Matthew

Thank you Todd for this great article.

Following the instructions detailed in the post I've been able to broadcast video to an Amazon IVS real-time stage using WHIP with OBS, Gstreamer and JavaScript in the browser.

For my use case, I only want to broadcast audio. When I try to publish an audio-only stream, by following the same steps and simply omitting the video part from the configurations, I get a 400 Bad Request response from the live-video.net/publish endpoint, with the body: {"code":2001,"message":"failed to create publisher session"}.

Is this a limitation of WHIP or IVS, and is there a workaround?

Collapse
 
recursivecodes profile image
Todd Sharp AWS

Let me check on this and get back to you!

Collapse
 
mavipe profile image
Matthew • Edited

Thanks Todd.

I've forked the amazon-ivs-stage-recorder example repo and made some changes to demonstrate this issue: github.com/mattvick/amazon-ivs-sta...

The README.md file explains how to run the code to see the error response, and how adding a video codec and transceiver remedies the issue.

Let me know if you have any questions, or maybe you can see from the code that I'm doing something wrong.

Thread Thread
 
recursivecodes profile image
Todd Sharp AWS

Very helpful, thank you. As a workaround, did you try adding a video track? It doesn't have to send any frames.

Thread Thread
 
mavipe profile image
Matthew

Thanks, that's a good idea. And I can confirm that adding a video track removes the error.

I know there is a big difference in pricing between IVS video and audio. Will adding a video track cause the stage time to be billed as video rather than audio?

Thread Thread
 
recursivecodes profile image
Todd Sharp AWS • Edited

I think if you just pass an (empty) video track in the SDP negotiation, you'll be OK. You won't need to send blank video frames, I think the issue only lies in the SDP negotiation.

Collapse
 
mentorisen profile image
mentoRisen

This is amazing, but I couldn't make it work. I did all configuration of OBS and whatever I do I still get "Failed to Connect: Could not access the specified channel or stream key...". In OBS logs I can see Connect failed: HTTP endpoint returned response code 404.
So I tried GStreamer and I end up in similar spot. GStreamer cannot connect to IVS and error that I get is Unexpected response: 404 - {"code":2011,"message":"action ID not found"}. There is nothing in documentation about error 2011 nor action ID.
I ran out of ideas what can I try to fix it so any suggestions would be very appreciable.

Collapse
 
recursivecodes profile image
Todd Sharp AWS

It sounds like you were trying to broadcast to a low-latency channel as opposed to a real-time stage. Can you confirm that you were using a stage, and not a channel? If so, double check the ingest endpoint and the token.

Collapse
 
lukas_zemcak_3d0e7c09c26a profile image
Lukas Zemcak

Thanks for reply. Actually no, we were trying to use real-time and all of our configuration and libraries was ok. Problem was on our AWS account settings. On brand new AWS account everything worked perfect. We contacted AWS team and reason was that we had simulcast enabled on our real-time stages. AWS support confirmed that we cannot use WHIP and simulcast on same stages. After they disabled simulcast WHIP works. They are working on some solution to this, but this issue should occur only if you have simulcast enabled for real-time streaming stages.

Thread Thread
 
recursivecodes profile image
Todd Sharp AWS

Ahh, interesting. Thanks for letting me know, I was not aware of this.