Skip to content

HandBrake with AMF decoder support

Latest

Choose a tag to compare

@Hotactioncop Hotactioncop released this 24 Dec 11:05
· 81 commits to Enable_AMF_decode since this release

Enabling AMD AMF Decoder in HandBrake

The AMD AMF decoder in HandBrake allows for a significant encoding speed boost, by leveraging AMD's hardware acceleration.
Follow the steps below to enable and configure this feature.

HandBrake provides two ways to utilize functionality:

  1. Using the GUI application (HandBrake.exe)
  2. Using the command-line interface (HandBrakeCLI.exe)

1. Enabling the AMF Decoder in HandBrake Preferences

  1. Open the Tools -> Preferences menu.

  2. Navigate to the Video tab.

  3. Check the box labeled:
    "Prefer use of AMD AMFDec for decoding video when using the AMFEnc encoder and the hardware is available for use."

    • This setting enables the AMF decoder when supported hardware is available and a compatible encoder is selected.

Selecting a Compatible Encoder

To utilize the AMF decoder, ensure that one of the following encoders is selected in the main application menu under the Video tab, in the Video Encoder field:

  • H.264 (AMD VCE)
  • H.265 (AMD VCE)
  • H.265 10-bit (AMD VCE)
  • AV1 (AMD VCE)

Benefits of Enabling the AMF Decoder

  • No Data Copies to CPU: Video decoding and encoding are performed directly on the GPU, reducing CPU load and improving performance.
  • Increased Encoding Speed: Hardware acceleration can boost encoding speeds by an average of 25%.

Behavior When the Option is Disabled or Another Encoder is Selected

  • If the checkbox is unchecked or a different encoder (e.g., x264 or x265) is selected, video data will be copied to the CPU for processing.
    This will increase the overall encoding time.

Using the Scale Filter for Resolution Adjustment

AMF pipeline in HandBrake now includes support for the scale filter, allowing you to adjust the resolution of your video.
Follow these steps to configure it:

Default Resolution

  1. Navigate to the Dimensions tab.
  2. In the Resolution Limit dropdown, select the desired resolution.
  3. If the new resolution is larger than the current one, check the Allow Upscaling checkbox below.

Custom Resolution (e.g., 1500x700)

  1. Uncheck the Optimal Size checkbox.
  2. In the Scaled Size field, enter the desired resolution.

Verifying Your Settings

At the bottom of the Dimensions tab, review the Final Dimensions section.
This displays the resolution parameters of the output file, ensuring your settings are correctly applied.

2. Using the Command-Line Interface (HandBrakeCLI.exe)

To enable the AMF decoder in HandBrakeCLI.exe, use the following argument:

--enable-hw-decoding amfdec

Example Command

Here is an example of using the AMF decoder with HandBrakeCLI:

HandBrakeCLI.exe -i input.mp4 -o output.mp4 --enable-hw-decoding amfdec -e h264_amf --width 1920 --height 1080

Notes

  • Replace input.mp4 with the path to your source video file.
  • Replace output.mp4 with the desired path for the output file.
  • The -e option specifies the encoder, such as h264_amf, h265_amf, or av1_amf.
  • Use --width and --height to set the desired resolution. If upscaling is required, ensure that the source resolution is smaller than the specified dimensions.

By following these steps, you can optimize video encoding in HandBrake using AMD AMF hardware acceleration.