DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon 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×
Skip to content
DocumentaryTube
concat demuxer

How to Keep an FFmpeg YouTube Stream Running Between Playlist Videos

Keep one FFmpeg output running across playlist boundaries by checking concat compatibility, durations, timestamps, and YouTube ingest status.

By DocumentaryTube Team 5 min read
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep FFmpeg’s output process running while it advances through the playlist. For a fixed list of local files, FFmpeg’s concat demuxer can present the files as one sequential input, but it will not repair incompatible streams or guarantee a gap-free transition. Check stream compatibility and durations first, then verify that FFmpeg continues sending data at each boundary and that YouTube still reports the stream as receiving data.

Why a YouTube stream can stop between playlist videos

A playlist boundary does not necessarily mean the FFmpeg process has ended. The input can reach a file boundary and fail to advance cleanly, or the output can stop reaching YouTube because of an ingest or configuration problem. FFmpeg’s concat demuxer relies on file metadata and compatible streams; differing stream lengths or inaccurate durations can produce gaps or artifacts.

The FFmpeg Project’s concat demuxer documentation states: “All files must have the same streams (same codecs, same time base, etc.).” See the concat demuxer documentation. That requirement is why a command that works for one playlist may fail on another: the right approach depends on the files, FFmpeg build, output format, and YouTube ingest protocol.

Prepare the playlist for the concat demuxer

1. Create a concat script

Put one file directive per local file in playback order. For example:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
file '/path/to/first video.mp4'
file '/path/to/second video.mp4'
file '/path/to/third video.mp4'

Save the list as a plain text file, such as playlist.txt. The concat demuxer supports a file directive for each path. Follow FFmpeg’s quoting and escaping rules when filenames contain spaces, apostrophes, backslashes, or other special characters; do not assume that shell quoting rules and concat-script quoting are interchangeable. The full syntax is in the FFmpeg concat demuxer documentation.

2. Check that the files have compatible streams

Before using packet concatenation, confirm that every item has the same stream structure and compatible properties, including codecs and time bases. If a file has a different stream layout or incompatible encoding, the demuxer is not a general-purpose normalizer. FFmpeg’s concatenation FAQ identifies the concat filter as the route to use when re-encoding is needed.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

3. Check durations and boundary timestamps

The demuxer uses each file’s duration to determine where the next file begins. If duration metadata is missing or inaccurate, the transition may have a gap or timestamp artifacts. Inspect the reported durations and the output timestamps around the boundary. Where appropriate, the concat script supports an explicit duration directive to override an inaccurate or unavailable duration; use a value based on the actual media, not a guess. See the documented concat directives.

Choose between the concat demuxer and concat filter

Method When it fits Important limitation
Concat demuxer The files have matching, compatible streams and you want FFmpeg to read their packets sequentially. It does not repair incompatible media or guarantee a gap-free boundary; durations and stream lengths matter. See the FFmpeg documentation.
Concat filter The files need to be normalized or re-encoded to make a consistent output. It is a filtering and re-encoding workflow, not a drop-in assumption that preserves every input unchanged. Follow the FFmpeg FAQ and check the filter requirements for your chosen streams.

Do not select between these methods solely because the YouTube stream stopped. First determine whether FFmpeg stopped producing output at the boundary or YouTube stopped receiving it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Keep the live output active and verify each boundary

  1. Start FFmpeg with the playlist input and your established live-output settings. Keep the same output process active as the demuxer advances through the listed files. The precise command and encoding options depend on your FFmpeg build, media properties, output container, and configured ingest protocol; the available evidence does not establish one universal command.
  2. Watch FFmpeg’s progress and logs through a transition. Check whether timestamps and output continue as one file ends and the next begins. If FFmpeg exits, reports a demuxing or timestamp error, or stops emitting packets, investigate the playlist, stream compatibility, and duration metadata.
  3. Check YouTube’s stream status and health. YouTube distinguishes an active stream that is receiving data, an inactive stream that is not receiving data, and error states. Use the status and health information to separate an input-boundary problem from a YouTube ingest or configuration problem. The relevant fields are described in the YouTube Live Streams API documentation.
  4. Confirm the configured ingest protocol before changing settings. YouTube documents RTMP/RTMPS, HLS, and DASH ingest. Apply protocol-specific requirements only to the protocol you actually use; changing protocols speculatively can add new variables without fixing a concat problem.

Check protocol-specific requirements

For a typical continuous RTMP/RTMPS output, do not apply HLS segment settings as if they were universal FFmpeg requirements. YouTube’s live encoder settings and ingest guidance describes supported protocols, while its HLS ingestion guidance specifies HLS behavior. For YouTube HLS, the documented requirements include MPEG-2 TS segments, segment durations of 1–4 seconds, a rolling playlist with no more than five outstanding segments, and HTTPS POST/PUT uploads. HLS is segmented and has higher latency than continuous RTMP, so these requirements are relevant only when HLS is the selected ingest protocol.

Troubleshoot a stream that still ends

What you observe Likely area to inspect What to do
FFmpeg exits as a playlist item ends. Input list, file paths, concat syntax, or a demuxing error. Check that every listed file exists and that the concat script uses valid quoting and directives. Read the final FFmpeg log lines rather than treating the event as a YouTube disconnect.
FFmpeg keeps running, but output timestamps jump or playback pauses at a boundary. Incompatible stream properties, unequal stream lengths, or inaccurate duration metadata. Compare stream structure and time bases, then verify actual durations and boundary timestamps. Use an explicit concat duration only when you have a reliable value; if media needs normalization, use a concat-filter workflow.
FFmpeg continues producing output, but YouTube reports inactive or an error. Output connection, ingest protocol, or stream configuration. Check YouTube’s stream status and health fields, then verify that the encoder’s protocol and output configuration match the stream setup. YouTube’s API documents the available status and health information.
The setup uses HLS, but segment uploads or playlist behavior fail. HLS-specific segment or rolling-playlist requirements. Check the HLS-specific requirements for TS segments, 1–4 second durations, at most five outstanding segments, and HTTPS POST/PUT. Do not carry these rules over to RTMP/RTMPS.
The files differ in codecs, time bases, or stream layout. Packet-level concat is not suitable for those inputs as-is. Use a concat-filter workflow that normalizes and re-encodes as necessary, following FFmpeg’s concat FAQ.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or let it run in the cloud

If you do not want to keep an FFmpeg machine and connection running at home, StreamNeo is a cloud service for keeping a YouTube channel live 24/7 from uploaded videos. Upload your recording or build a playlist, add your YouTube stream key, and go live. It loops the uploaded videos from the cloud; it does not stream from a camera.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
  • Nothing has to stay on at home: the stream keeps running with your computer off.
  • Each slot has one flat price for any uploaded quality up to 4K 60fps, without re-encoding or quality tiers.
  • Automatic recovery is included if YouTube drops the stream.
  • The first day is free, with no card required; it is one free day per account.

Monthly: $9.99 per month. See StreamNeo for details, or start your free first day.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

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.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Screening Room

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.