Creating Custom Presets in HandBrake for Better Video Encoding

Jarret B

Well-Known Member
Staff member
Joined
May 22, 2017
Messages
373
Reaction score
437
Credits
13,805
HandBrake is a powerful open-source video transcoder that allows users to convert video files into a wide range of formats. While its default settings are sufficient for most basic needs, creating custom presets can significantly enhance the efficiency and quality of your video conversions. In this article, we'll guide you through the process of setting up and optimizing your own HandBrake presets to match your specific hardware and requirements.

When performing video conversions, there are default settings that are typically used in HandBrake. Usually, these settings are sufficient for most needs.

What do you do if the settings are not working, or could be better?

Let's look at creating our own preset.

Basics

To begin, let's look at a Preset.

In HandBrake, let's look at the icon for 'Presets'.

The listing should be like Figure 1.

Figure 1.JPG

FIGURE 1

Divided into groups, each group is a category. Let's look at our configuration before we continue. If you open the ‘Category’ named ‘Hardware’, as shown in Figure 2, you see eight options. Just because the program lists the presets does not mean your system supports the preset.

Figure 2.jpg

FIGURE 2

There are four types of hardware supported here:
  1. NVENC – Nvidia Encoder
  2. QSV – Intel Quick Sync Video
  3. VCN – AMD Video Core Next
  4. MF – ARM Media Foundation
You should be able to determine which you have from your hardware specs. Let’s look at installing the drivers, especially for newer versions of Ubuntu distros.

For Nvidia, you can run the program ‘nvidia-smi’. It should list your card and show the status of the drivers. To install the program, use ‘sudo apt install nvidia-smi -y’.

If you need to install the Nvidia driver, the run ‘sudo ubuntu-drivers list’. It should list a set of compatible drivers for your card. Be aware that it also lists driver for a server too. Install the driver you prefer, then run the ‘nvidia-smi’ app to verify it.

If you have an Intel video card (integrated graphics), use the command ‘sudo apt install intel-gpu-tools vainfo -y’ to get the tools installed. You can use ‘vainfo’ to see the driver versions installed. Also, to see the information on the GPU usage, you can use ‘intel_gpu_top’.

For the AMD GPU, go to ‘https://www.amd.com/en/support/linux-drivers’ and download the driver. Open a terminal to downloaded ‘.deb’ file and run ‘sudo dpkg -i <name of the deb file>’. Once the process has completed, you then need to run ‘amdgpu-install’ and complete the process. If prompted, use the proprietary driver. To check what driver is in use, use the command ‘dpkg -l xserver-xorg-video-amdgpu’.

For an ARM GPU, there isn’t much support out there for this one. I’ll have to add it in later.

Now that your system should have the proper drivers installed, we can now use the ‘Hardware’ presets that correspond to your GPU.

Updating a Preset

We now have a Preset that is using our Hardware Acceleration, if we have one. We can adjust the rest as we need.

Be sure that the Preset is the proper one. For me, it is the QSV for Intel. Click on the tab for ‘Dimensions’, as shown in Figure 3. Here, we can set the ‘Resolution Limit’.

Figure 3.jpg

FIGURE 3

The possible ‘Resolution Limits’ are:

  • None (leave the output resolution the same as the input)
  • 4320p (8K)
  • 2160p (4K)
  • 1080p (Blu-Ray)
  • 720p (DVD)
  • 576p PAL
  • 480p NTSC
If you click on the ‘Video’ tab, you’ll see something similar to Figure 4.

Figure 4.jpg

FIGURE 4

Set your ‘Video Encoder’ to ‘H.265 (x265)’. This setting is for the typical 8-bit color depth. If your video uses High Dynamic Resolution (HDR), then you need to specify 10 or 12-bit H.265. The extra bits being used are adding more colors.

On the ‘Audio’ tab, we can set more options for the conversion. Figure 5 shows the Audio tab.

Figure 5.jpg

FIGURE 5

The options here can let you control what happens to the audio track in the video. You can cut some existing audio tracks out. On the left side of the window, click on ‘Track Selection’.

You now need to set a ‘Selection Behavior’. The behavior can be:
  • No Audio
  • First Matching Selected Language
  • All Matching Selected Languages
So, let's say we specify the language as 'English' and use the 'First Matching'. If the video has a few audio tracks, the first one on the list that matches our set language is kept in the output. If we want all tracks, such as the regular audio track, Director's Commentary track, and maybe a Riff track. We can include all of them, just in case, by selecting 'All Matching'. If you want to select the first one, be sure that the first audio track is the one you want to keep. I have used the 'First Matching' and ended up with Riff tracks.

The next setting is to choose your default language. Choose your language to keep and move it to the right box.

The next choice is to select the audio format. The option for 'Passthru' is to specify a codec to use. If the codec is in the original video, then the program copies the audio straight from the original to the output. The 'fallback encoder' is the encoding used in case the program cannot perform the 'Passthru'.

The last setting is the 'Audio encoder for each chosen track'. This option lets you set the output audio specs. Remember, the higher the quality you set, the higher the output size.

The next option is 'Subtitles’, as shown in Figure 6. Again, on the left side of the window, slick on ‘Selection Behavior'. These options are only for the Subtitles when using Closed Captioning (CC).

Figure 6.jpg

FIGURE 6

The top is like the Audio Behavior, but the 'Options' are different.

The setting for 'Add Closed Captions when available'. If the subtitles are in the existing video, then the program copies them over to the output video.

You can also 'Add Foreign Audio Scan Pass'. This will scan the video to see if there are subtitles that are forced to be shown. Sometimes, in anime, when a sign appears in Japanese, so a subtitle appears to translate the sign.

The option for 'Burn-in Behavior' is used to cause specified subtitles to be burned into the output video. Keep in mind that this is permanent and you cannot turn it off with the CC option on your TV.

Set any other changes you may prefer and then choose the menu option ‘Presets’. Move down to ‘Save As’ and click it.

You now have a window, shown in Figure 7, that lets you specify a category in which to save the new Preset, give the name of the Preset, specify if you want the Preset to be the default and change the Description.

Conclusion

This is the basics of setting up a Preset for HandBrake and making adjustments.

You may need to adjust settings until you find which works best for your system and for your converted output video files.
 

Attachments

  • Figure 7.jpg
    Figure 7.jpg
    29.7 KB · Views: 125
Last edited by a moderator:

Staff online

Members online


Top