PeerTube, a libre federated video streaming platform

We are currently running a crowdfunding campaign to pave the road to version 1.0 of PeerTube !

It’s now been two years since I started developing PeerTube (https://joinpeertube.org), a free and self-hosting video streaming platform, which aims to be an alternative to YouTube.

PeerTube has always been based on two fundamental principles: P2P and federation. Because hosting and distributing video is expensive, it is thus necessary to ruse to reduce and share the costs of the diffusion and storage of users’ videos. The fabulous thing is that we already have all the technology we need so anyone can participate in the creation of an alternative to YouTube, if we play a little trick and get back to the fundamentals of Internet.

Click to see the video presenting PeerTube — Medium doesn’t accept an embed video from PeerTube yet

P2P with WebTorrent

To solve the problem of bandwidth costs, or where videos that become viral (and can take down the server), PeerTube uses WebTorrent: a fantastic library, created by Feross Aboukhadijeh, that allows the use of the BitTorrent protocol directly in the web browser. This means that if several people are watching the same video at the same time, they will send chunks of that video to one another, and thus relieve the server.

Federation

Each PeerTube server (called instance) hosts its own videos and federates the metadata (name, URL description) of these videos to the other instances. The key thing is to figure out HOW to federate!

To achieve this, PeerTube implements the ActivityPub protocol. For those who aren’t familiar with it, this is a federation protocol developed by the W3C. In a nutshell, it standardizes the manner in which different instances communicate. If two different platforms can speak the same language, they can exchange information. That doesn’t sound like much, but it opens up huge possibilities for decentralized software.

Imagine if tomorrow MediaGoblin implements the ActivityPub protocol and becomes compatible with PeerTube, your friend who installed this software on their server can send the index of their videos to your PeerTube server and vice versa. You can search for any video stored on their server (or even other servers!) while comfortably remaining on your PeerTube web interface. Instead of having competing platforms, we’ll have a federated network that is more powerful thanks to collaboration. And this is a value that is dear to us in the free scene.

But this is only the tip of the iceberg. Where it gets really exciting is when two platforms with different functions communicate with each other. Picture an instance of Mastodon, a decentralized alternative to Twitter with more than a million accounts and which has already implemented the ActivityPub protocol. Now picture an instance of PeerTube with a filmmaker you like and who regularly posts videos. Wouldn’t it be great if you could follow them via your Mastodon interface, and each time they publish a video see updates in your news feed that directly contains the video? Well, this will be possible.

Where it gets really, really exciting, is that when you respond to a video status on Mastodon, the message will be sent to the instance of PeerTube. Your response will thus be visible beneath the video, in the comment space. And yes, if another person at the other end of the world responds to your comment via their instance of PeerTube or Mastodon, you’ll see it as a response to your status in Mastodon. If tomorrow Diaspora (the Facebook alternative behind Framasphere) implements ActivityPub, it will work in the same way. We’ll have plenty of platforms that are capable of federating comments.

Click to see the communication between Mastodon and PeerTube —Medium doesn’t accept an embed video from PeerTube yet

Free alternatives are criticized, often rightly, for not having added value compared to centralized platforms. With ActivityPub, we now have our first big advantage. Because on the centralized platforms, you’ll have a hard time viewing, under your YouTube video, the reactions of people who commented on Facebook, Twitter, etc. 😉

What’s next ?

Although PeerTube is just in beta for the moment, a lot of people have installed a PeerTube instance.

Its development is supported by Framasoft, a french nonprofit association that promotes free software (and very well known in french-speaking countries for the « De-google-ify Internet » campaign which propose 34 Free, Libre, Open Source Softwares alternatives to Google, Facebook, Doodle, etc), and we plan to release the first stable version of PeerTube later this year. We still have some work to do before being a viable alternative to YouTube, this is the reason why we have launched a crowdfunding campaign to finance the development of PeerTube 1.0 that would implement:

  • Interface localization
  • Video subtitles
  • Video import (YouTube videos/channels, Vimeo, Dailymotion…)
  • Video redundancy (to share bandwidth between instances or as fallback if the original instance is down)

And much more, so please share the word !

See this article if you’re still wondering why you should feel concerned about PeerTube