How to Select xBR Upscaling Factor in FFmpeg

This article explains how to select and configure the upscaling factor (2x, 3x, or 4x) using the xbr (Scale by Rules) video filter in FFmpeg. You will learn the exact command-line syntax, the available parameters, and practical examples to successfully upscale pixel art and low-resolution videos.

To select the upscaling factor in the FFmpeg xbr filter, you use the size option. The xbr filter supports three specific scaling factors: 2 (for 2x upscaling), 3 (for 3x upscaling), and 4 (for 4x upscaling). The default value is 3.

Syntax

You can define the upscaling factor using either the named parameter size or as a positional argument directly after the filter name:

(Where N can be 2, 3, or 4)

Command Examples

1. Scale Video by 2x (2xBR)

To upscale your input video to twice its original width and height, use the value 2:

ffmpeg -i input.mp4 -vf "xbr=2" output.mp4

2. Scale Video by 3x (3xBR)

To upscale your input video to three times its original dimensions (this is the default behavior if no size is specified):

ffmpeg -i input.mp4 -vf "xbr=3" output.mp4

3. Scale Video by 4x (4xBR)

To upscale your input video to four times its original width and height, use the value 4:

ffmpeg -i input.mp4 -vf "xbr=4" output.mp4

Key Considerations