Skip to content
streamneo.
Troubleshooting11 min read

YouTube Live Stream Shows a Black Gap Between Videos in an FFmpeg Playlist

Diagnose black gaps in an FFmpeg playlist by checking the outgoing feed, clip streams, duration metadata and concat timestamps.

sn.
StreamNeoPublished 4 October 2026
Worth sharing?

A black gap between videos in an FFmpeg playlist does not identify one cause by itself. First establish whether the gap is in the outgoing feed, then compare the clips’ streams, duration metadata and timestamps before changing the command.

FFmpeg’s concat demuxer uses duration information to position each file after the previous one, and its documentation warns that differences in stream lengths can leave gaps. Inaccurate duration metadata and incompatible streams are also worth checking. Stream copy is suitable only when the inputs and timing are compatible; it does not repair either problem.

Confirm the gap is in the outgoing feed

Start by finding where the black picture appears. If you can, view or record FFmpeg’s output locally at the point it is sent to YouTube, then compare it with the live playback. If the local output is already black between clips, investigate the source files and the concatenation process. If the outgoing output is continuous but YouTube playback shows a gap, look at ingest, stream health and playback as well.

Check the files individually at the same points where the playlist changes. A clip may begin with black frames, contain an intentional fade, or end before its audio does. Those are different from a blank interval inserted between clips. If the live broadcast is already over, the recording or archive can help identify the transition, though its playback may not exactly reproduce the live ingest path.

Keep a short, consistent record of what you observe: the playlist order, the transition time, whether audio continues, and whether the local output also goes black. Save the FFmpeg command and relevant log lines from that run. Without these details, changing a timestamp option or adding a filter can hide one symptom while making another harder to diagnose.

YouTube’s LiveStreams resource describes stream-health status as a diagnostic for live broadcasts. Use the available health information alongside your local observation rather than assuming a black frame in playback proves that FFmpeg inserted it. For a broader routine for spotting playback problems on an always-on channel, see how to monitor a YouTube stream for playback errors.

Inspect each input’s streams and codecs

Before editing the playlist, inspect every file it references with ffprobe. The useful comparison is not just whether each file plays. Record its video and audio streams, codecs, time bases, duration, frame rate, dimensions, and audio properties. A playlist that mixes a video-only clip, a clip with audio, and a clip with a different video codec may need a different processing path from a set of consistently encoded files.

For example, one entry might have H.264 video and AAC audio, while another has a different video codec, no audio stream, or a distinct time base. These differences matter because the concat demuxer expects corresponding streams to match in important respects, including streams, codecs and time bases. A file that looks visually similar in a media player is not necessarily a compatible input for packet-level concatenation.

Compare the stream count and order as well. If one clip contains two audio tracks and another contains one, the same output mapping may not behave as intended throughout the playlist. If one file has no audio, do not assume FFmpeg can copy an audio stream seamlessly across every transition. First decide what the output should contain, then ensure the inputs can supply it or are normalised to a common layout.

The probe results are evidence, not a diagnosis on their own. Note which fields differ and whether each difference lines up with the transition that produces the gap. Keep the original files unchanged while testing a working copy of the playlist. This gives you a reliable way to revert if a trial introduces a new problem.

If your channel combines replay footage and a separate music track, the audio layout deserves particular attention: the guidance on adding background music to a YouTube replay stream covers a related case. Here, the key question is whether the playlist entries themselves present matching streams for the operation you intend to use.

Check duration metadata for accuracy

The concat demuxer positions the next file using the duration of the preceding file. If a duration is wrong, the next file’s timestamps can be placed too early or too late. FFmpeg’s documentation notes that duration information can be inaccurate, including when estimated from bitrate or when a file is truncated; incorrect values can result in artifacts.

Compare the reported duration for each file with its actual playback. Look for a clip that stops earlier than its metadata suggests, a file that was cut off during export, or a duration that appears implausible beside the visible content. Pay attention to audio and video separately: one stream can end before the other, so a single container-level duration may conceal a difference relevant to the transition.

Do not change durations merely because the resulting stream has a gap. First establish that the stored duration is wrong and determine the intended endpoint. In a concat list, FFmpeg supports a per-file duration directive that can override the stored duration. That is an option for a demonstrated metadata problem, not a general gap-filling instruction. An incorrect override can shift later timestamps and create a different discontinuity.

For a short test, compare the transition timing before and after correcting a verified duration. Preserve the original playlist and record the value you changed. If the transition moves in a way consistent with the duration correction, that is useful evidence. If the gap remains unchanged, return to the other possibilities rather than stacking duration edits without a clear reason.

Keep a distinction between a file’s reported duration and the time at which its video and audio packets end. Those can differ. Where the streams have unequal lengths, FFmpeg warns that global timestamp adjustment may cause gaps. A duration edit may affect where the next file begins, but it does not make mismatched stream endings disappear.

Review concat timestamp adjustment

The concat demuxer adjusts timestamps across files globally. FFmpeg describes the next file as starting where the previous one finishes, based on file durations, and warns that this can create gaps if streams do not have exactly the same length. That behaviour explains why a playlist can show a black interval even when no black frames are present in either source file.

Inspect the concat list itself as well as the media. Confirm that paths point to the files you intended, that the order is correct, and that any per-file directives apply to the right entries. A stale path or an unexpected duplicate can look like a timing issue when the playlist is actually sending a different clip than you think. If the playlist is generated automatically, inspect the generated file used by the current run, not just the template or an older copy.

Then examine FFmpeg’s output around the transition. Retain the log and look for duration warnings, timestamp discontinuities, dropped or duplicated frames, and evidence that streams begin or end at different times. The exact messages depend on the command and inputs, so do not treat one warning as proof that it caused the visible gap. Correlate the log with the transition time and the probe results.

