Transcode VP9 Video with Custom Tiles in FFmpeg

This article provides a straightforward guide on how to transcode video to the VP9 format using FFmpeg’s libvpx-vp9 encoder with customized multi-threading tiles. You will learn the specific command-line arguments needed to define custom tile columns and rows, allowing you to optimize encoding speed and playback performance for high-resolution videos.

Understanding VP9 Tiles

VP9 introduces “tiles,” which split a video frame into a grid of independent regions. These regions can be encoded and decoded in parallel. By default, the libvpx-vp9 encoder may not use tiles efficiently, which can lead to slow encoding times on multi-core processors. Setting custom tiles allows FFmpeg to utilize more CPU threads.

FFmpeg Command for VP9 Custom Tiles

To transcode a video using custom tiles, use the -tile-columns and -tile-rows parameters. The values for these parameters are represented in log2 scale (e.g., a value of 1 means \(2^1 = 2\), a value of 2 means \(2^2 = 4\)).

Here is a standard command to transcode a video to VP9 with custom tiles:

ffmpeg -i input.mp4 -c:v libvpx-vp9 -b:v 2M -tile-columns 2 -tile-rows 1 -frame-parallel 1 -threads 8 output.webm

Parameter Breakdown

Tile configurations should scale with the resolution of your source video. Below are the recommended settings for common resolutions:

For 1080p (Full HD) Video

For 4K (Ultra HD) Video

Using these custom tile configurations will significantly reduce encoding times while maintaining high-quality VP9 compression.