⟵ Event Info

Alternate Platform Day

PeerTube streaming guide

What is PeerTube, and why should I use it? Stream delay? Setting up a PeerTube channel Choosing an instance Creating an account Configuring your stream Setting stream properties OBS Studio setup Stream chat via Discord Donations Postscript

What is PeerTube, and why should I use it?

PeerTube is software that lets users run their own cross-compatible video sites! You can think of each PeerTube instance as a mini-YouTube, and these mini-YouTubes can share videos with one another.

However, most folks don't run their own instance, instead opting to create a channel on someone else's instance. This is a lot easier than learning how to run your own server.

PeerTube derives its name from the peer-to-peer resource sharing that makes owning an instance server financially feasible.

In November 2020, PeerTube added streaming support! The feature is still new but works quite well.

PeerTube FAQ | PeerTube stats | GitHub repo

Stream delay?

Asking around about stream delay led me to the PeerTube chat on Matrix. From lecygnenoir:

Currently there is a minimal delay of around 15-30sec when live because of [PeerTube's peer-to-peer implementation]. Torrent must be compiled then given to all peers so it's difficult to reduce it at the moment.

Delay also depends if the instance live encodes video in different resolutions or use the raw stream. In the case of live encoding, it may introduce more delay as it depends of the CPU of the instance, so to reduce delay you may disable live encoding.

Live encoding (referred to in the docs as "live transcoding") allows users to view your stream at different bitrates.

So to summarize: instances that use live encoding have a stream delay that varies depending upon server CPU capability. This is on top of peer-to-peer load, which for the time being comes with a 15-30sec baseline delay.

Setting up a PeerTube channel

I'll be using the Diode Zone instance (hosted by scanlime) for this guide. Configuration may vary slightly based on what instance you choose.

One important note from scanlime herself: avoid pushing servers to the limit. Don't stream from an instance that a bunch of users are currently streaming to, especially if that instance is small. This courtesy prevents servers from hitting their peak transcoding load.

Choosing an instance

This instance search is your friend! Framasoft, the French not-for-profit that maintains PeerTube, also maintains this list.

You can sort by a number of metrics on this page, notably:

Be wary that some PeerTube instances are dedicated to specific topics and groups. You can check the bottom-left About section of each instance for a summary of what types of content are allowed. The About page contains other instance-specific info, including whether or not the instance imposes a video quota.

If you're having trouble parsing the spreadsheet-style search results, this site offers the same results in a different format.

Once you've chosen an instance, you can move on to the next step, which is...

Creating an account

On your instance of choice, click the top-left Create an account button. Signup is a simple process with one quirk worth noting:

PeerTube makes a distinction between your account username and your channel name. These can't be the same, since on PeerTube a single account can have multiple channels (see scanlime's user page for an example).

If your add extra channels to your account, whenever you upload or stream you'll choose a channel to publish on.

Configuring your stream

Click on the top-right Publish button, then the Go live banner. Choose a channel if you've got multiple, then hit the middle Go Live button. You're not live juuust yet, all you've done is set up a stream listing.

If you accidentally lose your spot, click the left-side Videos section then the right-side Update button for your new listing.

Setting stream properties

All stream properties are quite simple, thank heavens. If you find yourself unsure of a property's use, click the little question-mark to the side. Some additional notes:

OBS Studio setup

Verify all your stream properties before beginning this step, since some properties (including thumbnail) can't be changed once you've started streaming!

This quick guide details step-by-step how to send stream output from OBS Studio to PeerTube. If you're familiar with the RTMP protocol, that's what PeerTube uses.

Stream chat via Discord

PeerTube doesn't have Twitch-style live chat (unless you're willing to interface with the video comments API), so you'll have to find a solution that works best for you and your audience.

I use Discord StreamKit Overlay to add chat functionality to my stream, though I suspect it's got some bugs. If you're not able to find a widget that'll do the job, you can always do a direct window capture of the desktop Discord application.

If I find a reliable solution, I'll update this section with details.

Donations

Donations are another bit of functionality PeerTube doesn't handle on its own. The "Support" textbox in Advanced settings lets you link to your donation platform of choice.

Depending on what donation platform you choose, setting up on-stream donation notifications will vary. A lot of folks use the Streamlabs Goal Widget to navigate this process.

If I find an open-source alternative to the aforementioned Widget, I'll be sure to update this section.

Postscript

Thank you for making it all the way to the end of this guide! If you've got any thoughts, suggestions, or additions, let me know: I'm Kube#4556 on Discord and @KubeRuns on Twitter.

A special shoutout to scanlime for bringing the perspective of a PeerTube server admin to this guide, and to lecygnenoir for help with some technical details!