mpv External Audio Out Of Sync: How to Fix It

When mpv plays an external audio file but the sound does not line up with the video, the cause usually falls into one of four categories: a constant timing offset, mismatched editions of the media, unintended track selection, or configuration that changes playback timing. The fastest approach is to test the video and audio with explicit paths and no configuration, determine whether the error stays constant or grows, and then change only the option responsible. This guide focuses specifically on external audio files loaded alongside local videos, while also covering playlists, network media, scripts, hardware decoding, and other mpv features that can complicate diagnosis.

Video and external audio timelines being checked for offset and drift at multiple playback points.

1. Confirm the Symptom With a Minimal Clean mpv Command

Begin outside your normal launcher, file manager association, or custom script. A direct terminal command removes uncertainty about which video opened, which audio file loaded, and whether shell arguments became playlist entries.

On Linux or macOS, run a command like this:

mpv --no-config --audio-file="/full/path/to/audio.flac" "/full/path/to/video.mkv"

On Windows PowerShell, use an explicit executable and absolute paths:

& "C:\Program Files\mpv\mpv.exe" --no-config --audio-file="D:\Media\audio.flac" "D:\Media\video.mkv"

Adjust the executable location to match your installation. Quoting is essential when a path contains spaces, brackets, ampersands, or other characters interpreted by a shell.

1.1 What the clean test proves

The --no-config option temporarily prevents mpv from loading its normal user configuration. The --audio-file option explicitly attaches the named file as an external audio source instead of relying on automatic discovery. If this command plays in sync, the media files are probably compatible and the problem is likely inside your configuration, a profile, a script, an input binding, or the way your usual launcher builds its command.

If the clean command remains out of sync, observe the pattern before changing anything:

  • Constant offset: The audio is early or late by approximately the same amount throughout playback.
  • Growing drift: The beginning is close, but the error increases as playback continues.
  • Discontinuity: Sync changes suddenly after seeking, a stream interruption, or a particular timestamp.
  • Wrong content: Dialogue or music clearly belongs to another cut, episode, language edition, or release.

Success means the intended external track is selected and recognizable events remain aligned after seeking to the beginning, middle, and end. Once that happens, stop changing playback options. Additional adjustments can recreate the problem.

2. Load the External Audio File Correctly

The reliable syntax is --audio-file=PATH. Giving mpv two bare filenames is not equivalent. For example, mpv video.mkv audio.flac can treat the files as separate playlist entries rather than attaching the second file to the first. That may result in the video playing with its embedded audio, followed by the standalone audio file.

2.1 Verify the selected track

Open mpv's track list or cycle audio tracks while playback is active. Depending on your input configuration, the default track-selection bindings may be available, but custom bindings can replace them. The on-screen display should identify the selected audio track as external or show the external filename.

You can also inspect the terminal output at startup. mpv normally reports detected video, audio, and subtitle tracks. Confirm that the external file appears and is selected. If both embedded and external audio are present, do not assume the external track won merely because it was loaded.

If necessary, test while disabling the video's embedded default-selection assumptions by selecting the desired track interactively. Avoid hard-coding an audio track number until you inspect the current file because track IDs can differ between videos.

2.2 Understand audio-file-auto behavior

The audio-file-auto setting controls automatic loading of nearby external audio files. Its matching modes can include disabled, exact, fuzzy, or broad loading behavior, depending on the chosen value. Fuzzy or broad matching can load an unintended file when a directory contains multiple editions, commentary tracks, dubbed releases, soundtrack files, or similarly named episodes.

For diagnosis, bypass automatic matching:

mpv --no-config --audio-file-auto=no --audio-file="/exact/audio.flac" "/exact/video.mkv"

This test succeeds when only the specified external audio is loaded and selected. If it fixes the problem, tighten your normal automatic matching policy, improve filenames, separate editions into different directories, or continue using explicit --audio-file paths.

2.3 Check playlist ordering

Playlist generation is a common source of confusion in wrappers and drag-and-drop workflows. A script may append the external audio file as another playlist item instead of passing it as an option belonging to the video. Inspect the playlist and command construction if the audio opens in its own playback session, the next-file indicator appears unexpectedly, or mpv advances to an audio-only entry.

