Upscale (size increasing) for the input video using AMD Advanced Media Framework library for hardware acceleration. Use advanced algorithms for upscaling with higher output quality. Setting the output width and height works in the same way as for the scale filter.
The filter accepts the following options:
- w, h
-
Set the output video dimension expression. Default value is the input dimension.
Allows for the same expressions as the scale filter.
- algorithm
-
Sets the algorithm used for scaling:
- bilinear
-
Bilinear
- bicubic
-
Bicubic
- sr1-0
-
Video SR1.0 This is a default value
- point
-
Point AMF returns an unwritten surface for this algorithm when the format is
nv12orp010, so inputs in those formats are converted to a packed RGB format automatically. This is a driver bug rather than a documented restriction; the conversion can be dropped once a driver that scalesnv12andp010correctly withpointis in wide use. - sr1-1
-
Video SR1.1 This algorithm only supports packed RGB formats and requires a DirectX 11 or DirectX 12 device, so it is available on Windows only. Inputs in other formats such as
nv12orp010are converted to a packed RGB format automatically. Note that the VideoSR algorithms (sr1-0andsr1-1) do not preserve the alpha channel (it is left zeroed); drop it after the download, e.g. withhwdownload,format=rgba,format=rgb24, if an opaque result is required.
- sharpness
-
Control hq scaler sharpening. The value is a float in the range of [0.0, 2.0]
- format
-
Controls the output pixel format. By default, or if none is specified, the input pixel format is used.
The
pointandsr1-1algorithms emit the packed RGB format the scaler receives, so for them this option must name one ofrgba,bgra,x2bgr10leorrgbaf16le. A named format also decides what software input is converted to, and what a hardware surface in another format is converted to on the GPU. Without it,x2bgr10leis selected forp010input andrgbafor other non-RGB input, and the result is tagged as full range RGB. libswscale cannot convert other software formats torgbaf16le; use software input already in that format or a hardware input for GPU conversion. - keep-ratio
-
Force the scaler to keep the aspect ratio of the input image when the output size has a different aspect ratio. Default value is false.
- fill
-
Specifies whether the output image outside the region of interest, which does not fill the entire output surface should be filled with a solid color.
Examples
-
Upscale to 720p, keeping aspect ratio, and read the result back into system memory. The filter always outputs AMF surfaces, so a hwdownload is needed to feed a software encoder.
sr_amf=-2:720,hwdownload,format=nv12
-
Upscale to 4K with algorithm video SR1.1.
sr_amf=4096:2160:algorithm=sr1-1