October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
DocumentaryTube
concat demuxer

How to Switch Videos in an FFmpeg YouTube Stream Without a Black Frame

Use one continuous FFmpeg output and choose between packet-level concat and filter-based re-encoding. Learn the assumptions, mapping, and boundary checks that matter.

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

Keep one FFmpeg output running and join the prerecorded videos into a continuous program. Use the concat demuxer when the files are compatible for packet-level joining; use the concat filter when you need to normalize or re-encode them. Neither method guarantees a clean cut for every source or what viewers see on YouTube, so inspect transitions in your actual output.

Choose the right concat method

Method What it does Best fit Main caveat
Concat demuxer Reads a manifest and joins inputs at the packet level, avoiding re-encoding when compatible. Sources with matching stream properties and a suitable container/output workflow. Compatibility matters; inaccurate duration information can cause artifacts, and edit points do not guarantee a clean visual cut. FFmpeg concat demuxer documentation
Concat filter Decodes and joins streams in a filtergraph, then encodes the result. Sources that need normalization or re-encoding. FFmpeg’s FAQ recommends this approach when re-encoding is needed. Requires deliberate handling of stream layout and output encoding. FFmpeg FAQ
Concat protocol Concatenates resources at the protocol level. Only workflows for which its specific constraints are met. It is not interchangeable with the demuxer or filter; check the format and protocol requirements in the FFmpeg documentation.

For a fixed playlist, build one continuous output rather than stopping and restarting FFmpeg for every video. Restarting the encoder can interrupt the outgoing stream; joining files inside one process avoids that particular handoff, but does not by itself prove there will be no black frame.

Inspect and prepare the videos

Before choosing a command, compare every source. Use ffprobe to inspect codecs, dimensions, frame rates, pixel formats, time bases, audio presence, sample rates, channel layouts, and durations. The aim is to identify differences that could make packet-level joining unsuitable or require normalization.

  • Check that every file has the video and audio streams you intend to include.
  • Compare dimensions, frame rate, codec parameters, pixel format, and time base.
  • Compare audio sample rate and channel layout; a missing audio stream in one clip needs an explicit plan.
  • Confirm durations and intended cut points rather than relying on guessed values.
  • Check the installed FFmpeg version and its local help: the online documentation tracks the newest revision and can differ from an older local build. FFmpeg documentation

Option 1: use a concat-demuxer manifest

Try the demuxer when the clips are compatible for packet-level joining and your output workflow supports it. Create a plain-text manifest such as playlist.txt:

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 'video-a.mp4'
file 'video-b.mp4'
file 'video-c.mp4'

Then read the manifest as the input to FFmpeg. For example, to produce a file for inspection without re-encoding:

ffmpeg -f concat -safe 0 -i playlist.txt -map 0:v:0 -map 0:a:0? -c copy joined.mp4

This example assumes the files are accessible at the listed paths, have compatible streams, and can be copied into the chosen output container. The optional audio map allows an input with no audio stream, but it does not create audio for a silent clip. If clips have different stream layouts, do not assume this command will reconcile them.

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.

The demuxer accepts directives including durations and edit points. Do not add estimated durations just to force a transition: FFmpeg warns that inaccurate duration information can cause artifacts. With non-intra-frame codecs, packets or decoded frames around an inpoint or outpoint can also fall outside the apparent cut. A manifest edit point is not a guarantee of a clean visual boundary. See the concat demuxer documentation.

Option 2: normalize with the concat filter

Use the concat filter when the inputs differ or packet-level joining causes boundary problems. Each input must be decoded, brought to a consistent format, joined, and encoded as one output. The following pattern assumes both clips have video and stereo audio; adapt the normalization and mapping to the files you inspected:

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.
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.
ffmpeg -i video-a.mp4 -i video-b.mp4 
-filter_complex "[0:v]scale=1920:1080,fps=30,format=yuv420p,setpts=PTS-STARTPTS[v0];[1:v]scale=1920:1080,fps=30,format=yuv420p,setpts=PTS-STARTPTS[v1];[0:a]aresample=48000,aformat=channel_layouts=stereo,asetpts=PTS-STARTPTS[a0];[1:a]aresample=48000,aformat=channel_layouts=stereo,asetpts=PTS-STARTPTS[a1];[v0][a0][v1][a1]concat=n=2:v=1:a=1[v][a]" 
-map "[v]" -map "[a]" -c:v libx264 -pix_fmt yuv420p -c:a aac joined.mp4

