Skip to content
streamneo.
Troubleshooting12 min read

How to Fix an FFmpeg Playlist Schedule That Drifts Out of Sync on YouTube Live

Diagnose FFmpeg playlist timing by comparing local output, media metadata and YouTube Live evidence before changing timestamps or ingest settings.

sn.
StreamNeoPublished 4 October 2026
Worth sharing?

“Out of sync” can mean the next playlist item starts late, timing errors accumulate over a loop, audio separates from its picture, or viewers see the stream later than expected. These are different symptoms, so do not change FFmpeg flags until you know which one you have.

Start by comparing the playlist’s local output with the files’ metadata and the Live Control Room preview. If the local recording already has the problem, investigate the inputs and concat timeline; if it does not, then check ingest health, encoding and network conditions. Viewer delay by itself is not proof that the playlist schedule is drifting.

Identify the kind of drift

Write down what you see, where it first appears and whether it repeats at the same file or loop boundary. “The stream is five minutes behind” could mean the channel’s planned clock is late, a particular transition inserted a gap, or playback is simply delayed for viewers. The distinction determines what evidence to collect.

A playlist schedule drift is about the relationship between the playlist timeline and expected clock time. For example, a news loop intended to begin its morning segment at the top of each hour may gradually start that segment later relative to the clock. Transition errors are more local: one item may start late, pause, jump, or leave a gap before the next. If the defect repeats at one specific boundary, inspect the two files around that boundary before rewriting the whole command.

Audio/video sync is a separate question. Listen for speech or a beat that moves away from the corresponding picture within an item, or becomes misaligned only after a transition. Compare the same moment in the source file and in an FFmpeg recording. A mismatch already present in the source is different from one introduced by concatenation or output timestamps.

Playback latency describes how far behind a viewer is from the live event or encoder. It can vary by playback mode, buffering and connection conditions without changing which playlist item FFmpeg is sending. YouTube describes latency as capture-to-viewer delay; it is not a clock for diagnosing concat duration errors. Keep a note of the symptom category rather than treating all delay as “drift”.

Record the time, item name, expected start and observed start. Also note whether you observed it in the local output, YouTube’s preview, or only on a viewer device. This small log prevents a later change from appearing to help merely because the comparison was made at a different place in the stream.

Compare local output with Live Control Room preview

Before changing the FFmpeg command, compare what leaves the encoder with what YouTube receives. Save a local recording or monitor the encoder output, and inspect the same moment in the Live Control Room preview. If practical, compare identifiable cues such as a spoken line, a scene cut, a clock overlay or the start of a song. Do not compare only the viewer’s watch page, where playback delay may differ.

If audio or picture is already out of sync in the local output, begin with source files, stream compatibility and timestamp handling. YouTube cannot repair a defect that is present before ingest. If the local output looks continuous and stays in sync but the preview stalls, drops quality or behaves differently, review YouTube’s stream-health messages, encoder status and outbound connection before altering playlist durations.

YouTube Help recommends checking the stream directly in the encoder, reviewing dashboard errors and CPU load, inspecting the local archive, and testing outbound internet quality. Its live streaming troubleshooting guidance is useful once you have separated a local timeline defect from a delivery problem. A clear preview comparison is also useful evidence when asking someone to review the command: tell them the exact file and timestamp, rather than saying only that the stream is delayed.

A preview may itself be behind the encoder. That does not automatically mean it has lost time relative to the playlist; it may be receiving the same sequence later. Look for sequence and continuity as well as wall-clock delay. If the expected transition occurs in the right order locally and in preview, but the preview is consistently later, investigate latency and delivery separately.

For a playlist that begins late rather than accumulating timing error, compare the scheduled start and the first item’s actual beginning. The practical distinction is covered in this guide to a playlist rotation that starts late. Do not borrow a fix from that different symptom unless your evidence shows the same failure.

Inspect input durations and metadata

Inventory every playlist item before editing the command. Use ffprobe or another media inspector to record each file’s reported duration, streams, codecs, time bases, frame rate, audio sample rate and start timestamps. Compare reported duration with actual playback, especially for files that are truncated, variable-frame-rate, remuxed or exported by different tools. Metadata is evidence, not a guarantee that the media ends precisely where its duration says it does.

For a simple inspection, an ffprobe command can print stream and format details:

ffprobe -v error -show_entries format=duration,start_time:stream=index,codec_type,codec_name,time_base,r_frame_rate,avg_frame_rate,sample_rate,start_time,duration -of json input.mp4

