Channel specific transcoding profiles

Hey @Chocobozzz & everyone,

In order to save on space, I only transcode to have the original resolution and 480p.

For certain videos on a specific channel I’d like to add additional resolutions (780p and 1080p)

I’ve been trying to setup a plugin that I can add those additional resolutions with a json like this in the plugin settings:

{
  "ChannelOne": ["720", "1080"],
  "ChannelTwo": ["240", "360", "1080" ]
}

I got pretty close, I got the setting page to work, when a video gets uploaded I can get the channel name and resolutions from the settings with this hook, but I can’t seem to queue transcoding in those extra resolutions.

Is there any exposed api or server hook meant to do this?

Thanks!

I think filter:transcoding.auto.resolutions-to-transcode.result (Plugins & Themes API | PeerTube documentation)

I tried this hook first. Unfortunately the problem is it doesn’t give me any information about the channel the video is being uploaded to.

I tried using action:api.video.uploaded instead since it triggers at the right time and gives the channel name, but I can’t change the transcoded resolutions from there.

Should I (or can I) make a PR to the peertube repo to provide some video details to the filter:transcoding.auto.resolutions-to-transcode.result when it gets triggered?

Thanks!

Yes please :slight_smile:

Ok, in the process of trying to « fix » it I figured out there’s a context attribute that gets passed with those details already in the original hook you mentioned. My bad :sweat_smile:

Thanks!