Product updates · 6 min read

Low latency livestreaming with api.video

Stream smarter, not slower: Introducing low latency livestreaming

Learn how low latency live streaming with api.video can impact your viewers' experience drastically.

Arushi Gupta

June 6, 2024

After hearing from our customers about the need for low latency livestreaming, we at api.video have been relentlessly chasing seconds of latency everywhere, from ingest to delivery. Having already provided the best performance for on-demand delivery in terms of playback and encoding, we're excited to announce our latest upgrade: low latency livestreaming!

 

Keeping true to our core belief of making video easy and manageable for you, we've rolled out the public beta of livestreaming with latency as low as 3 seconds. Now, you can stream your videos with a latency of 3 seconds in ideal conditions, revolutionizing the way you connect with your audience.

What does this mean for you?

With this latest upgrade, you can stream your videos live with a minimal delay of 3 seconds. This means that you can ensure better interaction with your viewers, lower bounce offs due to viewer frustration and a smoother viewing experience.

 

Additionally, you also get the flexibility to push a livestream using Real-Time Messaging Protocol (RTMP) or Secure Reliable Transport (SRT) protocol based on your needs.

 

How do you choose between SRT or RTMP protocols? Read on!

How can your business benefit from low latency?

Several use cases benefit significantly from low latency in livestreaming:

1. Esport livestreams

Low latency livestreaming is crucial for esports viewing as it ensures real-time action with minimal delay, providing a more immersive and engaging experience for fans. It allows viewers to stay in sync with live events, participate in interactive chats, and react instantly to game-changing moments. This immediacy becomes crucial to build the excitement and zeal of watching an esport live, making viewers feel as if they are right there in the arena.

 

Additionally, top level games that are being broadcast all over the globe and possess official data feeds are where the issues of latency have the biggest impact. It can be unfair for punters who are watching and betting on the event as the stream does not reflect what is actually happening on the field.

 

As opposed to online gaming where latency as low as 25 miliseconds is ideal, esport broadcasting industry usually has a latency of under 10 seconds.

2. Live events and concerts

For virtual concerts, conferences, and other live events, low latency is crucial for delivering a seamless viewing experience to remote audiences. By minimizing delay, organizers can create a sense of presence and immersion, allowing viewers to feel like they're part of the action, even from afar.

3. Webinars and workshops

Low latency live streaming can significantly enhance webinars and workshops by providing an interactive experience for participants. With reduced delay between the presenter and the audience, feedback, questions, and discussions can take place with ease. The low latency here helps instructors or guest speakers of the webinar to adapt their content on the fly based on audience input. In case a webinar is being streamed live and is also happening in-person, the minimal delay for the virtual audience keeps the whole event synchronised.

4. Telehealth and live patient monitoring

A good usage of low latency livestreaming in the healthcare industry is for remote patient monitoring and live consultations. These demand streaming capabilities with minimal delays to ensure the highest quality of care. For individual healthcare professionals and hospitals that offer this service, being able to monitor and interact with patients live is crucial for accurately assessing symptoms, providing diagnoses, and making treatment decisions within time. Delays or interruptions in the video feed in this scenario may hinder the communication between patients and providers, which shows the relevance low-latency streaming holds in this space.

How to livestream with api.video: Step-by-step guide

  • In order to establish a video livestream, you must first create a livestream container at api.video.
  • Then, you can begin streaming with the tool of your choice.
  • For this guide, we’ll see how you can create a live stream with OBS – free and open source software for video streaming.

Step 1: Authenticate

You need an access_token in order to create and upload a video.

 

You will need your API key to obtain the access_token. You’ll find your API key in your api.video dashboard.

 

(This guide uses the sandbox endpoint. To upload your video in production, simply replace all sandbox.api.video instances with ws.api.video.)

 

First, call the authentication endpoint and get your access token.  

Example - Curl Request

bash

Example - Http Request

javascript

Example - Json Response

javascript

Step 2: Create the livestream

Now we create the live stream. In the JSON parameter, feel free to edit the name of the live stream from "Your Stream Name" to whatever you want to name your stream.

 

Example - Curl Request

javascript

Example - Json Response

javascript

Now the server is ready to accept our live stream, and once broadcast begins (JSON above shows broadcasting:false), it will be viewable on the URLs listed in the JSON response.

Connecting live video

The JSON response above lists your live stream's streamKey, which will be needed in OBS to connect your video to the server.

 

Now in the OBS application,

  1. Establish a source. In the sources section, choose a video feed to share. You could choose to share your screen, or to share your camera (on a Mac: Video Capture Device, and then in the "Device" dropdown choose the camera). You should now see the video source in the main OBS window.
  2. Connect OBS to api.video. Under Settings, choose Stream. You'll see a choice for service - choose custom.
  3. The server should be rtmp://broadcast.api.video/s and the streamKey is the value you received in the Json when you created the stream. Click OK to accept the changes.
  4. Press ‘Start Streaming’.
  5. Share the embed, iFrame, so that others can watch your stream!

javascript

Note: Please note that the provided URLs are not in low latency by default as this is a beta release. To stream your livestream with low latency in beta, you need to add an extra ?ll parameter at the end of each of the above.

Player support for low-latency livestreaming

We are pleased to announce that our low-latency livestreaming feature has been thoroughly tested with several popular video players to ensure optimal performance and seamless integration. The players we have tested include:

 

  • api.video embed player
  • THEOplayer 7.4.1
  • Video.js 8.14.0
  • hls.js 1.5.11
  • JW Player 8.34.1

 

These players have been verified to support low-latency streaming. However, if you encounter any issues with a specific player, please reach out to our support team through chat with detailed information about the problem.

 

As this is a beta release, we highly value and appreciate any feedback you can provide to help us improve our services. Your insights and experiences are crucial to identifying potential issues, enhancing features, and ensuring the overall quality and performance of our product.

 

To start livestreaming with api.video, sign-up now! For questions, talk to our team and we’ll try to answer your queries.

Try out more than 80 features for free

Access all the features for as long as you need.
No commitment or credit card required

Video API, simplified

Fully customizable API to manage everything video. From encoding to delivery, in minutes.

Built for Speed

The fastest video encoding platform. Serve your users globally with 140+ points of presence. 

Let end-users upload videos

Finally, an API that allows your end-users to upload videos and start live streams in a few clicks.

Affordable

Volume discounts and usage-based pricing to ensure you don’t exceed your budget.