Configure FFmpeg Showwaves Color Dimension and Mode

This article provides a practical guide on how to customize the visual appearance of the showwaves filter in FFmpeg. You will learn how to adjust the output video dimensions, change the waveform colors, select different drawing modes, and combine these settings into a single command to generate custom audio visualizations.

The showwaves filter converts an input audio stream into a video representing the audio waveform. By default, it produces a basic, low-resolution visualization. You can customize this output using the size, colors, and mode parameters.

Setting the Dimensions (Size)

To change the resolution of the generated video, use the size (or s) parameter. The format is widthxheight.

For example, to generate a high-definition 1080p visualization, set the size to 1920x1080:

showwaves=size=1920x1080

Changing the Waveform Color

The colors (or c) parameter defines the color of the waveform. You can specify colors using standard color names (like red, blue, green, cyan) or hexadecimal values (like 0xFF0055 or random).

For multi-channel audio, you can separate colors with a pipe symbol (|) to assign different colors to different audio channels:

showwaves=colors=cyan|yellow

Choosing the Drawing Mode

The mode parameter defines how the waveform samples are drawn on the screen. There are four available modes:

For a solid, modern waveform look, p2p or cline are the most common choices:

showwaves=mode=cline

Combined Configuration Example

To configure all three settings at once, separate the parameters with a colon (:) inside the filter argument.

The following command takes an audio file (input.mp3), applies the showwaves filter with a resolution of 1280x720, a cyan color, and the p2p drawing mode, and outputs it as an MP4 video:

ffmpeg -i input.mp3 -filter_complex "showwaves=size=1280x720:colors=cyan:mode=p2p" -c:a copy output.mp4