Does mpv Support Gapless Audio Playback?

The mpv media player fully supports gapless audio playback for consecutive tracks in a playlist, ensuring transitions between audio files occur without silence, clicks, or disruptions. This feature is controlled primarily by the --gapless-audio configuration option, which manages how the audio device is handled between tracks. By default, mpv uses a baseline approach to achieve seamless playback, but users can explicitly configure it to enforce strict gapless behavior across varying audio formats.

Understanding the Gapless Audio Option

By default, mpv attempts to maintain an open audio device between consecutive playlist tracks to eliminate standard hardware initialization delays. The behavior of this feature is determined by three specific values assigned to the --gapless-audio option:

To ensure the most consistent gapless experience directly from the command line, you can pass the explicit flag when launching your playlist:

mpv --gapless-audio=yes --playlist=your_playlist.m3u

For persistent gapless audio without typing the flag every time, you can add the option directly to your mpv.conf configuration file:

# Force gapless audio behavior for all playlists
gapless-audio=yes

Potential Limitations with Network Streams

While mpv excels at local gapless transitions, network-based audio files or cloud streams may occasionally experience buffers. This occurs because the gapless mechanism relies heavily on the audio output device’s buffer continuing to play while the next file loads. If network latency delays the initial caching of the consecutive track, the hardware buffer may run dry before data from the new file arrives. To counteract this, users can pair gapless playback with the --prefetch-playlist=yes option, which prompts mpv to preload the upcoming track in the playlist before the active song concludes.