Avoid treating a different concat command as a guaranteed fix. The concat demuxer can be useful where file-level concatenation is unsuitable, but it still relies on compatible inputs and timing information. Changing methods without checking those constraints can leave the cause unresolved. If you are building a long-running playlist, the guide to keeping two scheduled YouTube Live streams from sharing a playlist is relevant to playlist management, but it does not replace checking timestamps in the media itself.

Compare stream properties across clips

Lay out the probe results side by side. Compare each corresponding video stream and audio stream, noting differences in codec, time base, frame rate, dimensions, channel layout and sample rate. FFmpeg’s concat requirements focus on matching streams, codecs and time bases; the other properties help reveal whether your chosen output can stay consistent across transitions.

What to compare Why it matters What to do with a difference
Stream count and type A missing audio or video stream changes what is available at a transition. Decide whether the output should include that stream, then map or normalise deliberately.
Codec and time base The concat demuxer requires corresponding streams to be compatible. Do not assume packet copying will make unlike streams match. Consider a common output format.
Duration and stream endpoints Video and audio may not finish together, and duration metadata may be inaccurate. Verify actual endpoints before applying a duration override.
Frame rate and dimensions Different clip formats may require a consistent output for the intended broadcast. Choose an output format based on the inputs and playback needs.
Audio properties Different channel layouts or sample rates can complicate continuous audio. Plan audio handling alongside video, not as an afterthought.

A difference is not automatically the cause of a black frame, but it can make stream copy unsuitable or require deliberate conversion. For example, if one clip has no audio and the next does, decide whether silence is needed during that section or whether the output should have a different audio plan. Likewise, mixed dimensions or frame rates may call for normalisation so that the outgoing stream has consistent properties.

Make one change at a time in a test copy. If you change duration, timestamp handling, stream mapping and encoding all at once, a successful result will not tell you which change mattered. A measured process is especially useful when the channel runs unattended overnight: retain the known-good playlist and keep notes on each test rather than replacing the live configuration with an unverified experiment.

Decide whether stream copy is suitable

Stream copy means copying encoded packets without decoding, filtering or re-encoding. It avoids a decode-and-encode pass, but it does not normalise incompatible streams or correct inaccurate duration metadata. FFmpeg’s documentation on stream copy makes that distinction clear: copied packets remain encoded as they were in the input.

Use stream copy only when the probe results show that the inputs are compatible for the concat operation and the timing is sound. If codecs, corresponding streams or time bases differ, do not recommend -c copy as a repair. It cannot turn those inputs into a common format. A command that works for one carefully matched set of files is not evidence that the same command is appropriate for another playlist.

When the inputs need a common format, consider a decode/filter/re-encode workflow with explicit video and audio handling. That route gives you a chance to normalise properties, but it requires processing time and a deliberate choice of output settings. The right settings depend on the actual media and how it is being sent to YouTube, so there is no safe universal filter command to substitute for inspecting the files.

The practical trade-off is between preserving the existing encoded packets and doing enough processing to make transitions consistent. Stream copy is less work when the files already match; normalisation is the more appropriate route when they do not. If your main pain is keeping a file-based channel running without leaving your computer on, StreamNeo can remove that computer-uptime task by turning an uploaded video into a YouTube broadcast that runs with your computer off, but it does not determine whether an FFmpeg playlist’s clips have compatible streams or correct durations.

Retest the concatenated output

Test a short segment that includes the suspect transition before returning the playlist to a live schedule. Check the resulting file or outgoing preview frame by frame around the join, and listen for audio that cuts out, overlaps or continues through a black picture. Compare this result with the original clips and the previous test so that you can see whether the change addressed the observed defect.

If the local concatenated output is clean but the YouTube feed is not, examine the outgoing encoder and ingest path next. YouTube’s encoder settings guidance recommends a two-second keyframe interval and says not to exceed four seconds. These are general live encoder recommendations, not a diagnosis or a guarantee that a playlist transition will be clean. Apply the settings that fit your resolution, frame rate and ingest method, and check YouTube’s current official guidance.

Use the stream-health status and the FFmpeg logs together. A problem indicated at ingest may point to the outgoing encode or connection; a clean ingest status does not prove that the source transition looks right to viewers. If YouTube playback alone shows the gap, compare another playback view or the available broadcast recording before changing the playlist again.

Keep the successful test settings with the playlist and command that produced them. If the issue returns, you can compare the new files and logs against a known-good run. For an always-on channel, that record is more useful than relying on a remembered command change, particularly if different people maintain the playlist.

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

Does a black gap prove that FFmpeg’s concat demuxer inserted it?

No. The gap may be present in a source clip, appear during concatenation, or arise later in encoding, ingest or playback. Compare the individual files, local output and YouTube stream-health information before deciding where it was introduced.

Will the concat demuxer always remove gaps between clips?

No. It adjusts timestamps using duration information, and FFmpeg warns that streams with different lengths can leave gaps. Inaccurate durations can also cause artifacts, so inspect both stream endpoints and metadata rather than expecting a particular concat method to guarantee continuity.

Can I use -c copy for any playlist of video files?

No. Stream copy passes encoded packets through; it does not make incompatible streams match or repair bad timing. Use it only when your probe results show that the inputs and timestamps are suitable for copying.

What should I check if the local output is clean but YouTube shows black frames?

Look at the outgoing encoder configuration, the live stream’s health status and the playback path. YouTube’s encoder guidance is a useful reference, but its general recommendations do not identify the cause of a particular gap. Compare the local output and the live result around the same transition.

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 ↗