This is a template, not a universal command. Replace the scale, frame rate, pixel format, audio layout, codecs, and output settings to suit the intended program and encoder. It expects an audio stream in each input. If one clip is silent or has a different channel layout, provide a suitable audio stream or adjust the filtergraph; do not leave the filter inputs mismatched.

Filtergraph outputs need explicit mapping. A labeled output such as [v] or [a] must be mapped once and exactly once. More generally, explicit -map options prevent FFmpeg’s automatic stream-selection rules from choosing a different video or audio stream than intended. FFmpeg stream selection and mapping.

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
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Send the continuous output to YouTube Live

Once you have a joined file, or a filtergraph that emits the full sequence, connect that continuous FFmpeg output to the YouTube Live ingest using the stream key and output protocol/settings appropriate to your local FFmpeg build and YouTube’s current setup. The concat examples above create a file for inspection; they do not specify a universal YouTube publishing command. In particular, do not assume a file-joining example alone establishes the required ingest URL, encoder settings, or YouTube-side behavior.

Keep the output process alive across the sequence. Check the stream key carefully, keep it private, and use the intended video and audio maps rather than relying on automatic selection. For a fixed sequence, the playlist must be built into the continuous program; the cited FFmpeg documentation does not establish a particular runtime controller for interactive source switching.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.

Validate transitions before relying on the stream

Record or inspect the produced output around every boundary, including both picture and sound. Check the last frames of one clip and the first frames of the next, and listen for a gap, abrupt level change, or missing audio. Repeat for every transition: a successful join at one boundary does not establish that all source pairs behave the same.

If the output looks clean locally but viewers still report a black frame, the available FFmpeg concat documentation cannot identify the cause. Encoder timestamps, GOP structure, audio continuity, stream protocol, platform processing, and playback state are possibilities to investigate—not verified causes for a particular stream. Do not treat a local test as a guarantee of YouTube playback.

Troubleshooting common boundary problems

  • Concat demuxer reports errors or the output fails: verify manifest paths and syntax, then compare the source stream parameters. If the files are not compatible for packet-level joining, normalize and use the concat filter.
  • A visual glitch appears at a cut: inspect inpoint/outpoint behavior and duration values. Non-intra-frame codecs can include packets or decoded frames around edit boundaries; do not assume a manifest edit point trims every boundary cleanly.
  • Audio drops out or changes unexpectedly: inspect whether each source has audio and compare sample rate and channel layout. Adjust the filtergraph or provide a deliberate silent track where needed; map the intended audio output explicitly.
  • The wrong video or audio appears: add explicit input or filter-output mappings. FFmpeg’s automatic selection can choose streams based on properties such as resolution or channel count rather than your intended playlist track.
  • The local joined file is clean but the live playback is not: separate the file-joining test from the ingest and playback path. Check the actual outgoing stream and YouTube playback without claiming the concat method guarantees platform behavior.
  • Documentation examples do not match your FFmpeg build: check the installed version and local option help. The online manual reflects a continually developing project and may describe a newer revision.

Or let it run in the cloud

If your goal is to keep a prerecorded YouTube stream running rather than manage an FFmpeg process yourself, StreamNeo is a cloud service for uploaded videos and playlists. Upload the recording or build a playlist, add your YouTube stream key once, and go live. Your computer and home connection do not have to stay on. Each slot streams the uploaded quality up to 4K 60fps at one flat price, with automatic recovery if YouTube drops the stream. The first day is free with no card, one free day per account. Monthly pricing is $9.99 per month. StreamNeo is for YouTube streams from uploaded videos, not live camera feeds. Learn more at StreamNeo, or start your free day.

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.

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
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

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.