What is the default frame-dropping behavior in mpv?
When a system cannot keep up with video decoding or rendering demands, mpv’s default behavior is to drop frames dynamically to maintain strict audio-video synchronization. This article explores how mpv handles performance bottlenecks out of the box, the specific mechanisms it uses to drop video frames, and how users can modify this behavior to prioritize video smoothness over perfect sync.
The Default Behavior: Audio-First Synchronization
By default, mpv prioritizes the audio clock as its master reference. If your CPU or GPU falls behind and cannot render video frames fast enough to match the audio, mpv will intentionally skip decoding or displaying certain video frames. This prevents the audio from stuttering or drifting out of sync with the on-screen action.
Under the hood, this default behavior is governed by the
configuration equivalent of --framedrop=vo.
Types of Frame Dropping in mpv
When mpv detects that the video lag exceeds a certain threshold, it employs two main stages of frame dropping depending on the severity of the performance issue:
- Decoder-Stage Frame Dropping: If the system is severely struggling, mpv tells the video decoder to completely skip decoding specific frames (usually non-reference B-frames). This drastically reduces CPU/GPU utilization but can cause visible blockiness or brief freezes.
- Video Output (VO) Stage Frame Dropping: If the decoder is doing fine but the display pipeline or GPU renderer is lagging, mpv will decode the frames but simply discard them instead of sending them to your screen.
Alternative Configurations
While dropping frames is ideal for keeping audio and video aligned,
some users prefer alternative behaviors depending on their hardware
limitations or content types. These can be adjusted using the
--framedrop and --video-sync options in the
mpv.conf file:
| Command Flag | Behavior Description | Best Used For |
|---|---|---|
--framedrop=vo |
Default. Drops video frames if the video output or renderer lags behind the audio clock. | General playback on most hardware. |
--framedrop=no |
Disables all frame dropping. Video will play every single frame, even if it causes the audio to desynchronize or stutter. | Benchmarking or when audio sync doesn’t matter. |
--framedrop=decoder |
A more aggressive dropping mode that discards frames directly at the decoder level early on. | Extremely weak or legacy hardware. |
--video-sync=display-resample |
Changes the master clock to the display’s refresh rate, resampling audio to match the video speed instead of dropping frames. | High-end systems aiming for ultra-smooth panning. |