How to Set VP9 Tile Columns and Rows in FFmpeg
This article explains how to control tile columns and tile rows when encoding VP9 video using FFmpeg. You will learn the specific command-line options required to configure tiling, how these values are calculated using a log2 scale, and how utilizing tiles improves multi-threading performance during both encoding and decoding.
To control the tile columns and tile rows for VP9 encoding in FFmpeg,
you must use the -tile-columns and -tile-rows
options with the libvpx-vp9 encoder. These options split
the video frame into a grid of tiles, allowing the encoder and decoder
to process different sections of the frame simultaneously using multiple
CPU threads.
The Tile Options and Log2 Scaling
Unlike standard integer counts, the values for both
-tile-columns and -tile-rows are set using a
\(log_2\) (logarithm base 2) scale.
-tile-columns <value>: Specifies the number of tile columns. A value of \(N\) creates \(2^N\) columns.0= 1 column (default)1= 2 columns2= 4 columns3= 8 columns (up to a maximum of6for 64 columns)
-tile-rows <value>: Specifies the number of tile rows. A value of \(N\) creates \(2^N\) rows.0= 1 row (default)1= 2 rows2= 4 rows (maximum)
Example FFmpeg Command
To encode a video with 4 tile columns and 2 tile rows (creating an 8-tile grid), use the following FFmpeg command:
ffmpeg -i input.mp4 -c:v libvpx-vp9 -tile-columns 2 -tile-rows 1 -threads 8 output.webmWhy Use Tiling?
By default, VP9 encoding can be slow because it does not utilize
multiple CPU cores efficiently without tiling. Enabling tiles allows the
encoder to distribute the workload across the number of threads
specified by the -threads option.
For optimal decoding performance on playback devices, it is also
recommended to pair these settings with the
-frame-parallel 1 option, which enables parallel decoding
of the generated tiles.