Run it on files on both sides of a bad transition as well as on several apparently good items. Compare like with like: video stream count, audio presence, codec and time base, and whether the duration reported by the container matches the audible and visible end. One file without audio among files with audio, for example, may not fit a concat workflow that assumes matching streams.

If a container reports an implausible duration, verify the actual file in a player or by examining its timestamps before overriding anything. A known-correct duration can be useful, but guessing one from the filename or intended programme length may move the error to the next item. Keep the original file unchanged and test corrections on a copy.

For a loop of devotional songs, a last track with silence or a different export format can make the next track appear late even if the nominal duration looks plausible. Compare the end of the first file, the beginning of the next, and the assembled local output. This example of streaming a Hindi bhajan playlist as a live loop is relevant to playlist preparation, but the files’ own metadata still determines what FFmpeg can schedule accurately.

Check concat demuxer duration assumptions

The concat demuxer reads files sequentially as though their packets were joined together. It uses each file’s duration to decide where the following file begins, and adjusts timestamps globally. Therefore, incorrect or computed duration information can produce artifacts at a boundary or place a later item at the wrong timestamp. The FFmpeg concat demuxer documentation describes both the duration behaviour and the stream-matching requirements.

This is a plausible mechanism, not a diagnosis by itself. Do not decide that duration metadata is the cause unless the command uses the concat demuxer, the relevant file’s metadata or actual length supports the theory, and the local output comparison shows the timing defect. Other playlist methods and timestamp handling can behave differently.

A concat list may include a duration directive to override a file’s stored duration. Use it only when you have established the correct media duration. If the file is genuinely shorter or longer than its metadata says, a verified correction can help place the next item; if the duration is merely guessed, it can create a different gap or overlap. Keep a copy of the original list so you can reproduce the previous result.

Check whether the error grows with each item or appears only after a particular one. A steady accumulated offset is consistent with repeated duration or timing discrepancies, but does not prove that explanation. A single repeated jump at the same boundary points towards inspecting that pair of files and the list entry that joins them. Record the observed offset at multiple transitions, not just at the end of a long stream.

Do not add timestamp flags as a substitute for understanding the timeline. FFmpeg documents -re as reading input at its native frame rate, equivalent to -readrate 1; this paces prerecorded media for real-time output, but it does not correct a wrong duration. -copyts preserves input timestamps, and -start_at_zero changes their reference when used with -copyts. Their effect depends on the command and muxing path, so test one deliberate change at a time against a local recording.

Confirm the inputs meet concat requirements

The concat demuxer expects the files to have the same streams, codecs and time base. A playlist containing items with different stream layouts or incompatible timing characteristics does not become reliable simply because they appear in one text list. Inspect the inputs and compare them; do not assume that files with the same extension are equivalent.

Pay attention to missing audio, extra audio tracks, different video dimensions or frame rates, and differing timestamp bases. Some differences can be handled by other workflows, but a generic flag cannot make arbitrary mismatches safe for the concat demuxer. When files do not meet the documented requirements, prepare consistent versions or use a suitable filter-based workflow, then verify the output locally.

Normalising usually means producing files with a consistent stream layout and timing format. The exact conversion depends on the source material and desired output; there is no single conversion command that is right for every mix of files. Keep quality and storage trade-offs in view: re-encoding may take time and can change picture or sound, while stream-copy approaches may preserve incompatibilities. Test representative files, including the troublesome boundary, before rebuilding a full playlist.

A useful test is to assemble just two adjacent files and inspect the transition. Confirm the first ends as expected, the second begins at the expected time, and audio remains aligned. Then test a longer sequence to see whether the offset accumulates. If you are preparing a single seamless visual loop rather than a playlist of distinct programmes, this seamless-loop preparation guide addresses a different source of boundary discomfort; it does not replace checking concat compatibility.

Review FFmpeg output and timing locally

Make a short, controlled test that includes the problem transition and enough material after it to tell whether timing continues to diverge. Save the output if possible. Inspect its timestamps, listen to speech or rhythm, and watch for duplicate frames, freezes, gaps or abrupt jumps. A local test is easier to repeat than judging a long-running live channel by memory.

Read the FFmpeg log around the transition. Note warnings about non-monotonous timestamps, invalid data, dropped or duplicated frames, stream mapping and encoder overload. A warning is a clue, not proof that it caused the observed symptom; tie it to the same moment in the output. Keep the exact command, FFmpeg version, input list and relevant logs together when testing changes.

