If your 24/7 YouTube music stream has silence or a pause between tracks, first find out whether the gap is already present in FFmpeg’s output or appears only after YouTube receives it. The concat demuxer advances each file’s timestamps using the previous file’s duration, so inaccurate duration data or audio and video streams ending at different times can create boundary artifacts.
Once the playlist timeline is sound, check the encoder and network separately. If you need to replace the stream’s still image or scene while diagnosing it, prepare and switch that visual in OBS without stopping the existing stream output or music.
Prepare the replacement image or scene
Start by separating the visible problem from the audio problem. A frozen or blank picture is not the same failure as silence between songs, even if both start at a playlist boundary. Note the time of the next apparent gap, and compare the local FFmpeg output with the YouTube stream if you can do so without disrupting the live broadcast.
For a visual replacement, prepare the new image or OBS scene before touching the live scene. Use a file you can identify easily, with a clear name such as music-background-new.png, and store it where the OBS computer can read it. Check that the image is appropriate for the channel and that its aspect ratio suits the canvas you already use. A devotional stream, for example, may use a simple deity image with enough empty space around the edges to avoid cropping the subject when fitted to the canvas.
If you use a scene rather than a single image source, add the replacement scene in advance. Keep the current scene intact. In OBS, a scene can combine sources such as an image, text, or a visualiser; changing the scene is a presentation change, not a YouTube Studio operation. Be clear about whether the change is meant to replace only the static visual or also alter overlays and other sources.
Do not use the visual change as a way to hide a playlist gap. If the music itself drops out in the FFmpeg output, a new image will not restore audio. You are preparing a safe, reversible visual change while you investigate the timeline separately.
For context on continuous playback arrangements, see how to make OBS play a podcast playlist continuously. That workflow is relevant to source handling, but the same principle applies here: diagnose what is sent to the encoder rather than assuming a changed screen will repair the media sequence.
Check crop, size, and position
Before switching, confirm how the replacement will fit. In OBS, select the image source and use the preview to inspect its bounds. Depending on the source and canvas dimensions, an image may be stretched, fitted with unused space around it, or cropped to fill the frame. Choose the result deliberately: stretching can distort a logo or face, while cropping may cut off important parts of an image.
The canvas and output dimensions are separate from the source image’s own size. If the existing programme uses a particular resolution, retain that arrangement for a routine picture change. A replacement image that is smaller than the canvas may look soft or leave gaps; a larger one may be cropped. You do not need to alter output resolution or bitrate just to change a still image.
In OBS, use the transform controls to fit or centre the source, then check the full preview rather than judging only the selection handles. Make sure the image covers the intended area and that any text remains readable. If the old visual included a logo or stream title, check that the replacement does not cover it unexpectedly. When a source is below or above other sources in the scene stack, confirm the intended layer order before going live with it.
Keep a copy of the old scene or source arrangement until the new one has been verified. A reversible change is easier to troubleshoot than several simultaneous edits. If the replacement is positioned incorrectly, switch back to the known scene or adjust the source while the output continues, rather than ending the stream to rebuild it.
Switch the active visual in OBS
OBS controls the scenes and sources it is sending through the encoder. YouTube Studio shows and manages the incoming live broadcast, but it does not provide controls for choosing an OBS image or switching an OBS scene. Make the visual change in OBS on the computer that is producing the broadcast.
For a scene change, click the prepared scene in OBS. For a source change within the current scene, hide the old image source and show the new one, or use a prepared scene containing the replacement. Make only the intended visual change. If you also alter audio routing, scene transitions, output settings, or the FFmpeg process at the same time, you will make it harder to tell which change affected the result.
Watch the OBS preview immediately after switching. Confirm that the new picture is visible, covers the intended canvas, and does not expose a blank layer. If you use a transition, allow it to complete and check the final frame. Keep the old scene available until you have confirmed the new visual in the YouTube preview.
This is an encoder-side operation. It is distinct from changing the title, description, latency, or other broadcast settings in YouTube Studio. YouTube’s live encoder settings guidance describes supported ingest settings; it does not turn Studio into a remote OBS scene switcher.
For an always-on setup, plan who can access the OBS machine and make the change. A local operator can switch scenes directly; an unattended or remote setup needs a reliable way to control the running encoder without accidentally starting a second broadcast. If you are evaluating how a long-running OBS setup is arranged, the guide to setting up a 24/7 YouTube stream on Ubuntu VPS with OBS covers the broader operational context.
Keep stream output and music running
A routine still-image or scene change should not require stopping the encoder or ending the YouTube stream. Leave OBS streaming output running and preserve the current audio source or FFmpeg audio path. Switching the active visual is not the same as restarting the programme output.
This distinction matters when a gap is being investigated. If you stop output to change an image, you introduce a new interruption and lose the ability to observe whether the original problem recurs at the next boundary. Keep a note of the time of the visual switch and whether audio continued through it. That gives you a cleaner before-and-after comparison.
If the music is produced by an external FFmpeg process and OBS is only handling the picture or ingest, do not inadvertently mute, replace, or disconnect that audio source while changing scenes. Check the OBS audio meters, and listen to the programme output if possible. A moving meter is useful but does not prove that the correct music is reaching YouTube, so verify at the listener end as well.
There is one practical limitation: not every setup sends picture and sound through OBS in the same way. Some use OBS for both; others use an FFmpeg process as the encoder and do not have a live OBS scene at all. In the latter case, OBS cannot switch a visual that it is not sending. Make the visual change in the application producing the outgoing picture, and avoid launching a second encoder to work around the problem.
For readers whose main issue is continuity of a prerecorded channel, Linux software for automating prerecorded YouTube live streams explains the operational choices at a wider level. If keeping a local computer running is itself the recurring difficulty, StreamNeo can remove the need to keep that computer on for a file-based 24/7 YouTube broadcast, but it does not correct bad timestamps in the source playlist.
Diagnose the playlist boundary first
To answer “Why does my FFmpeg playlist have gaps between songs?”, inspect the actual media timeline before changing YouTube settings. Save or monitor a section of the local FFmpeg output around a boundary. If the same silence or visual stall is present there, the problem is in the playlist inputs or their concatenation, not a YouTube control.
The FFmpeg concat demuxer documentation explains that each file’s duration is used to adjust timestamps for the next file. It warns that an incorrect duration, including one derived incorrectly or affected by truncation, can cause artifacts. In practice, inspect each playlist item’s container duration and the end times of its audio and video streams. Look for truncated files, unusual metadata-derived durations, or a soundtrack and picture that do not finish together.
The duration of a container is not always a reliable description of the useful media inside it. A file may report a duration that differs from the end time of one of its streams. Since the demuxer uses duration to place the next item, an incorrect value can shift later timestamps. FFmpeg’s concat script supports a duration directive to override a file duration, but use it only when you have a dependable corrected value. A guessed number can move every later boundary further out of place.
Also check whether the files are suitable for the concat demuxer. It expects inputs to have the same streams, codecs, and time bases. If one track has a different stream layout or encoding, stream-copy concatenation may not produce a consistent timeline. The FFmpeg FAQ on concatenating media describes the concat filter as the route when concatenation requires re-encoding. Normalising files before joining them is another preparation option, at the cost of an additional processing step.
Do not expect -stream_loop -1, -re, or arbitrary timestamp flags to repair an inaccurate duration at an individual boundary. Such options may affect looping or pacing, but they do not make incompatible inputs compatible or correct a wrong per-file duration. After any repair or transcode, listen across several boundaries and inspect the resulting output before relying on it overnight.
Compare the available concatenation approaches
There is no universal FFmpeg command that cures every playlist gap. Choose the method according to the files you actually have and whether you can re-encode them. The trade-off is not simply speed versus quality: compatibility, duration accuracy, and the ability to validate the result all matter.
| Approach | Use it when | Main trade-off |
|---|---|---|
| Concat demuxer | Files have matching streams, codecs, and time bases, and stream-copy-style joining is appropriate. | It advances timestamps using reported durations, so inaccurate durations or unequal stream endings can create artifacts. |
| Concat filter | You need a re-encoding workflow or must make the inputs consistent as part of concatenation. | It adds filtering and encoding work; you still need to inspect audio and video boundaries afterwards. |
| Normalise files first | Playlist items differ in stream layout, codec, or time base. | It adds a preparation step and may take time, but creates a more consistent set of inputs for later concatenation. |
Start with a small representative subset rather than rebuilding a long playlist blindly. Include the files that show the problem and at least one known-good transition. Compare the output at the boundary, confirm the audio does not pause or click, and verify that picture timing remains acceptable. Once the subset behaves correctly, apply the same preparation to the full playlist and check more than one transition.
If you cannot identify the cause from the output, collect the FFmpeg version and build, the command used, the relevant playlist entries, media probe information for each adjacent file, and the log lines around the boundary. Without those details, it is not possible to select confidently among bad duration metadata, incompatible streams, different stream endpoints, or an ingest problem.
Check YouTube ingest and network separately
When the local FFmpeg output is continuous but the YouTube playback has a gap, move to the ingest layer. Check the Live Control Room preview and stream health, then compare the time of the YouTube issue with the local output. An ingest warning or a problem visible only after delivery points towards the encoder or network path, not proof that the playlist timeline is wrong.
YouTube’s encoder settings page lists supported live codecs and recommends constant bitrate encoding and a two-second keyframe interval, not exceeding four seconds. Its bitrate guidance varies with codec, resolution, and frame rate, so consult the current table for the configuration you are actually sending rather than copying a value from another stream. The page also lists supported audio formats; check that your output matches its current guidance.
YouTube’s streaming tips recommend leaving 20% upload bandwidth headroom. Test the connection with representative audio and motion, rather than relying only on a speed test taken at a quiet time. Watch stream health and listen to the incoming preview. A healthy ingest does not establish that FFmpeg’s file boundaries are gapless, just as raising bandwidth will not repair a timeline shifted by an inaccurate file duration.
Avoid making encoder changes and media changes together. First establish whether the local output has a gap. If it does, fix and validate the playlist. If it does not, investigate the output configuration, network stability, and YouTube’s reported health. This order preserves evidence and prevents a network adjustment from obscuring the original fault.
Verify the image in YouTube Studio
After the OBS change, use YouTube Studio to verify what YouTube is receiving. Open the live control room for the existing broadcast and check its preview. Confirm that the replacement image appears there, and that the audio continues. Studio is a monitoring and broadcast-management surface; it cannot select the image source or scene in OBS.
Allow for the fact that the preview and a viewer’s playback may not update at precisely the same moment. Do not conclude that the change failed from one stale frame. Check again after a short wait, and if possible view the stream from a separate browser or device. The useful confirmation is that the incoming picture changes while the existing broadcast remains active and music is still audible.
Make a brief record of the time you switched the visual, what the OBS preview showed, and what Studio displayed. If a playlist gap recurs later, the note helps distinguish a visual operation from a media boundary or delivery interruption. Check stream health at the same time, but do not treat a healthy indicator as evidence that every track transition is clean.
If the new image is visible in OBS but not in Studio, the issue is likely between OBS’s preview and its programme output, or in the outgoing connection. Confirm that you changed the active programme scene rather than a preview-only scene, and check that output remains live. Keep the broadcast running while you investigate.
Recover if the visual does not change
Work from the least disruptive checks. First confirm that the intended scene is active in OBS and that the replacement image source is visible, not hidden behind another source. Check that the file path still resolves and that the source is not showing a blank frame. If OBS’s preview is correct, inspect the programme output or recording, if available, before changing any YouTube settings.
If OBS shows the old visual, return to the scene list and activate the prepared scene again. Check source visibility and layer order, then confirm the transform covers the canvas. Avoid changing output resolution, encoder settings, or the FFmpeg playlist unless evidence points to those areas. Keep the audio path untouched while you correct the picture.
If OBS shows the new visual but YouTube Studio does not, confirm the broadcast is still receiving the same encoder output and that you did not accidentally switch to a separate preview or second output. Check Studio’s preview and stream health again after allowing it time to refresh. Do not end the live broadcast as a routine image-change remedy; doing so removes the very continuous output you are trying to preserve.
If the visual is right but the music gap remains, return to the local-output comparison. Inspect durations, audio and video end times, and concat compatibility. If the local output is clean and YouTube playback is not, focus on ingest and bandwidth evidence. For further continuity troubleshooting, why a 24/7 YouTube lofi stream keeps stopping covers the separate case of a broadcast that stops rather than a single bad track boundary.
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 have gaps between songs?
The concat demuxer places each file after the prior file’s reported duration. Incorrect duration metadata, truncated files, incompatible streams, or audio and video ending at different times can produce a gap or other boundary artifact. Compare the local output around the transition before blaming YouTube delivery.
Does FFmpeg concat automatically make files gapless?
No. The demuxer is suitable when inputs have matching streams, codecs, and time bases, but it still relies on durations to advance timestamps. If files need re-encoding or normalisation, consider a concat-filter workflow and validate the result.
Can I change the stream image without stopping the music?
Yes, if OBS is producing the outgoing picture: switch the active scene or image source while leaving the stream output and audio path running. Verify the new picture in OBS and then in YouTube Studio. Studio does not control OBS scenes.
What should I send someone helping diagnose the gap?
Provide the FFmpeg version and build, the complete command, the relevant playlist entries, media probe details for the adjacent files, and log lines around the transition. Include whether the gap is present in local output or only in YouTube playback. Those details help distinguish a media timeline problem from an ingest or network issue.