⟵ Back to Blog

PeerTube streaming guide

March 26th, 2021

The blog post below is a step-by-step guide to streaming on PeerTube. This is a slightly-updated mirror of our original guide from Alternate Platform Day.

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

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

We chose Diode Zone as our host for the SRROC APD Marathon, which worked out phenomenally well!

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.

We're also biased towards our own PaceRIP PeerTube instance, a streaming-only instance without live transcoding or VODs.

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 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.

Discord StreamKit Overlay can display a channel's messages on your stream, though as of writing it's quite buggy. There's a better solution anyways: directly capturing Discord via a Browser source!

  1. Enable Developer Mode within Discord (under Settings > Appearance). This allows you to copy server and channel IDs (right click on element > Copy ID).
  2. With Developer Mode enabled, take note of the server ID and channel ID for the channel you wish to capture.
  3. Add a Browser source to your scene. Change the URL property to the following text, substituting in your own IDs:
  4. https://discord.com/channels/server-ID/channel-ID

  5. We recommend setting the Width and Height properties to 1200 and 500, respectively. You can always tweak this later on.
  6. Press the bottom-right OK button, and your Browser source should load to a login page.
  7. Right-click the Browser source and press Interact. This will let you navigate and type into the browser, such that you can log into Discord.
  8. Crop the Browser source to your liking. In Discord, you can enable Compact message display (Settings > Appearance) if you prefer the look.
  9. Optional: copy this text into the Custom CSS property of your Browser source. This makes the chat background transparent and changes the font.

If you decide to use Discord as your stream chat, make sure to include a server invite link in your PeerTube stream descriptions!

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 we find an open-source alternative to the aforementioned Widget, we'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 us know: Contact Kube#4556 on Discord or @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!