Change one variable at a time. If you correct a known duration, compare before and after at the same boundary. If you normalize an incompatible file, repeat the two-file test. Avoid stacking -re, -copyts, -start_at_zero and frame-rate options without a specific reason: multiple changes make it difficult to know which one affected the result. Pacing a file at real time and fixing its timeline are separate jobs.

Once local output is sound, test the live path. YouTube’s encoder settings guidance covers supported formats and ingest recommendations. For RTMP/RTMPS, YouTube lists H.264, H.265/HEVC and AV1 video, AAC or MP3 audio, and constant bitrate (CBR); it recommends a two-second keyframe interval and says not to exceed four seconds. These are ingest compatibility and stream-health checks, not a universal remedy for a playlist duration error.

YouTube’s live error guidance also discusses keyframe frequency and closed GOP for optimal transcoding. Use the official live encoder settings and bitrate guidance for current requirements rather than copying a bitrate from an unrelated resolution or frame rate. If the Control Room reports a stream-health issue, address the reported condition and retest; do not infer from a keyframe warning that it caused a local playlist drift.

For an always-on channel, the test should include the transition that has failed before, not just a clean opening. A prepared file and a documented test command make it easier to tell whether a change improved the output. If maintaining a computer and process through the night is itself the recurring operational burden, StreamNeo can take that machine-off schedule out of the equation by turning an uploaded file into a YouTube live stream that is monitored and restarted if it drops; it does not remove the need to prepare compatible media and verify the channel’s content and timing.

Separate playback latency from timeline drift

Latency is the time between the encoder’s live output and when a viewer sees it. It can be affected by the selected YouTube latency mode, buffering, viewer connection and delivery path. Timeline drift instead asks whether the playlist is advancing according to the intended schedule, and whether each following item is placed correctly. A viewer arriving late may be seeing a delayed but otherwise correct stream.

Compare local output, Live Control Room preview and a viewer-facing playback sample at the same identifiable cue. If the local file and preview show the same sequence at different wall-clock times, examine latency and delivery. If the local output itself has a gap or accumulating offset, resolve that first. YouTube’s streaming tips advise leaving upload bandwidth headroom and monitoring audio and video quality; the platform recommends 20% headroom beyond the total stream bitrate. This is an operational recommendation, not evidence that bandwidth caused a playlist timeline defect.

Do not confuse a stream that buffers with one whose schedule is late. Buffering can interrupt what a viewer sees while the encoder continues sending the intended sequence. Likewise, a dashboard health warning indicates something about ingest or stream quality, but it does not identify an incorrect concat duration without matching local evidence.

If local output is correct and the preview is poor, check encoder CPU load, dropped frames, network stability and the stream-health messages. Compare the outbound connection with the total stream bitrate and leave headroom rather than running the upload at its apparent maximum. Change delivery settings only when the evidence points there, and test again while observing both the encoder and Control Room.

Before committing, compare the operating options on the pricing page. When the file and channel are ready, start free — 24-hour trial, no card.

FAQ

Why does my FFmpeg playlist drift over time?

There is no single cause established by the symptom alone. Compare the command, input durations and stream layouts, then check whether the local output accumulates an offset across successive items. The concat demuxer uses file durations to place later files, but metadata and timestamp problems need to be demonstrated in your own playlist.

Why does the next video start late?

Inspect the file immediately before it, including its actual end, reported duration and timestamp behaviour. If the command uses the concat demuxer, an inaccurate duration can place the following file incorrectly; a gap or pause can also come from the media itself or incompatible inputs. Reproduce the boundary locally before changing the live setup.

Why is my playlist audio out of sync after a transition?

Compare the source files with a local recording of the joined output. Check whether the streams match the concat requirements and whether audio and video lengths or start timestamps differ at the boundary. Do not treat viewer playback delay as evidence of an audio/video timing fault.

Is the delay in FFmpeg or YouTube Live?

Compare the encoder’s local output with the Live Control Room preview at the same cue. A defect already present locally points towards the files, concat or timestamp handling; a clean local output with a poor preview calls for checking ingest health, encoder load and the outbound connection. Viewer-facing latency can be separate from both.

YOU’VE REACHED THE END

Keep the ideas coming.

More guides, useful tools and a little help for your next broadcast.

Back to the journal ↗
YOUR NEXT READ

A little more to explore.

More Troubleshooting guides ↗ · All topics ↗