The correct logical order is the --audio-file option with its value, followed by the video path. The success condition is one playlist entry for the video with the external track attached to it.

3. Correct a Constant Offset With audio-delay

If the same words, impacts, or visual cues are early or late by a fixed amount from beginning to end, a deliberate timing offset is appropriate. mpv provides --audio-delay in seconds and accepts fractional or negative values.

For example:

mpv --no-config --audio-file="audio.flac" --audio-delay=0.250 "video.mkv"

A positive value delays audio. If the sound is already late, test a negative value instead:

mpv --no-config --audio-file="audio.flac" --audio-delay=-0.250 "video.mkv"

Start with a clearly observable scene and change the value in small increments. Speech close-ups, door closures, claps, and hard cuts with sound are easier to judge than background music.

3.1 Apply compensation carefully

An interactive audio-delay binding can help find the correct value without restarting playback. Check your input.conf before relying on a remembered keyboard shortcut because custom bindings may change or remove the defaults. Once you determine the offset, place it in a file-specific profile, launch command, or sidecar workflow rather than applying it globally to every video.

A global audio-delay setting can make correctly synchronized media appear broken. Search mpv.conf, included configuration files, profiles, and launch scripts for both audio-delay and commands that modify the audio-delay property.

Success means the beginning, middle, and end all align with one fixed delay value. If the required correction changes over time, stop adjusting audio-delay. A constant offset cannot repair progressive drift.

4. Identify Different Cuts, Releases, and Timing Sources

External audio must come from the same edit as the video. Two releases can share a title and nominal runtime while differing in studio logos, recaps, censored scenes, credits, commercial breaks, frame-rate conversion, or inserted black frames. Audio from a theatrical cut will not reliably synchronize with an extended cut.

4.1 Distinguish offset from progressive drift

Compare at least three locations:

  1. Check a recognizable event near the beginning.
  2. Seek to the middle and check another clear event.
  3. Seek near the end and check again.

If the error is identical at all three points, use a fixed delay. If it grows steadily, the sources may have different timing rates or timestamps. If it changes abruptly, one edition probably contains material that the other does not.

mpv can compensate for playback offsets, but it is not a general-purpose editor for conforming audio from one release to another. When timing diverges, obtain a legitimately sourced audio track matching the exact video edition or retime the media with an appropriate editing workflow and permission to use the material.

4.2 Rule out damaged or unusual media timing

Timestamp problems, variable-frame-rate material, broken containers, and incomplete network files can produce irregular synchronization. Test the same pair from local storage when possible. If local playback is stable but network playback is not, investigate the network path rather than permanently offsetting the audio.

Success means repeated seeks return to the same synchronization relationship without jumps or accumulating drift. If another trusted player shows the same progressive mismatch with the same files, the limitation is probably in the media pair rather than an mpv-specific setting.

Playback configuration layers being isolated one at a time to find an audio sync problem.

5. Inspect Configurations, Profiles, Scripts, and Playback Features

If --no-config fixes the issue, restore your setup methodically. Do not delete the entire configuration folder. Temporarily rename or comment out one relevant option, profile, script, or include at a time, then repeat the same test scene.

5.1 Search relevant configuration options

Review mpv.conf, included files, and any profile that activates for particular protocols, file extensions, resolutions, HDR modes, or displays. Look for:

  • audio-delay or commands that alter it
  • audio-file and audio-file-auto
  • forced audio track selection
  • audio filters or video filters that add buffering
  • speed changes or synchronization-related options
  • profiles activated by filename, protocol, display, or media properties
  • scripts that load tracks, restore properties, or manage playlists

Use --show-profile=PROFILE_NAME to inspect the contents of a named profile. If you do not know which profile is active, compare your ordinary terminal output and configuration includes against the clean run.

5.2 Check input bindings and saved state

An input.conf binding may increment or reset audio delay, change tracks, alter speed, or invoke a script. Search for audio-delay, add, set, cycle, af, and script messages related to synchronization.

