First determine whether the audio is consistently early or late from the beginning, or whether the mismatch grows during playback. A fixed offset calls for measured alignment; growing drift calls for timestamp and clock diagnosis, and may justify testing FFmpeg’s aresample compensation. There is no single sync flag that fixes every YouTube stream, and available guidance does not establish Azure VMs as a specific cause.
Diagnose the mismatch before changing FFmpeg
Make a short test that includes clear audio cues and visible motion near the beginning and again later. Compare those points in the source, an output or local recording, and YouTube’s stream preview. Note the approximate offset at each point:
- Nearly the same offset at both points: the problem is likely a fixed start-time difference. Measure which stream starts first.
- The offset gets larger or smaller: suspect timestamp or clock drift, unequal track timing, or a processing path that does not keep audio and video aligned.
- The local output is in sync but the YouTube preview is not: investigate the publishing path, stream health, network, and playback conditions rather than assuming the input filter is responsible.
A delay that varies between runs should not be treated as a reliable constant. An FFmpeg-user discussion about YouTube Live capture reported inconsistent delay between runs; it is a useful warning, not proof that another setup will behave the same way.
Inspect the source, output, and FFmpeg build
Record the installed FFmpeg version and inspect the input and any local output or archive with ffprobe:
#1 Best Overall
- Pro performance with great pre-amps - Achieve a brighter recording thanks to the high performing mic pre-amps of the Scarlett 3rd Gen. A switchable Air mode will add extra clarity to your acoustic instruments when recording with your Solo 3rd Gen
- Get the perfect guitar and vocal take with - With two high-headroom instrument inputs to plug in your guitar or bass so that they shine through. Capture your voice and instruments without any unwanted clipping or distortion thanks to our Gain Halos
- Studio quality recording for your music & podcasts - Achieve pro sounding recordings with Scarlett 3rd Gen’s high-performance converters enabling you to record and mix at up to 24-bit/192kHz. Your recordings will retain all of their sonic qualities
- Low-noise for crystal clear listening - 2 low-noise balanced outputs provide clean audio playback with 3rd Gen. Hear all the nuances of your tracks or music from Spotify, Apple & Amazon Music. Plug-in headphones for private listening in high-fidelity
- Everything in the box: Includes Pro Tools Intro+, Ableton Live Lite, Cubase LE, and Hitmaker Expansion: a suite of essential effects, powerful software instruments, and easy-to-use mastering tools
ffprobe -v error -show_streams -show_format -of json INPUT
Replace INPUT with the file or media source you are checking. Compare the audio and video stream start times, durations, time bases, and timestamp progression. Check the local output as well as the source: that helps locate where the mismatch first appears.
Confirm that the installed FFmpeg build supports any filter or option you plan to use. Syntax and available options can vary by build and version; check the local FFmpeg filter help before relying on an option in a production command. Do not infer that an Azure VM is the cause merely because the stream runs there. The source arrangement, timestamps, FFmpeg version, resource load, and output topology all matter.
Fix growing drift with measured timestamp compensation
If audio gradually drifts and the timestamps are a reliable reference, test FFmpeg’s audio resampler compensation:
Rank #2
- The new generation of the songwriter's interface: Plug in your mic and guitar and let Scarlett Solo 4th Gen bring big studio sound to wherever you make music
- Studio-quality sound: With a huge 120dB dynamic range, the newest generation of Scarlett uses the same converters as Focusrite’s flagship interfaces, found in the world's biggest studios
- Find your signature sound: Scarlett 4th Gen's improved Air mode lifts vocals and guitars to the front of the mix, adding musical presence and rich harmonic drive to your recordings
- All you need to record, mix and master your music: Includes industry-leading recording software and a full collection of record-making plugins
- Everything in the box: Includes Pro Tools Intro+, Ableton Live Lite, Cubase LE, and Hitmaker Expansion: a suite of essential effects, powerful software instruments, and easy-to-use mastering tools
-af aresample=async=1000
This is a starting point for diagnosis, not a universal setting to copy blindly. In FFmpeg’s Resampler Documentation, the async option is described as synchronizing audio samples to timestamps by stretching or squeezing audio, or by filling or trimming samples. Values above 1 specify the maximum number of samples that may be stretched or squeezed per second. Compensation is disabled by default: “Default value is 0, thus no compensation is applied to make the samples match the audio timestamps.”
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Test a representative segment, then compare its audio and video against the source timestamps and the resulting local output. Increase or decrease the allowed adjustment only after measuring the drift and confirming that the source timestamps are useful. Excessive correction can alter audio timing unnecessarily; it does not repair incorrect or unreliable timestamps by itself.
Correct a constant offset at the start
When the mismatch is already present at the beginning and remains roughly constant, measure the offset and identify which input starts early or late. Correct the timing of the relevant input, or use an appropriate audio or video delay filter in the command that processes it. The exact delay and filter depend on whether your inputs are separate, their timestamps, and which stream is early; without those details, a specific numeric delay or command would be guesswork.
Rank #3
- PLUG IN AND HEAR SOUND IN SECONDS - USB Type-A connector with a 3.5mm stereo headphone output and a separate 3.5mm mono microphone input. No drivers, no software, no external power - the adapter is USB bus-powered and is recognized as a standard USB audio device.
- WORKS ON WINDOWS, MAC AND LINUX - Driverless on Windows 98SE/ME/2000/XP/Server 2003/Vista/7/8, Linux and Mac OSX, and compliant with the USB Audio Device Class 1.0 specification, so any system that supports class-compliant USB audio will see it. Select it as the sound output and input device after plugging it in.
- TWO JACKS, TWO JOBS - The green jack is stereo OUT for headphones or powered speakers; the pink jack is mono microphone IN for a 3.5mm mic. It does NOT support 4-pole headsets on a single combo plug, it does NOT power passive speakers, and it does NOT add surround sound - it is a stereo 2-channel adapter.
- FOR LAPTOPS AND DESKTOPS THAT NEED AN AUDIO PORT BACK - Adds a headphone and mic port to a laptop, desktop, or mini PC whose onboard jack has failed or was never there. Managed and work-issued computers can block new USB audio devices by policy - check with your IT department before ordering for a company machine.
- SABRENT SUPPORT AND WARRANTY - What is in the box: one USB audio sound adapter. Backed by a 1-year limited warranty, extended to 2 years when you register within 90 days on the manufacturer's website.
FFmpeg’s resampler also has a first_pts option. It can pad or trim at the start when you know the expected first timestamp. That is an initial-alignment tool, not a cure for continuing clock drift. Do not use a start adjustment to conceal a mismatch that changes over time.
Keep audio and video on a common timeline
If FFmpeg routes a YouTube Live input to separate outputs—such as a video device and a sound card—those sinks may buffer and schedule playback independently. A discussion on the FFmpeg-user mailing list describes this kind of split-output arrangement. When the goal is a synchronized encoded stream, keep audio and video on a common timestamp timeline and mux them into one output where the architecture permits. A delay value observed in one run is not a dependable correction for later runs if the offset changes.
FFmpeg’s output synchronization modes and the muxer affect timestamps. Options that copy timestamps or alter frame-rate handling are not general fixes for bad input timing. In particular, do not apply -copyts or a frame-rate mode as a blanket remedy: establish what the input timestamps mean, then change timestamp behavior deliberately.
Rank #4
- Podcast, Record, Live Stream, This Portable Audio Interface Covers it All - USB sound card for Mac or PC delivers 48kHz audio resolution for pristine recording every time
- Be ready for anything with this versatile M-AUDIO interface - Record guitar, vocals or line input signals with two combo XLR / Line / Instrument Inputs with phantom power
- Everything you Demand from an Audio Interface for Fuss-Free Monitoring - 1/4" headphone output and stereo 1/4" outputs for total monitoring flexibility; USB/Direct switch for zero latency monitoring
- Get the best out of your Microphones - M-Track Duo’s transparent Crystal Preamps guarantee optimal sound from all your microphones including condenser mics
- The MPC Production Experience - Includes MPC Beats Software complete with the essential production tools from Akai Professional
Check YouTube ingest settings and locate the failure
YouTube’s RTMP/RTMPS live-streaming guidance lists H.264, H.265, or AV1 video and AAC or MP3 audio. It recommends a 2-second keyframe interval, not exceeding 4 seconds, and audio at 44.1 kHz for stereo or 48 kHz for 5.1. These are ingest recommendations; following them does not prove that the source timestamps are correct.
Test with representative sound and motion, and monitor YouTube stream health. YouTube’s troubleshooting guidance also points streamers to encoder errors, CPU load, and outbound connectivity. Use the local recording to choose where to investigate:
- Archive is already out of sync: focus on source timing, FFmpeg processing, and the way inputs are combined.
- Archive is clean, but the YouTube preview is not: inspect the publishing path, stream health, network, and player conditions.
- Only separate playback devices disagree: examine each output’s buffering and scheduling; that is different from proving the encoded stream itself is out of sync.
These checks help isolate the fault; they do not establish that Azure networking or CPU load caused a particular sync problem.
Recommended Free Tools
Best Value
- The new generation of the artist's interface: Connect your mic to Scarlett's 4th Gen mic pres. Plug in your guitar. Fire up the included software. Start making your first big hit
- Studio-quality sound: With a huge 120dB dynamic range, the newest generation of Scarlett uses the same converters as Focusrite’s flagship interfaces, found in the world's biggest studios
- Never lose a great take: Scarlett 4th Gen's Auto Gain sets the perfect level for your mic or guitar, and Clip Safe prevents clipping, so you can focus on the music
- Find your signature sound: Air mode lifts vocals and guitars to the front of the mix, adding musical presence and rich harmonic drive to your recordings
- With Scarlett 4th Gen, you have all you need to record, mix and master your music: Includes industry-leading recording software and a full collection of record-making plugins
Troubleshooting common FFmpeg sync problems
| What you observe | What to check | Next step |
|---|---|---|
| Audio is late or early by about the same amount throughout | Compare the streams’ start times and measure the offset in both the source and output. | Correct the early or late input with a measured alignment adjustment. Do not use drift compensation to solve a fixed start offset. |
| The gap changes over time | Inspect timestamp progression, time bases, track durations, and whether the source timestamps are trustworthy. | Test aresample compensation only if timestamps are a suitable reference; compare the result to the source. |
| Separate audio and video outputs disagree | Check whether the outputs have independent buffering or scheduling. | For a synchronized encoded stream, keep both tracks on a common timeline and mux them together when possible. |
| Local archive is synchronized, YouTube preview is not | Check YouTube stream health, encoder errors, outbound connectivity, and playback conditions. | Investigate the delivery and playback path before changing source alignment. |
| A suggested option or filter is unavailable | Check the installed FFmpeg version and build’s local help. | Use options supported by that build; do not assume another version’s command will work unchanged. |
Or let it run in the cloud
If this is a prerecorded-video stream you want to keep running on YouTube, StreamNeo is a cloud alternative to maintaining an always-on FFmpeg process on an Azure VM. Upload a recording or build a playlist, add your YouTube stream key, and go live. StreamNeo loops uploaded videos; it does not broadcast from a camera, and it streams to YouTube only.
- Your computer and home connection do not have to stay on.
- Uploads stream as made, at any quality up to 4K 60fps, for one flat price per slot.
- StreamNeo automatically recovers if YouTube drops the stream.
- The first day is free with no card; the trial is one free day per account.
The Monthly price is $9.99 per month. See StreamNeo, or start your free day.
Quick Recap
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.

