Table of Contents
Part I
If you are familiar with the Streamr project you might be asking yourself: isn’t Streamr a decentralized message based protocol and not a video streaming service? Yes, you read the title right, and yes Streamr is a decentralized peer-to-peer network protocol for delivering and distributing messages, but it can also deliver any binary data within those messages.
At Streamr we are actively exploring different types of use cases for decentralized messaging and today we’ll present a use case (and a proof of concept in part II) of video streaming using Streamr protocol as transportation layer for video content.
Why is streaming important?
First of all, according to Cisco, 82 percent of global network traffic was estimated to come from consumption of video content in 2022. Downstream video traffic represents over half of global traffic, and Netflix alone was responsible for a staggering 15 percent of global internet traffic.
Secondly, video streaming at scale is costly for the streaming service providers. For example, popular video streaming service Twitch has decided to withdraw completely from the Korean market as they saw delivering live video streaming content to their Korean customers prohibitively expensive—which is quite shocking considering that Twitch stands on the shoulders of a technology giant, Amazon. But what if we could alleviate some of those costs with the Streamr technology?
How does video streaming work?
Video streaming is a technology that allows users to watch video content over the internet in real-time without having to download the entire video file. Instead of waiting for the entire video to download, video streaming enables users to access and view the content as it is being transmitted over the internet.
Video streaming is a process where before streaming, the video content is encoded and compressed to suitable video formats to ensure efficient transmission over the internet and compatibility with different devices and connection speeds.
The encoded video files are typically stored on servers or services such as content delivery networks, which are geographically distributed to ensure faster and more reliable access to content for users in different locations.
When users want to watch a video they initiate a request to access or retrieve the content by selecting a video from a streaming platform or a website. The video is then transmitted to the user’s device in small segments or chunks. As the user starts to watch the video, the streaming server sends the data in a continuous flow to the user’s device.
The user’s device, e.g. internet browser, receives and buffers a small portion of the video to ensure a smooth playback. While the user is watching that buffered segment, the device continues to receive and buffer the next segments in the background.
As long as the user’s internet connection is stable and fast enough, they can enjoy a seamless viewing experience with little to no interruptions as the video continues to be streamed and played back in real-time until the user finishes watching the content.
In this centralized video streaming and distribution pattern, when a video is being requested by a unique user, it is sent only to that user. If one million users request the same video, it’ll be sent one million times to each of them. Thus, the video distribution costs grow linearly based on network traffic.
Streaming distribution is costly
“Approximately 100 viewers for 200 hours live events each month using a high definition (HD)-1080p encoding profile is approximately $904.69 for live encoding and packaging + $2,934.00 for 36,035 GB distribution = $3,838.69 for the total of 200 hours each month.”
AWS Live streaming implementation guide
Looking at the above example calculation of live video streaming costs on AWS, the video distribution is the majority of the costs.
In the AWS live streaming implementation example, distributing 200 hours of live events each month for 100 viewers accumulates to almost 3,000 dollars of distribution costs—roughly 30 dollars per viewer.
Can decentralized technology provide a better alternative?
Utilizing Streamr technology to do the last mile of video delivery, we can potentially cut down the distribution costs to a fraction of the current model. This naturally requires a couple of changes to the video streaming process.
First, we need to integrate the Streamr client to both the edge of the cloud and to the video player itself. Secondly, we need to offer the content in P2P distribution friendly formats such as MPEG-TS.
Instead of distributing the same video content to all one hundred consumers, the consumers themselves become P2P distribution nodes as they consume the content. This approach radically lowers the amount of traffic required to distribute the content from the cloud.
In its basic configuration, every device that has integrated a Streamr client, including the Streamr node to the edge of the cloud, actively seeks to connect to content consumers and four additional devices, thus redistributing the traffic four more times. This pattern can potentially reduce the distribution traffic by an order of magnitude in the given example.
Why hasn’t this been done already?
Well, it has been tried, but developing P2P software is inherently difficult and requires substantial amounts of investment to get it done right. At Streamr, we have been working on this technical challenge since 2017, and now we are at the stage where we can start to do a more scaled user testing for P2P video streaming. If you are living in Europe or North America, you can register for our live stream testing and earn $DATA by simply tuning in to the livestream.
In the meantime, stay tuned for our second part of video streaming over Streamr blog where we’ll dive deeper on how all of this works!
About Jarno Marttila
Jarno is a DevRel Engineer at Streamr. He has been involved in crypto and Web3 space since 2013, starting the journey from mining, followed by smart contract and dApp development and now pursuing doctoral degree related to design and use of tokens in real world applications. Author of ERC-5023 shareable NFT standard and passionate about video streaming over Streamr.