VLC for macOS Command Line Audio Delay

Abstract: Resolve audio desynchronization in VLC for macOS by applying millisecond offsets via the --audio-delay command-line flag or vlcrc configuration.

Created: 2026-09-26 by
Adjusting audio delay in VLC for macOS via the command line is straightforward using the --audio-delay flag followed by a value in milliseconds. A positive number delays the audio, while a negative number advances it relative to the video stream. This method allows users to synchronize playback without opening the graphical interface, making it ideal for scripting or automated media servers where manual adjustment is impractical.

Understanding Audio Synchronization Issues

Audio desynchronization, often referred to as lip-sync issues, occurs when the audio track does not align with the visual actions on screen. This can happen due to encoding errors, hardware latency, or network buffering in streaming scenarios. On macOS, VLC typically handles synchronization automatically, but certain file formats or corrupted headers may require manual intervention.

While the VLC graphical interface offers an Tools > Track > Audio Delay menu for real-time adjustments, command-line users need a different approach. The command-line tool provides precise control over this offset, allowing you to set a fixed delay before playback begins. This is particularly useful when dealing with batch processing or headless environments where GUI interaction is not possible.

Using the --audio-delay Flag

The primary method to adjust audio delay from the terminal is the --audio-delay option. This flag accepts an integer value representing the delay in milliseconds. To use it, you append the flag to your vlc command along with the path to your media file.

vlc --audio-delay 500 /path/to/your/video.mp4

In this example, the value 500 indicates a delay of 500 milliseconds (half a second). If the audio is playing too early and you need to wait for the video, use a positive number. Conversely, if the audio is lagging behind the video, use a negative number to advance it.

vlc --audio-delay -300 /path/to/your/video.mp4

This command will advance the audio by 300 milliseconds, effectively bringing it closer to the video timeline. It is important to test small increments first, as large adjustments can make the viewing experience jarring.

Setting Permanent Delays with Preferences

If you frequently encounter sync issues with specific files or types of media, setting a permanent delay via configuration files might be more efficient than typing flags every time. VLC stores user preferences in a configuration file located at ~/Library/Application Support/VLC/vlcrc. You can edit this file directly or use the command line to modify it.

To set a global audio delay, add the following line to your vlcrc file:

audio-delay=500

Replace 500 with your desired millisecond value. After saving the file, restart VLC. This setting will apply to all subsequent playback sessions unless overridden by command-line flags. For more granular control, you can also create custom profiles or use Lua scripts, though this requires advanced knowledge of VLC's scripting API.

Troubleshooting Common Issues

Sometimes, even after adjusting the delay, audio and video may still drift apart. This is often caused by variable frame rates or incorrect timestamps in the source file. In such cases, consider using external tools like FFmpeg to remux the file and correct timestamps before playback. You can find more information on handling FFmpeg commands in our guide on Skipped lines reading series of ffmpeg commands.

Another common issue is that some audio codecs may not support real-time delay adjustments smoothly. If you notice stuttering or popping sounds after applying a delay, try converting the audio track to a standard format like AAC or MP3 before playback. Additionally, ensure that your macOS system audio settings are not introducing additional latency. You can check this by comparing VLC output with another media player.

For users who need to capture their screen while troubleshooting these issues, macOS provides built-in tools for annotated screenshots, which can help document the problem visually. Learn more about this feature in our article on A Built-in macOS Way to Copy Annotated Screenshots.

Advanced Scripting Options

For power users, integrating VLC into bash scripts allows for dynamic delay adjustment based on file metadata. You can parse the file name or ID3 tags to determine the appropriate delay automatically. This requires parsing JSON or XML data from media info tools like ffprobe and then passing the calculated value to VLC.

Here is a basic example of how you might structure such a script:

#!/bin/bash
FILE="$1"
DELAY=$(ffprobe -v error -show_entries format_tags=delay -of default=noprint_wrappers=1:nokey=1 "$FILE")
if [ ! -z "$DELAY" ]; then
    vlc --audio-delay "$DELAY" "$FILE"
else
    vlc "$FILE"
fi

This script checks for a delay tag in the file's metadata and applies it if present. If no tag exists, it plays the file normally. This approach reduces manual intervention and ensures consistent playback across large media libraries.

Frequently Asked Questions

How do I know if my audio delay is positive or negative?

If the audio is ahead of the video (you hear words before seeing lips move), use a positive delay value to wait for the video. If the audio is behind the video (lips move before sound is heard), use a negative value to advance the audio.

Can I adjust audio delay in real-time using the command line?

No, the --audio-delay flag sets a static offset at the start of playback. For real-time adjustments, you must use the VLC graphical interface or a remote control plugin that supports dynamic changes during playback.

Does the audio delay affect subtitles?

No, the --audio-delay flag only affects the audio track. Subtitle synchronization is controlled separately by the --sub-delay flag. You can adjust both simultaneously if needed for perfect sync.

What happens if I set a very large delay value?

A very large delay may cause the audio to start significantly later than the video, potentially missing critical introductory content. It is recommended to start with small values (e.g., ±100ms) and incrementally adjust until synchronization is achieved.

Is there a way to reset the audio delay to zero?

Yes, simply omit the --audio-delay flag from your command or set its value to 0. This returns VLC to its default behavior of relying on the file's internal timestamps for synchronization.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More