FFmpeg 5.0.3
Since* 3.2
#

Use the NVIDIA Performance Primitives (libnpp) to perform scaling and/or pixel format conversion on CUDA video frames. Setting the output width and height works in the same way as for the scale filter.

The following additional options are accepted:

format

The pixel format of the output CUDA frames. If set to the string "same" (the default), the input format will be kept. Note that automatic format negotiation and conversion is not yet supported for hardware frames

interp_algo

The interpolation algorithm used for resizing. One of the following:

nn

Nearest neighbour.

linear, cubic, cubic2p_bspline

2-parameter cubic (B=1, C=0)

cubic2p_catmullrom

2-parameter cubic (B=0, C=1/2)

cubic2p_b05c03

2-parameter cubic (B=1/2, C=3/10)

super

Supersampling

lanczos
force_original_aspect_ratio

Enable decreasing or increasing output video width or height if necessary to keep the original aspect ratio. Possible values:

disable

Scale the video as specified and disable this feature.

decrease

The output video dimensions will automatically be decreased if needed.

increase

The output video dimensions will automatically be increased if needed.

One useful instance of this option is that when you know a specific device’s maximum allowed resolution, you can use this to limit the output video to that, while retaining the aspect ratio. For example, device A allows 1280x720 playback, and your video is 1920x800. Using this option (set it to decrease) and specifying 1280x720 to the command line makes the output 1280x533.

Please note that this is a different thing than specifying -1 for w or h, you still need to specify the output resolution for this option to work.

force_divisible_by

Ensures that both the output dimensions, width and height, are divisible by the given integer when used together with force_original_aspect_ratio. This works similar to using -n in the w and h options.

This option respects the value set for force_original_aspect_ratio, increasing or decreasing the resolution accordingly. The video’s aspect ratio may be slightly modified.

This option can be handy if you need to have a video fit within or exceed a defined resolution using force_original_aspect_ratio but also have encoder restrictions on width or height divisibility.

eval

Specify when to evaluate width and height expression. It accepts the following values:

init

Only evaluate expressions once during the filter initialization or when a command is processed.

frame

Evaluate expressions for each incoming frame.

The values of the w and h options are expressions containing the following constants:

in_w, in_h

The input width and height

iw, ih

These are the same as in_w and in_h.

out_w, out_h

The output (scaled) width and height

ow, oh

These are the same as out_w and out_h

a

The same as iw / ih

sar

input sample aspect ratio

dar

The input display aspect ratio. Calculated from (iw / ih) * sar.

n

The (sequential) number of the input frame, starting from 0. Only available with eval=frame.

t

The presentation timestamp of the input frame, expressed as a number of seconds. Only available with eval=frame.

pos

The position (byte offset) of the frame in the input stream, or NaN if this information is unavailable and/or meaningless (for example in case of synthetic video). Only available with eval=frame.