Configure Frame Threading and WPP in FFmpeg libx265

This article explains how to configure the frame-threads and Wavefront Parallel Processing (wpp) options in the FFmpeg libx265 encoder. By customizing these parameters, you can optimize CPU utilization, control memory usage, and balance encoding speed against compression efficiency.

Understanding the Parameters

When encoding HEVC/H.265 video with libx265, parallel processing is primarily controlled by two mechanisms:

By default, libx265 automatically detects your CPU core count and configures optimal defaults for both settings. However, manual configuration is necessary for specific low-latency, streaming, or resource-constrained environments.

How to Configure in FFmpeg

Both options are configured using the -x265-params flag in FFmpeg. Parameters are passed as key-value pairs separated by colons.

1. Configuring frame-threads

To manually set the number of frame threads, define frame-threads=N, where N is the number of threads. Setting this to 1 disables frame-level parallelism.

ffmpeg -i input.mp4 -c:v libx265 -x265-params frame-threads=4 output.mp4

2. Configuring wpp

WPP is enabled by default. You can explicitly enable it using wpp=1 or disable it using wpp=0 (or no-wpp=1). Disabling WPP is rarely recommended unless you are targeting hardware decoders with strict compatibility limitations.

ffmpeg -i input.mp4 -c:v libx265 -x265-params wpp=0 output.mp4

3. Combining Both Options

To customize both settings simultaneously, separate them with a colon inside the -x265-params argument:

ffmpeg -i input.mp4 -c:v libx265 -x265-params frame-threads=2:wpp=1 output.mp4