Can i Set a Max Resolution for Peertube

really new to peertube, and web servers in general. i have a peertube instance running, and it’s serving videos no issues. it’s awesome.
my question is, can i set a maximum resolution for videos users upload, and having anything above that setting be automatically downscaled? so if i set the max at 1080p, and someone uploads a 4k video, can peertube automatically scale it down to 1080p? or am i asking for the impossible here?
appreciate any help. there seem to be some seasoned web server pros on here


Welcome, Jared!

Yes! You can do exactly that.

Simply deselect the « Always transcode original resolution » box and select the 1080p box on the page « admin/config/edit-custom#transcoding ». Now if someone uploads a 4k video, it will be automatically downscaled to 1080p and PeerTube will discard the 4k video file (unless you enable the save original video file feature), saving you storage space.

If you were to do the same but with the original resolution box selected, it would transcode both a 4k video and a 1080p version.

awesome! thanks for dropping by.
now just to make sure i’m getting this right, if i select only the 1080p option, any video that’s uploaded at a lower resolution will be left alone? or should i select everything below 1080p to avoid upscaling? i know it may seem like a dumb question, but i’m new to this :smiley:

Correct. It will not upscale. The 1080p option only applies to videos with an original resolution greater than 1080p.

thank you :blush:

1 Like

You shouldn’t deselect all resolution under 1080p. Some users have low bandwidth, and it is important to provide small resolutions for such use cases.

hey John. this night be a silly question to ask, but is live transcoding an option? perhaps it would require a gpu though…

Yes, it is optional:

But if you disable it, all your streamers must absolutely use video format that are web browser compatible. And as I said, it might not work for users with low bandwidth.

You can also do the transcoding on multiple other servers:

In my experience, transcoding 1 live to 720p + 480p + 240p requires something like 4 vCPUs. To add 1080p, it requires a little bit more (but not so much).

There are also plugins for hardware transcoding (i haven’t tested):

this instance has 32 vCPU’s, so I should be fine. but jeepers. I’ll look through all the links you sent to make sure I’m not missing any optimizations. thank you so much.