How to Combine Rubberband and Scale in FFmpeg

This article explains how to combine the rubberband audio filter and the video scale filter in a single FFmpeg command. You will learn the correct command-line syntax to simultaneously resize your video and adjust its audio pitch or tempo using both simple filter arguments and complex filtergraphs.

Prerequisites

To use the rubberband filter, your FFmpeg build must be compiled with the --enable-librubberband configuration flag. You can verify this by running ffmpeg -filters and checking if rubberband is listed.


Method 1: Using Separate -vf and -af Flags

The simplest way to combine these two operations is by using the video filter (-vf) and audio filter (-af) flags in a single command. This method is ideal when you have a single input stream and want to output a single file.

Command Example

ffmpeg -i input.mp4 -vf "scale=1280:720" -af "rubberband=tempo=1.5:pitch=1.2" output.mp4

Parameter Breakdown


Method 2: Using -filter_complex

For more advanced processing, or when managing multiple inputs and outputs, use the -filter_complex flag. This allows you to define explicit stream links and process both video and audio in a single unified filtergraph.

Command Example

ffmpeg -i input.mp4 -filter_complex "[0:v]scale=1280:720[v_scaled];[0:a]rubberband=tempo=1.2:pitch=1.0[a_adjusted]" -map "[v_scaled]" -map "[a_adjusted]" output.mp4

Parameter Breakdown