Scripts that remember playback properties can restore an old delay for a new file. Temporarily prevent scripts from loading during a controlled test, then re-enable them individually. Stop when the issue returns. That identifies the component to configure or update without sacrificing unrelated customization.

5.3 Separate subtitles from audio synchronization

A subtitle delay does not move the audio. However, delayed subtitles can make synchronized speech appear wrong, especially when dialogue timing is being judged against text rather than visible mouth movement. Confirm the problem against a visual event, then reset subtitle delay separately if needed.

Similarly, subtitle auto-loading may indicate that broad filename matching is active. That does not prove audio auto-loading uses the same setting, but it is a reason to inspect both external-file policies and verify the actual selected tracks.

5.4 Test hardware decoding, video output, and HDR paths

Hardware decoding and complex video output can expose driver or presentation-timing problems, especially with demanding HDR, high-resolution, high-frame-rate, or shader-heavy playback. Test once with hardware decoding disabled:

mpv --no-config --hwdec=no --audio-file="audio.flac" "video.mkv"

If synchronization becomes stable, repeat with your normal configuration while disabling shaders, interpolation, and custom video filters separately. On Linux, comparing the available display-server session or video-output environment can also help identify driver-specific presentation issues. On all platforms, use a current GPU driver obtained from the operating system or hardware vendor, not an unofficial codec bundle.

Success means the audio remains aligned during normal playback and after seeking. If disabling hardware decoding only makes an overloaded system drop frames differently, examine performance statistics before concluding that hardware decoding itself is defective.

6. Check Audio Backends, Paths, Permissions, and External Sources

Operating system and source problems matter when mpv cannot read the intended file consistently, silently loads another track, or experiences unstable buffering.

6.1 Validate file paths and permissions

Use absolute paths for both files. Confirm the external audio is readable by the user running mpv and is not only accessible through another account, sandbox, disconnected drive, or expired network mount. On macOS, a terminal or launcher may need permission to access protected folders. Linux sandbox packaging can restrict locations outside allowed directories. Windows paths on removable or network drives may change between sessions.

A path problem is resolved when terminal output shows the exact expected file and playback behaves the same across repeated launches.

6.2 Isolate the audio backend

Audio-server buffering or device changes can create apparent latency. Test the operating system's normal output device without Bluetooth, wireless casting, virtual mixers, or audio enhancement software. If wired or built-in output is synchronized but a wireless device is not, the delay is in the output route rather than the external audio file.

A stable, constant device latency may be compensated when that device is used, but do not bake it into a universal profile. Create a device-specific profile or correct latency in the operating system or audio server when possible.

6.3 Treat URLs and yt-dlp as a separate layer

When the video is an online URL but the audio is local, the remote stream may change format, timestamps, or buffering behavior. First download or use an authorized local test source if permitted, or test a known local video with the same external audio workflow. If local files synchronize, inspect the URL extraction and network layer.

Ensure mpv is invoking the intended yt-dlp executable from a trusted installation path. Terminal output can reveal extraction failures or format choices. Updating a trusted yt-dlp installation may fix supported-site changes, but it will not make audio from a different edit match the selected stream. Respect access controls and the source service's terms.

6.4 Ignore unrelated screenshot settings

Screenshot format, directory, and filename templates do not normally control audio timing. Investigate them only if a custom screenshot binding invokes a script, pauses playback, changes speed, or runs a blocking command. This prevents an unrelated setting from distracting you from track selection and timing evidence.

7. Use Logs and Runtime Information to Find the Cause

When the cause is not visible, capture one short reproduction with detailed output:

mpv --no-config --msg-level=all=v --log-file="mpv-sync.log" --audio-file="audio.flac" "video.mkv"

Then repeat without --no-config and save to a different log. Compare track selection, loaded files, profiles, filters, audio and video outputs, hardware decoding, warnings, timestamp messages, and scripts.

7.1 Use the stats overlay

mpv's statistics overlay can show dropped frames, display synchronization data, decoding behavior, and performance information. With standard bindings, the stats feature is commonly available during playback, but customized input files may change its key. Use the overlay while reproducing the problem and watch for frame drops or performance spikes.

