Ffmpeg transcoding profile - native and through plugin

Hi,
I’m trying to test different transcoding parameters to increase the video quality.

First I looked at the doc to find where ffmpeg parameters are stored. I didn’t find it, but read that they are hard coded in Peertube (exact ?). So I looked at the " PeerTube transcoding custom quality" plugin.

The READ ME of the plugin says :

This plugin creates a transcoding profile in which admins can decide the quality of the transcoding process.

In the web admin of the plugin, I get a dropdown menu with different value (wich I guess correspond to crf value send to ffmepg).
image

But changing it (for example to VERY GOOD) has no effect. (I’ve tried to restart my containers after the change).
The file size of the 3 resolutions I want is exactly the same as before. (1080, 720, 360 and audio only in HLS only).

So I’m wondering :

  • does this plugin work with Peertube 4.2 and higher ?

  • does it work for HLS, or maybe only for Webtorrent (which I don’t do) ?

  • where can I find the transcode profile file created by the plugin to see what are the crf value (or other ffmpeg parameter) behing each value (GOOD, VERY GOOD, EXCELLENT) ?

Thanks for your help.

Hello,

CRF settings are not documented but you can find them in the source code: peertube-plugin-transcoding-custom-quality/main.js · master · Framasoft / PeerTube / official-plugins · GitLab

Did you enable this custom profile in admin → configuration → vod transcoding?

Hi Chocobozzz, yes, I think I have set it properly :

Should I change this one to custom ?


(maybe the french translation of this field was guiding me in the wrong direction : I thought it was only for transcoding « live » broadcast, and not VOD)

Yes you should

I’ll update the field description!

1 « J'aime »

Ok, thanks for your tip Chocobozzz, it’s now working.

So for other interested, you have to :

  • install the plugin « Transcode custom quality »

  • in the parameters of the plugin, choose a value. Here are the value found inside the code (it could be interresting to write it in the READ ME of the plugin :

options: [
      { label: 'Default', value: 23 },
      { label: 'Good', value: 20 },
      { label: 'Very good', value: 17 },
      { label: 'Excellent', value: 14 }
  • and lastly choose « custom-profile » in Admin → Configuration → VOD transcoding → Transcoding profile

For info, during my test, the same short video weight 38 Mo with the default profile, 59 Mo with the Very Good value (which is a little better than the crf=18 that ffmpeg documentation considers as a visual lossless compression), and 75 Mo with Excellent value.

Thanks for your help on this.
Eric

1 « J'aime »

I’ve just found this plugin looking for some way to change VAAPI transcoding settings and, unfortunately, it doesn’t work for it (but seems to work fine for ffmpeg CPU transcoding). How could I do it? I mean tweaking settings for VAAPI.

Hi @danieldids, sorry but I haven’t explored the hardware transcoding in Peertube, so I can’t help you.

I’m replying not only to you but for the people of the future looking for help (it’s 2023 now).

Hardware encoding works, I’ve managed to use it by installing a plugin (available through PeerTube itself), but you have to do some extra things specially if you are using docker.

The complete solution can be found here:

The short solution is: you’ll need to give your peertube container access to some devices on the host machine and install some linux dependencies too (inside the container in my case).

The plugin @EricG is commenting on this thread won’t affect hardware transcoding settings. You’ll have to tweak them manually in the source code.

By using quicksync from a core i3 (second generation, 2010 ancient tech) I am able to live-transcode something like 4-6 streams, each one generating 360 and 720p resolutions.

1 « J'aime »