Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon 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 Now×
FREEDOM251

Freedom251 › Blog › audio-video sync

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

By Freedom251 Team · · 7 min read

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.

First determine whether the audio/video mismatch stays roughly the same or grows over time. A nearly constant offset calls for measuring and shifting the affected input; growing drift calls for checking source clocks and whether audio samples keep pace with their timestamps. Do not start by adding arbitrary delays or forcing a frame rate: either can hide the symptom or create new artifacts.

Also compare the FFmpeg output before YouTube ingest with the Live Control Room preview and playback. If the local output is synchronized but YouTube playback is not, investigate stream health and delivery before changing timestamp filters.

As an Amazon Associate I earn from qualifying purchases.

1. Capture the evidence before changing FFmpeg

Save the exact FFmpeg command, but redact the YouTube stream key anywhere it appears. Record the output of ffmpeg -version, relevant startup and runtime log lines, the input types, and whether audio and video come from one file or separate live sources. Do not post a stream key publicly or include it in a support request.

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

Use ffprobe or FFmpeg logs to inspect the inputs and output where possible. Note stream start times, time bases, frame rates and audio sample rates. Then identify a clear event visible and audible in the stream—such as a clap—and estimate the audio/video offset near the beginning and again later. Record which leads and by approximately how much.

#1 Best Overall
Blink Outdoor 2K+ (newest model) — Wireless smart security camera, 2K video resolution, enhanced audio, two-year battery. Required Sync Module not included — Add-On (Black)
  • Battery-powered protection, now in 2K — Blink Outdoor 2K+ is our next-generation wireless smart security camera that delivers an improved visual and audio experience with sharp 2K video resolution and Color Vision in low light.
  • 2K video clarity — See more of what matters with sharper 2K video resolution. From subtle textures to defined edges, every frame reveals rich detail and enhanced color even in challenging light conditions.
  • Color Vision in low light — Ambient lighting is all you need to experience around-the-clock peace of mind, allowing Outdoor 2K+ to give color video at low light levels before switching to infrared black and white.
  • Two-way audio with noise cancellation — Enhanced 2K video resolution and advanced noise cancellation provide sharp, natural conversations anywhere around your home, making every interaction feel like you're there in person.
  • Smart detection — With an optional Blink Subscription Plan (sold separately), receive smart notifications for person and vehicle detection, ensuring you're only notified about the motion that matters most.

Two observations matter more than an unmeasured impression: if the separation is similar both times, the problem is probably a fixed offset; if it increases or changes abruptly, look for clock or timestamp progression issues. This classification helps choose a correction, but it does not identify the root cause by itself.

2. Find out whether the mismatch is already in FFmpeg’s output

Compare a local recording or capture of the FFmpeg output with the YouTube Live Control Room preview and, when available, the resulting playback. Use the same sync event in each. If the local output is already out of sync, focus first on inputs, timestamps and FFmpeg’s handling. If local output is synchronized but the YouTube result is not, check YouTube stream health, delivery and playback conditions before rewriting the command.

Test before relying on the stream. YouTube recommends testing with audio and movement similar to the real broadcast, then monitoring stream health and messages in Live Control Room. A preview or playback discrepancy alone does not prove that timestamp filters are at fault.

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

3. Match the correction to the symptom

Nearly constant offset: measure, then shift the affected input

If one input is consistently early or late, measure the offset and identify which input is wrong relative to the other. FFmpeg’s -itsoffset adds an offset to input timestamps; a positive value delays that input. Put the option before the -i for the input it should affect, for example:

ffmpeg [options] -itsoffset MEASURED_OFFSET -i affected-input [options] -i other-input [output options] OUTPUT

