WriteFreely

Peertube Technical Issues

When I began my foray into serving videos on Peertube, by mirroring the Open Tech Will Save Us series, I ran into a few technical issues, misunderstandings, mistakes, learning opportunities.

Some of these were basic things like needing to attach more storage to my server. The more interesting things are noted below.

Transcoding Resolutions

Some of my family are on very slow connections and I want to give such users the best chance to be able to watch these videos. The older episodes of OTWSU are recorded in 720p resolution, the newer ones in 1080p. I added 360p and 144p resolutions, and audio-only. I reviewed the transcoding settings in the Peertube admin interface, and decided to add 360p and 144p resolutions, and audio-only. After changing those settings, I had to go to Admin:Overview:Videos and select the Run HLS transcoding option for each video individually. That worked fine: Peertube queued up those transcoding jobs and eventually got around to executing all of them.

Changing Ownership

I started with a test user account on my Peertube server. In this account I set up a channel named “matrix” and a playlist named “OTWSU”. Once I had all the videos prepared, I tried to move them all to a different account under my real user name. I saw there was a “transfer ownership” feature available for each video. I could not find a way to transfer an entire channel. I chose the only remaining option, to “delete” the channel, planning to recreate the same channel name under my real user account and then go back and transfer ownership of all the videos to that. But I did not read the warning carefully. I found out the hard way that deleting the channel immediately deleted all the videos. And then I found out the second thing that had been in the warning message, that after deleting a channel I can never create a new channel with the same name.

Now, this doesn't feel right to me. As the administrator, I can always tear down my Peertube instance and recreate it and this way re-create a channel under a different user, and re-use a previous channel name. Very tedious, but possible. Software should give me ways to do things like changing ownership, changing anything, while informing me of any repercussions.

User Names, Channel Names

Peertube puts both user names and channel names in the same namespace. The fediverse (ActivityPub) handles are in the form user@instance and channel@instance respectively.

This caused me some difficulties in Peertube in Yunohost, where it is set up to take user names from Yunohost's LDAP user name directory.

On logging in to Peertube as LDAP user “matrix” I found Peertube assigned its own user account identifier as “matrix-1”. What had happened is I had previously created a Peertube channel named “matrix”, belonging to a different user, and it had not informed Yunohost's LDAP about that. So now the user identifiers are out of sync.

Something should be done differently here. In recent years of self-hosting, a few things have become clear to me about what we need in order for people to realistically own their own personal data. One essential ingredient is managing user accounts in a separate component, shared by all the user's (or their family's) services, with Single Sign-On.

Sharing The Same Videos

I expected a video's identifier would be independent of my instance, so that multiple Peertube instances hosting the same video could participate in sharing the video. At least in theory, in future, even if not yet implemented. I had hoped the system would always give the same video the same identifier, and through this identifier a viewer would be able to locate a copy of this particular video on any Peertube instance that the viewer was able to know about.

Knowing about other copies of the same video would be useful for fault tolerance — if we fail to fetch the video from the first server we try, then try to fetch it from another — and for load balancing — if a video is popular and stored on many servers, then spread the fetching across all of them.

What I observed was, each time I imported the same video again, Peertube assigned it a new and different identifier. The videos I imported into my instance ended up with different identifiers than the same videos imported into Harald's instance. Thus, when we share a link to a video, we are sharing a link to one particular instance's copy of the video, with no easy way for the viewer to know about other copies of the same video.

I also expected there to be a way to instruct Peertube to mirror selected videos, playlists or channels found on another Peertube instance. There is something related to this in the configuration settings: a feature called Instances redundancy, which mirrors the videos from selected remote instances, optionally filtered by criteria such as recently watched. First we make our instance “follow” the remote instance, and then we enable the “allow redundancy” option for that follow. Then the viewer's “web browser will randomly download segments of this video on the origin instance and on your instance”.

I have learnt that Peertube uses the viewers web browsers to re-share, to load-balance. Peertube does not seem to have a way to automatically discover and load-balance among different servers sharing the same video, beyond the “Instances redundancy” feature.

What the “Instances redundancy” feature does not seem to do is allow me to re-publish the mirrored videos under my own server name, user name, channel name. Instead it makes them available through my instance, but under the origin server's name and origin channel's name. In other words, it treats the origin server as if it were the “author” or “owner” of the video. In my case, however, the real author and owner does not have their own server, and none of the available servers is more authoritative than any other. When I mirror these videos from someone else's server, it isn't right or appropriate to use their server's name as if it were the canonical name. Indeed I might want to mirror that video from several remote servers. And from mine to theirs. More sharing than one-way following.

That all seems like it's not part of Peertube's current system design. I wonder if it could be part of a Peertube successor's design.