Display Audio Waveform and Vectorscope in FFplay

This guide demonstrates how to monitor audio visually during playback using FFplay, FFmpeg's built-in media player. You will learn how to use native command-line options and keyboard shortcuts to display real-time audio waveforms, as well as how to render an audio vectorscope (lissajous or phase meter) using FFmpeg's audio-to-video multimedia filters.

Using the Built-In Audio Waveform Monitor

FFplay includes a native visualizer that renders a waveform monitor without requiring complex filter chains.

Via Command Line

To launch an audio or video file directly with the waveform monitor enabled, use the -showmode parameter set to 1:

ffplay -showmode 1 input.mp3
  • -showmode 0: Shows video (default if video is present).
  • -showmode 1: Shows the audio waveform.
  • -showmode 2: Shows the RDFT-based audio frequency spectrum.

Via Keyboard Shortcut

If playback has already started, press the w key in the FFplay window to cycle through the display modes: Video \(\rightarrow\) Audio Waves \(\rightarrow\) Frequency Spectrum.


Displaying an Audio Vectorscope (Goniometer)

FFplay does not have a native vectorscope hotkey, but you can display one using the avectorscope filter through the lavfi (Libavfilter) virtual device. This plots stereo channels against each other (Lissajous graph) to analyze stereo imaging, phase alignment, and mono compatibility.

Run the following command in your terminal:

ffplay -f lavfi "amovie='input.mp3',asplit=2[out1][a];[a]avectorscope=s=800x800:m=lissajous:rc=0:gc=255:bc=0[out0]"

Breakdown of Parameters:

  • amovie='input.mp3': Loads your audio file as a filter input.
  • asplit=2[out1][a]: Duplicates the audio stream so one copy plays to your speakers ([out1]) and the other feeds into the visualizer ([a]).
  • avectorscope: Generates the vector display ([out0]).
    • s=800x800: Sets the resolution of the output window.
    • m=lissajous: Sets the display mode (lissajous, polar, or lissajous_xy).
    • rc=0:gc=255:bc=0: Sets the beam color using red, green, and blue values (in this case, green).

Displaying a Customized Audio Waveform Monitor via Filter

If you need more control over the waveform appearance than the standard -showmode 1 allows, use the showwaves filter via lavfi:

ffplay -f lavfi "amovie='input.mp3',asplit=2[out1][a];[a]showwaves=s=1280x720:mode=line:colors=cyan[out0]"

Key Options for showwaves:

  • mode: Defines the waveform rendering style (point, line, p2p, or cline).
  • colors: Sets the waveform color (e.g., cyan, yellow, white).
  • scale: Adjusts the scale (lin for linear, log for logarithmic, or sqrt).