Build

Starting a Live Streaming Application: PubNub and Livepeer

4 min read Markus Kohler on Jun 14, 2024
1380.png

This webinar showcases the power of real-time scalable infrastructure utilizing PubNub and Livepeer. It starts by explaining why you should build a live experience and touches on the history of live streaming and how far it has come today. We will explore the technical challenges of setting up your live streaming platform to solve these challenges by utilizing PubNub for the in-app chat/moderation and Livepeer for the video streaming content.

Why Build Live Experiences?

We see live experiences as social media platforms gain popularity. Live streaming platforms didn’t start recently; they date back to 1999 with VHS tapes, but they didn’t become popular until 2008 with the release of YouTube Live. Since then, live-streaming applications have taken a massive turn, as rather than just streaming content, viewers can interact with the streamer in all sorts of ways.

Live streaming applications offer a way for the streamer or broadcaster to interact directly with their viewers. On the other hand, they are an experience for the viewers. They allow the viewer to interact directly with the streamer or other users viewing the stream. Whether it is TikTok, Twitch, Linkedin or Zoom, we have all seen this. However, all these live-streaming platforms drastically differ in the interactions the audience members and the presenters can perform. It is never as simple as “just a broadcast,” even though that might be considered the main component that goes into these applications. Let’s explore the problems users face when building their live events platform, from the user experience to the technical challenges associated with these applications.

The Problem Associated with Building a Streaming Application

Livepeer and PubNub have identified three major problems when building a live streaming platform. However, as said before, it must feel like a cohesive experience. If anything about the experience is slow or “laggy,” it will create a challenging user experience.

Video Live Streams

In this theoretical case, many users will be watching your stream globally and delivering that video content with low latency is technically challenging. With Live streams today and user experience generally, there is a huge difference between a 1-second and 3-second delay. Users will notice if your application is lagging. On top of that, you don’t want the user to have the best internet connection in the world to stream your video content since that is an unrealistic scenario for many people worldwide. Users' Wi-Fi connection drastically changes over time, and you need a way to buffer the video or allow them to reconnect in the shortest time possible.

Scalability

You need to be able to achieve a multi-user experience, sometimes streaming to thousands or hundreds of thousands of concurrent viewers all at once. Doing this at scale and providing the same quality or the same latency is a very hard problem to solve.

The same goes for if you have a chat where you need to store the messages for the duration of the live stream and sync your databases globally while ensuring real-time transmission, which is a very unintuitive problem to solve. When you want to send a message in a stream, the message usually has the context of what the person is doing or saying. If the message is sent to everyone 5 seconds later, your message might not have the same context as you thought it did, hurting the user experience of the live stream.

Adding Interactivity 

Lastly, depending on the nature of your platform, you might want to add different ways for the streamer to send messages to your viewers or vice versa. The live streaming platform must be more exciting than just a chat and a streamer. Some examples of this are streamers being able to send polls to their audience or, as we have seen with TikTok, sending cool animated awards across the stream. With all these technical challenges and features, it becomes overwhelming for a company and its developers to manage the infrastructure and application at this stage.

Introduction to Livepeer

Livepeer Studio is a video stream platform for developers specializing in the quality, cost-effectiveness and ease of use in terms of implementing video streaming into your application. Utilizing WebRTC for delivery Livepeer ensure sub 1-second delivery on any content that is live streamed through their platform. Livepeers decentralized nature allows them to greatly reduce the cost associated with traditional cloud services. To access this functionality Livepeer offers robust APIs, and SDKs, making it easy for developers to integrate video streaming capabilities into their applications.

Livepeer can be used for a variety of different use cases, including live streaming events, video conferencing, social media platforms, e-learning and virtual events. It decentralized nature allows for easy scalability, handling large volumes of video streams without the limitations of centralized infrastructure. 

To get started with Livepeer create a free account. When you get to the dashboard navigate to streams and click “create stream”. On the dashboard you will be able to visualize the capabilities of Livepeer before implementing it into your application.

Introduction to PubNub

PubNub provides a platform that helps you build, deliver, and manage real-time capabilities for web apps, mobile apps, and IoT devices. Our customers can focus on building the features and functionality that keep users engaged because our scalable and reliable infrastructure is supported by over 15 points of presence across the globe so outages, concurrency limits, and latency issues are a thing of the past.

Key Features

PubNub provides many different features to create a truly unique interactive experience of your choice. Below you will see a list of features we used from PubNub to create the live streaming demo utilizing the Chat SDK.

  1. Pub/Sub messaging

  2. Presence

  3. Access Manager

  4. App Context

  5. Functions

Check out the Demo Application

To check out the demo that was made during the webinar visit our demos page or download the demo from our Github. This demo provides the functionality to set up your own video stream using livepeer and chat/moderation system using the PubNub Chat SDK. To read more about implement moderation into your live events application check out our how-to on adding moderation into your live events app.

0