October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
DocumentaryTube
audio video sync

How to Fix FFmpeg Audio and Video Going Out of Sync on a Hetzner YouTube Stream

Measure whether sync error stays fixed or grows, locate whether it begins before YouTube ingest, then test the timestamp or clock correction that matches the evidence.

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

First determine whether the audio/video error is a nearly constant offset or grows as the stream runs. A fixed offset may call for shifting the affected input’s timestamps; growing drift points instead to timestamp progression or clock mismatch. Check where the problem first appears before changing your FFmpeg command: a YouTube-only playback issue is different from audio and video already out of sync in FFmpeg’s output.

Start by measuring the sync problem

Do not begin by adding a guessed delay or forcing a new frame rate. Compare a clear, visible event—such as a clap, a door closing, or a spoken cue aligned with an on-screen action—near the beginning of the stream and again later. Note which comes first and estimate the displacement at both points.

  • Similar displacement at both observations: the error is probably a fixed offset. Measure which stream leads and by how much.
  • Increasing displacement: the error is drifting. Investigate whether audio samples and timestamps progress together and whether separately captured audio and video share a clock.
  • Sudden jumps: look for an input interruption, timestamp discontinuity, or change in the affected input rather than applying a broad reset.
  • Irregular motion or cadence: inspect the source frame rate and FFmpeg’s output synchronization mode.

These patterns narrow the investigation; they do not identify the cause by themselves. The actual cause depends on the command, FFmpeg build, inputs, timestamps, logs, and whether the defect is present before YouTube receives the stream.

Capture the evidence before editing the command

Save the exact FFmpeg command privately, replacing the YouTube stream key with a placeholder before sharing it. A stream key grants access to your broadcast; never post it in a forum, log excerpt, or support request. Record the FFmpeg version and gather the information below.

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.
  • Run ffmpeg -version and keep the output. FFmpeg options and behavior can vary by installed build.
  • Record the type of each input: one file containing both audio and video, separate files, or independently captured live audio and video.
  • Keep startup and runtime log lines around the point where sync changes or an input is interrupted.
  • Use ffprobe or equivalent stream inspection to examine stream start times, time bases, frame rates, sample rates, and timestamps where available.
  • Write down the two sync observations, including which stream leads and the elapsed time between observations.

Preserve a known-good version of the command before each test. Change one relevant setting at a time so that a result can be attributed to a specific change.

Find out whether the fault is in FFmpeg or YouTube playback

Compare the FFmpeg output with the YouTube Live Control Room preview and, if available, the resulting playback. If audio and video are already misaligned in a local recording or capture of FFmpeg’s output, focus first on the inputs, their timestamps, and FFmpeg’s handling. If the local output is synchronized but the YouTube preview or playback is not, check stream health and ingest conditions before rewriting timestamp filters.

YouTube recommends testing before a live broadcast with representative audio and movement, then monitoring stream health and its status messages. This separates a visible sync defect from delivery interruptions that may make a stream appear unstable.

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.

Correct a measured, fixed offset with an input timestamp shift

FFmpeg’s -itsoffset adds an offset to input timestamps. A positive value delays that input. Use it only after establishing which input leads and measuring the fixed displacement; do not use an arbitrary value as a general sync fix.

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.
  1. Identify the input whose timing needs to move, and measure the required shift in seconds.
  2. Place -itsoffset MEASURED_SECONDS before the -i for that input. Replace MEASURED_SECONDS with the measured offset; it is an explanatory placeholder, not a literal command value.
  3. Make no unrelated changes to frame-rate policy, audio filtering, or bitrate during this test.
  4. Repeat the beginning-and-later sync comparison in a short test stream. If the error is no longer constant or the result worsens, restore the previous command and reassess which stream is leading.

For separately captured live sources, FFmpeg’s expected synchronization depends on the two inputs’ source timestamps deriving from the same clock. If the audio and video sources use independent clocks, a one-time timestamp shift can align them initially without preventing later drift.

Investigate growing drift and audio sample timing

When the gap grows, inspect the relationship between audio sample progression and audio timestamps, as well as the relationship between the audio and video clocks. A stream can begin in sync yet drift if independently captured sources do not maintain a shared clock relationship or if samples do not follow their timestamps.

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.

FFmpeg’s aresample filter can compensate for audio/timestamp differences by stretching or squeezing audio, or by adding or cutting samples to match timestamps. Treat this as a measured correction to test, not a universal remedy: inappropriate or excessive compensation can degrade audio. Establish that audio samples and timestamps are diverging before trying compensation, then check both sync and sound quality over time.

If audio and video come from a single recording, inspect its stream start times and timestamp progression before assuming that a separate-clock problem applies. If they are separate live sources, establish how each source timestamps its output and whether those clocks are related. The available evidence cannot prescribe a compensation amount for an unspecified stream.

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

Choose the video synchronization mode deliberately