Rank #2
Sale
Uonecn 3.5mm TRS to 5-Pin Male Timecode Cable for Tentacle Sync Generator, for ARRI Alexa Cameras and Sound Devices Recorders, 17.7in/45cm
  • 【Timecode Adapter Cable】 Connects a timecode generator with a 3.5mm TRS output to a compatible device with a 5-pin timecode input. Designed for external timecode workflows in professional video production.
  • 【Check the Device Connector】 This cable uses a 3.5mm TRS plug on one end and a 5-pin male connector on the other. Before ordering, verify the exact connector type, pin configuration and timecode input on your camera or recorder.
  • 【ARRI Alexa Compatibility】 Intended for compatible ARRI Alexa systems with a matching 5-pin timecode input and connector configuration. Please verify your exact camera model, including whether it is an Alexa Mini or Alexa Mini LF, before purchase.
  • 【Important Compatibility Notice】 Not designed for direct connection to the RED KOMODO X camera body's 9-pin EXT port. A dedicated cable is required for direct connection. Compatibility with a RED Pro I/O Module or other expansion equipment must be verified separately.
  • 【Cable Specifications】 Plug A: Right-angle 3.5mm TRS plug. Plug B: 5-pin male connector. Length: 45cm / 17.7in. Please confirm the connector orientation, pinout and device requirements before ordering. Each cable should be checked for continuity and correct wiring before use.

Replace MEASURED_OFFSET with the value established by your measurement and use a sign that corrects the observed lead or lag. This is a command shape, not a recommended delay value. Re-run a test and compare the same event near the start and later. If the mismatch grows, a fixed shift will not correct the underlying drift.

Growing drift: check whether the sources share a clock

When audio and video come from separate live sources, establish how each source timestamps its data and whether those clocks are related. FFmpeg notes that expected synchronization behavior depends on the timestamps for two inputs deriving from the same clock source. Independent capture devices or processes can progress at slightly different rates even when they begin together.

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

Check whether audio samples progress in step with their timestamps. FFmpeg’s aresample filter can compensate by stretching or squeezing audio, or by adding or cutting samples to match timestamps. Use compensation only after the evidence points to an audio-sample/timestamp mismatch, and test it in a controlled run using documentation for the FFmpeg build installed on the Hetzner host. Incorrect or excessive compensation can alter audio; do not select a value by guesswork or assume the filter fixes every clock mismatch.

Sudden jumps or discontinuities: locate the timestamp change

If sync is acceptable and then jumps, inspect logs and source behavior around the jump. Look for an input interruption, restart, timestamp discontinuity or other event that affects one input. Determine which input’s timestamps changed before applying a correction. A broad reset or offset may mask an interruption without restoring stable timing.

Irregular video cadence: review the frame-sync policy

Check the source frame rate and the output frame-sync mode rather than treating a frame-rate conversion as an audio repair. FFmpeg’s modes have different effects:

Rank #3
Audio/Video Sync - Loader shortcut for Fire TV
  • Quickly load the Audio/Video Sync settings on your Fire TV.
  • Passthrough: preserves demuxer timestamps.
  • Constant frame rate (CFR): duplicates or drops frames to meet the requested rate.
  • Variable frame rate (VFR): passes timestamps through or drops frames with duplicate timestamps.

Choose based on the source cadence and output requirement. Forcing CFR can change the video by adding or dropping frames; it is not a blanket audio/video synchronization fix. Check the installed build’s FFmpeg documentation for the applicable option names and behavior.

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

4. Check YouTube ingest and the Hetzner network separately

Verify encoder settings against YouTube’s current guidance

YouTube’s encoder guidance recommends RTMP or RTMPS ingestion, a frame rate up to 60 fps, a two-second keyframe interval (not over four seconds), AAC or MP3 audio, and constant bitrate (CBR). These are platform recommendations, not proof that a particular timing error is caused by encoder settings. Confirm the current requirements for your chosen resolution, frame rate and codec in YouTube Live Control Room before a production stream.

For H.264, YouTube’s published examples recommend 10 Mbps for 1080p30 and 17 Mbps for 1080p60; its table also lists 8 Mbps for both 720p30 and 720p60. The appropriate bitrate depends on resolution, frame rate and codec, and YouTube may update its table, so use the current entry for your actual output rather than treating an example as a universal setting.

RTMPS encrypts the ingest connection. YouTube provides instructions for obtaining the RTMPS URL in Live Control Room. Choosing RTMPS concerns transport security and connection setup; it does not correct timestamps or independently resolve lip-sync.

Check total bitrate and available outbound capacity

