Configure FFmpeg scale_cuda Scaling Algorithm

This article explains how to configure the scaling algorithm when using the hardware-accelerated scale_cuda filter in FFmpeg. You will learn about the available interpolation algorithms—such as nearest neighbor, bilinear, and bicubic—and how to implement them in your command-line workflows to balance video quality and GPU performance.

The scale_cuda filter in FFmpeg utilizes NVIDIA GPU hardware to resize video frames. To change the scaling algorithm (the mathematical method used to resize the pixels), you must configure the interp parameter inside the filter.

Supported Scaling Algorithms

The scale_cuda filter supports several interpolation methods through the interp option:

Command-Line Examples

To apply these algorithms, specify the interp parameter within your filter chain. For optimal performance, combine scale_cuda with hardware-accelerated decoding (-hwaccel cuda) and encoding (h264_nvenc or hevc_nvenc).

To scale a video to 1080p using the high-quality bicubic algorithm:

ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 -vf "scale_cuda=1920:1080:interp=bicubic" -c:v h264_nvenc output.mp4

To scale a video to 720p using the faster bilinear algorithm:

ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 -vf "scale_cuda=1280:720:interp=bilinear" -c:v h264_nvenc output.mp4

To scale a video to 4K using the lanczos algorithm:

ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 -vf "scale_cuda=3840:2160:interp=lanczos" -c:v h264_nvenc output.mp4

Key Considerations