FFmpeg’s output synchronization modes behave differently; forcing constant frame rate is not a blanket audio-sync fix.

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
Mode Timestamp behavior When to examine it
Passthrough Preserves demuxer timestamps. When you need to determine whether timing irregularities originate in the input timestamps.
Constant frame rate (CFR) Duplicates or drops frames to meet a requested frame rate. When a constant output cadence is an intentional requirement and its frame changes have been considered.
Variable frame rate (VFR) Passes timestamps or drops frames with duplicate timestamps. When the source timestamps should be retained rather than converted to a fixed cadence.

Review the source cadence and the actual output mode before changing it. CFR can alter the video by adding or dropping frames; it does not, by itself, prove or repair an audio clock mismatch. Check the installed FFmpeg build’s documentation for the exact option names and behavior supported by that build.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Check YouTube ingest settings and delivery separately

Once the local output is understood, verify the encoder settings and inspect YouTube’s stream-health messages. YouTube’s guidance is platform advice, not proof that a particular setting caused a timestamp offset.

  • Protocol: YouTube recommends RTMP or RTMPS ingestion. RTMPS encrypts the connection; changing transport affects connection security and setup, not timestamp synchronization.
  • Frame rate: YouTube’s encoder guidance supports up to 60 fps.
  • Keyframes: the recommended interval is 2 seconds and should not exceed 4 seconds.
  • Audio and rate control: the guidance lists AAC or MP3 audio and constant bitrate (CBR).
  • Video bitrate: recommendations vary by resolution, frame rate, and codec. For H.264, YouTube lists 10 Mbps for 1080p30, 17 Mbps for 1080p60, 8 Mbps for 720p30, and 8 Mbps for 720p60. These are YouTube recommendations, not universal minimums; check its current encoder table for your intended format because platform guidance can change.

For bandwidth, add the bitrate of the primary and any backup stream, then compare the total with measured outbound capacity. YouTube recommends leaving 20% headroom beyond the total stream bitrate. Check the actual allocation and observed throughput for your Hetzner server, account, and region: no particular Hetzner instance’s bandwidth or performance can be inferred from the provider name alone. Network instability can interrupt delivery, but a bandwidth check alone does not establish the cause of a timestamp offset.

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.

Run a controlled test before returning to a public stream

  1. Use a short private or unlisted test where appropriate, with representative motion and audio and a clear sync event.
  2. Capture the FFmpeg output and compare the event near the start and again later. Check the Live Control Room preview and stream-health messages as well.
  3. Change one relevant timestamp, filter, or synchronization setting per run. Keep the command and logs for each run, and restore the known-good command if the change makes sync or audio quality worse.
  4. Before resuming a public broadcast, confirm that the chosen stream settings match your intended resolution, frame rate, codec, and available outbound bandwidth. Make sure the material you broadcast is cleared for use; technical sync does not resolve copyright or reused-content concerns.

Common symptoms and what to check next

  • Audio is late by about the same amount throughout: measure the offset and identify the leading input; test an appropriately placed -itsoffset on the affected input.
  • Audio starts in sync but gradually moves away: inspect sample and timestamp progression and determine whether independent sources share a clock. Test audio compensation only if the evidence supports it.
  • Sync suddenly jumps: correlate the jump with FFmpeg logs, source interruptions, and timestamp discontinuities. Find which input changed before attempting a correction.
  • Video motion looks uneven after a sync change: review the source frame rate and output synchronization mode. CFR may duplicate or drop frames; do not assume that changing it corrects audio timing.
  • Local output is synchronized but the YouTube preview is not: inspect ingest and stream-health messages, and run a representative pre-test before changing FFmpeg timestamp handling.
  • The stream health reports connection trouble: check measured outbound capacity against the combined primary and backup bitrate, retaining YouTube’s recommended headroom. This addresses delivery capacity, not necessarily sync.

Or let it run in the cloud

If your goal is a continuously running YouTube channel built from uploaded recordings or a playlist, rather than a live camera or a custom FFmpeg setup, StreamNeo is a cloud option. Upload a recording or build a playlist, add your YouTube stream key once, and go live. StreamNeo loops the uploaded video from the cloud, so your computer and home connection do not have to stay on.

  • One flat price per slot for any uploaded quality up to 4K 60fps; it streams the upload as made, without re-encoding or quality tiers.
  • One always-on YouTube stream per slot, with 10 GB storage per slot pooled across active slots, 24/7 looping and playlists, and automatic recovery if YouTube drops the stream.
  • The first day is free with no card, once per account. The same product is on every plan; only the billing period changes. Choose a day, week, month, six months, or year, and cancel any time.
  • Monthly: $9.99 per month.
  • UPI and cards are available in India; card checkout is available worldwide. For 5 or more slots, contact StreamNeo support.

For help planning an upload, see the upload-time calculator, cloud vs PC cost calculator, and copyright safety checklist. StreamNeo plays uploaded video; it does not stream from a camera. It streams to YouTube only.

Nothing has to stay on at home; any uploaded quality up to 4K 60fps uses one price per slot; StreamNeo automatically recovers if YouTube drops the stream; and the first day is free with no card. Start your free StreamNeo 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.

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

Leave a Reply

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

Free tools Windows power users keep installed

One-click scans. No signup required.

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

More from the Screening Room

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair 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.