Add the bitrate of the primary stream and any backup stream, then compare that total with measured outbound capacity from the relevant Hetzner server and network allocation. YouTube recommends leaving 20% headroom beyond the total stream bitrate. Check actual throughput and allocation for your own account, server and region; a provider name alone does not establish the bandwidth available to a particular host.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Blink Outdoor 2K+ (newest model) — Wireless smart security camera, 2K video resolution, enhanced audio, two-year battery. Sync Module Core included — 2 camera system (Black)
  • Battery-powered protection, now in 2K — Blink Outdoor 2K+ is our next-generation wireless smart security camera that delivers an improved visual and audio experience with sharp 2K video resolution and Color Vision in low light.
  • 2K video clarity — See more of what matters with sharper 2K video resolution. From subtle textures to defined edges, every frame reveals rich detail and enhanced color even in challenging light conditions.
  • Color Vision in low light — Ambient lighting is all you need to experience around-the-clock peace of mind, allowing Outdoor 2K+ to give color video at low light levels before switching to infrared black and white.
  • Two-way audio with noise cancellation — Enhanced 2K video resolution and advanced noise cancellation provide sharp, natural conversations anywhere around your home, making every interaction feel like you're there in person.
  • Smart detection — With an optional Blink Subscription Plan (sold separately), receive smart notifications for person and vehicle detection, ensuring you're only notified about the motion that matters most.

Insufficient or unstable bandwidth can disrupt delivery, but a bandwidth check does not prove the cause of a timestamp offset. Treat delivery health and synchronization as related checks, not interchangeable diagnoses.

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

5. Run a controlled test and keep a known-good version

  1. Make a short test stream. Use a private or unlisted test where permitted, with representative audio and motion and a visible, audible sync event such as a clap.
  2. Change one relevant setting at a time. If the evidence shows a fixed offset, test a measured input shift. If it shows sample/timestamp divergence, test audio compensation. If frame cadence is the issue, test the appropriate frame-sync policy.
  3. Compare at two points. Check the event near the beginning and later in the test, both in local output and in YouTube’s preview or playback where available.
  4. Save the result. Keep the known-good command, FFmpeg logs and YouTube stream-health messages together. Redact stream keys before storing logs somewhere shared or sending them for help.

6. Common failure patterns and what to do

What you observe What to check next What to avoid
The same audio lead or lag persists throughout. Measure which input leads, then test a corresponding -itsoffset before that input’s -i. Guessing a delay without measuring, or shifting the wrong input.
The mismatch gets larger over time. Check whether separate sources share a clock and whether audio samples track their timestamps; consider controlled aresample compensation only if indicated. Expecting a fixed timestamp shift to stop accumulating drift.
Sync jumps after being acceptable. Inspect logs and source interruptions or timestamp discontinuities near the change; find the input that changed. Using a general timestamp reset to conceal the source event.
Video motion looks uneven or frame timing varies. Check source frame rate and the chosen passthrough, CFR or VFR behavior. Forcing CFR as a universal audio-sync remedy.
Local output is synchronized, but the YouTube result is not. Review Live Control Room status and stream-health messages, then investigate delivery and playback conditions. Changing FFmpeg filters before establishing that the defect exists in the local output.
The stream drops, buffers or reports health problems. Compare total primary and backup bitrate with observed outbound capacity, leave YouTube’s recommended 20% headroom, and review the current encoder guidance. Assuming a delivery issue alone explains a stable timestamp offset.

7. Keep the YouTube stream compliant

Only stream video and audio you have the rights and permissions to use. A successful test or healthy ingest does not establish that the content is permitted. If the channel is monetized, review YouTube’s current policies on copyright and reused content for your situation; the fixes in this guide address timing and delivery, not content eligibility.

Or let it run in the cloud

If your goal is to keep uploaded video looping on a YouTube channel around the clock, StreamNeo is a cloud alternative to maintaining an always-running FFmpeg process on a Hetzner server. Upload a recording or build a playlist, add your YouTube stream key once, then go live. StreamNeo loops the uploaded video from the cloud, so your computer and home connection do not have to stay on. It is for uploaded videos, not a live camera feed, and it streams to YouTube.

  • One flat price per slot for any quality up to 4K 60fps as uploaded, with no re-encode or quality tiers.
  • Automatic recovery if YouTube drops the stream.
  • The first day is free with no card.
  • Monthly: $9.99 per month.

See StreamNeo or compare plan lengths. Start your free first day with StreamNeo.

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

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.

audio-video syncFFmpegHetznerlive streamingYouTube Live

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.

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.