October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
audio sync

How to Fix Audio Drifting Out of Sync in a YouTube Stream Made With FFmpeg

Measure sync at the beginning and later in the stream: a steady offset and growing drift call for different FFmpeg troubleshooting steps.

By VGSources Team 6 min read
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

First determine whether the audio is out of sync by roughly the same amount throughout the stream or whether the mismatch grows over time. A steady offset usually points to different start times; increasing drift calls for investigating timestamps and clock rates. Those cases need different fixes, so measure before changing FFmpeg options.

Measure the mismatch before changing FFmpeg

Compare audio and video near the beginning, then at one or more later points. Note whether the audio is early or late and estimate the offset each time. Use a private or test stream when practical, and keep the source and command unchanged while measuring.

  • About the same offset at each point: investigate an initial offset or different input start times.
  • The offset grows or shrinks: investigate clock or timestamp drift, including source timestamps that do not track real time.
  • The mismatch changes abruptly: look for missing, irregular, or discontinuous timestamps, and note when the change occurs.

This classification is a troubleshooting guide, not proof of a particular cause. A stream made from one media file, two capture devices, or independent real-time inputs can have different timing behavior.

Collect the FFmpeg details that determine the fix

  1. Record the FFmpeg version and build, the full command, and relevant log output. Remove or redact the YouTube stream key before sharing logs or command lines.
  2. Use local FFmpeg tools to inspect the audio and video stream start times, time bases, audio sample rate, video frame rate, and any timestamp warnings.
  3. Identify how the inputs are produced. Determine whether audio and video come from the same file or device, or from separate real-time sources.
  4. If inputs are separate, find out whether their timestamps come from a shared clock. This matters if you plan to use -isync.

The online FFmpeg documentation is regenerated nightly and describes the newest revision, not necessarily the version installed on your system. Check documentation for your installed build before relying on an option’s availability or behavior: FFmpeg command-line documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Fix a steady audio offset

When the mismatch is approximately constant from the start through later checks, test an input timestamp offset rather than changing frame rate or applying audio compensation intended for accumulating drift.

Use -itsoffset to adjust an input’s start timing

FFmpeg’s -itsoffset adds an offset to timestamps for an input. A positive value delays that input. Apply it to the input that needs to move, using a measured amount, then check sync near the beginning and later in the stream. Option placement matters: consult the installed FFmpeg command-line documentation for input option placement and syntax. Do not assume which stream to delay without first measuring whether audio leads or lags video.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Use -isync only when its clock assumptions fit

-isync offsets a target input by the start-time difference from a reference input. FFmpeg says the inputs should derive their timestamps from the same clock source for the expected result. It is a possible way to align start times, not a general correction for drift that accumulates as a stream runs. See the FFmpeg command-line documentation.

Investigate drift that accumulates over time

If the audio/video gap changes as the stream continues, inspect whether source timestamps remain valid and whether independent inputs follow the same clock. FFmpeg’s audio resampler can use timestamps to stretch, squeeze, fill, or trim audio samples to compensate for timing differences.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Test timestamp-based resampling carefully

The resampler’s async option is disabled by default. Setting async=1 enables filling and trimming; larger values set the maximum sample compensation per second. The resampler also documents first_pts for padding or trimming at the stream start and min_comp as a threshold for compensation. These controls affect timing behavior, and the appropriate values depend on the input. Inspect the source timing, consult the FFmpeg resampler documentation for your installed version, and test before using the change in a live stream.

Do not choose an async value just because drift is present. If timestamps are missing, irregular, or discontinuous, first establish what the source is sending; compensation cannot be selected responsibly from the title or symptoms alone.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Check video timing without treating frame-rate changes as a cure

Video timing can contribute to the diagnosis, but arbitrary frame-rate changes are not a generic audio-drift fix. FFmpeg’s -fps_mode passthrough forwards frame timestamps. Its cfr mode duplicates or drops frames to reach a requested constant rate, and muxers can further modify timestamps. Changing frame handling may therefore change video timing rather than correct the underlying audio clock mismatch.

Use -fps_mode only when the source and desired output timing justify it. Avoid changing unrelated timing options at the same time, and verify sync again at multiple points. The option behaviors are described in the FFmpeg command-line documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Changes that usually do not solve relative drift

  • Shifting all output timestamps uniformly: this preserves relative audio/video timing differences, so it does not by itself repair an existing mismatch. See the FFmpeg formats documentation.
  • Increasing an output queue or buffer as a drift fix: interleaving and buffering concern packet output behavior; they are not established here as general corrections for accumulating audio/video drift.
  • Changing several timing flags at once: this makes it difficult to tell which change helped or introduced a new timing problem.
  • Applying a constant offset to growing drift: an offset can align one point while leaving the mismatch at other points unresolved.

Verify the change in a controlled stream

  1. Save the original command and logs, with the stream key removed from any copy you retain or share.
  2. Change one timing-related setting that matches the diagnosed case: an input offset for a steady difference, or a carefully tested timestamp-compensation approach for accumulating mismatch.
  3. Run a private or test stream and compare sync at the start and at later points. Confirm that the chosen change improves the whole interval rather than only its opening.
  4. If the result worsens or changes unpredictably, revert the last change and investigate the timestamps, input clocks, and warnings before trying another setting.

Troubleshooting by symptom

What you observe Likely area to investigate Next step
Audio is early or late by about the same amount throughout Different input start times or an initial offset Measure the offset and test an appropriate -itsoffset; consider -isync only if the inputs share a clock source.
The mismatch steadily grows or shrinks Clock-rate or timestamp drift Check source timestamp quality and clocks; test timestamp-based audio resampler compensation with values appropriate to the input.
Sync changes suddenly at a particular point Irregular, missing, or discontinuous timestamps, or a source change Inspect logs and timestamps around that point before changing compensation settings.
A timing change fixes the opening but not later playback A fixed offset is being used against a changing mismatch Reclassify the problem using multiple measurement points and examine clock and timestamp behavior.
Changing -fps_mode makes playback worse Video frames are being passed through or altered in a way that does not suit the source timing Restore the prior mode and choose video timing based on source and output requirements, not as a default audio fix.
Changing a global timestamp shift has no effect on relative sync The shift applies equally to audio and video Adjust or correct the specific input timing or source timestamps instead.

Or let it run in the cloud

If your goal is to keep prerecorded videos playing as a YouTube live stream, StreamNeo is a separate cloud option rather than an FFmpeg repair tool: upload a recording or build a playlist, add your YouTube stream key, and go live. Nothing has to stay on at home; it streams the uploaded quality up to 4K 60fps at one flat price per slot, automatically recovers if YouTube drops the stream, and the first day is free with no card. Monthly pricing is $9.99 per month. See StreamNeo or start the free first day.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from Patch Notes

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.