For high-bitrate video, test from fast local storage. If sync fails only while decoding cannot keep up, simplify shaders, filters, scaling, or hardware-decoding choices. Performance troubleshooting is relevant only when the statistics support it.

7.2 Read logs selectively

Verbose logs are large. Search for the external filename, audio-delay, selected tracks, filters, profiles, scripts, decoder initialization, audio output, video output, timestamp warnings, and cache events. A successful log shows the intended external audio opened as a track and no unexplained setting changing its timing.

8. Run a Clean Temporary Test Before Making Permanent Changes

Use a controlled sequence so that each result answers one question:

  1. Run the explicit --no-config --audio-file command with local files.
  2. Verify the external track is selected.
  3. Compare synchronization near the beginning, middle, and end.
  4. If the offset is constant, test a small --audio-delay value.
  5. If the drift grows, verify that the audio and video are from the same release.
  6. If the clean test works, restore the normal configuration without scripts.
  7. Re-enable profiles, scripts, filters, shaders, and hardware decoding one group at a time.
  8. Save a log only if the responsible layer remains unclear.

Do not change the audio backend, GPU driver, hardware decoder, delay, script set, and track policy simultaneously. If synchronization improves, you will not know which change fixed it. The correct stopping point is the first configuration that reliably plays the intended track in sync at several timestamps and after seeking.

9. Quick Fix Checklist

  • Attach audio with --audio-file="absolute path" instead of passing it as a second bare filename.
  • Run once with --no-config to exclude profiles, scripts, bindings, and persistent delays.
  • Disable audio-file-auto temporarily and specify the exact external file.
  • Confirm the selected audio track through the on-screen display or terminal output.
  • Use audio-delay only for an offset that remains constant throughout the video.
  • Check the beginning, middle, and end for evidence of different cuts or releases.
  • Inspect playlists to ensure the audio is attached rather than queued separately.
  • Test local files before blaming yt-dlp, a stream URL, or network buffering.
  • Disable hardware decoding temporarily if logs or statistics suggest video timing trouble.
  • Re-enable configuration components one at a time and stop when the cause is identified.

10. Frequently Asked Questions

10.1 What is the correct mpv command for external audio?

Use mpv --audio-file="audio.ext" "video.ext". During troubleshooting, add --no-config, use absolute paths, and optionally set --audio-file-auto=no. This ensures the named audio is attached to the video rather than added as another playlist entry.

10.2 How do I fix external audio that is always early or late?

Use --audio-delay with a value in seconds. Positive values delay the audio, while negative values move it earlier. Test at several timestamps. Keep the value only if one setting works for the entire video.

10.3 Why does synchronization get worse as the video continues?

Growing drift usually indicates that the audio and video do not share the same timing basis or release. They may come from different cuts, broadcasts, frame-rate conversions, or encodes. A fixed delay cannot correct a mismatch that changes over time.

10.4 Why does --no-config fix the problem?

Your normal setup is probably loading an audio delay, selecting another track, applying a filter, activating a profile, or running a script that changes playback. Restore components in small groups until the problem returns, then inspect the most recently enabled component.

10.5 Can subtitles cause external audio to be out of sync?

Subtitle delay does not directly move audio. Incorrectly timed subtitles can make good audio appear late or early, so judge synchronization against visible actions or lip movement. Reset subtitle timing separately from audio timing.

10.6 Should I reinstall mpv or install a codec pack?

Usually not. If mpv decodes both files, reinstalling is unlikely to repair a release mismatch, wrong track, playlist error, or saved delay. Do not install untrusted codec packs or random binaries. First run the clean explicit-path test, inspect tracks, and compare logs.


Citations

  1. Official mpv option reference covering external audio files, delays, profiles, logging, and configuration. (mpv Manual)
  2. Official mpv documentation portal for the player manual and related resources. (mpv Documentation)
  3. Official yt-dlp project documentation covering installation, supported options, and troubleshooting. (yt-dlp GitHub Repository)
Cindy, ContentBASE creator assistant

MEET CINDY

Your ContentBASE creator assistant

Cindy helps creators find Canva templates, content ideas, and simple ways to make better social media posts faster.

Want ready-to-use templates? Claim the free Canva bundles or browse the full bundle store.