October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
DocumentaryTube
Admit one · Blog

FFmpeg Concat Playlist Command for a Continuous YouTube Live Stream

Use FFmpeg’s concat demuxer and an indefinite input loop to send a playlist of local videos to YouTube Live, with guidance on ingest, settings, and troubleshooting.
Opened Runtime6 min Written byDocumentaryTube Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To loop local videos into a continuous YouTube Live stream, put their paths in an FFmpeg concat-demuxer playlist, then run FFmpeg with real-time pacing, an indefinite loop, and YouTube’s encoder URL and stream key. Use the command below as a starting point; it re-encodes to H.264 video and AAC audio, which is the safer choice when your source files are not confirmed to be compatible for stream copy.

Prepare the video files and playlist

The concat demuxer reads a text playlist of files. It is a good fit for concatenating compatible inputs; FFmpeg’s concat filter is the alternative when inputs need re-encoding as part of the joining process. FFmpeg’s FAQ explains the distinction, and the FFmpeg documentation describes playlist syntax and directives.

Create a UTF-8 text file named playlist.txt in the directory containing the videos:

ffconcat version 1.0
file 'clip-01.mp4'
file 'clip-02.mp4'
file 'clip-03.mp4'

The ffconcat version 1.0 header must be the first line when using the explicit ffconcat format. Each path must point to a file FFmpeg can access. For filenames containing quotes or special characters, use the escaping rules in the FFmpeg documentation rather than assuming ordinary quoting will work. The optional per-file directives duration and inpoint are for specific timing or trimming needs; they are not necessary for a basic playlist.

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.

Check whether stream copy is suitable

Files with different codecs, stream layouts, or parameters may not join cleanly when copied without re-encoding. If you want to use -c copy, first verify that the inputs’ streams and parameters are suitable for continuous muxing and YouTube ingest. Otherwise, encode the output consistently, as in the example below. Re-encoding uses more local processing power, but avoids relying on incompatible source settings.

Connect FFmpeg to YouTube Live

  1. In YouTube Studio’s Live Control Room, create or select a live stream and choose an encoder workflow. YouTube provides the server URL and stream key there. Follow YouTube’s encoder setup instructions.

    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.
  2. Keep the stream key private. Treat it like a password: do not expose it in public scripts, screenshots, or logs. Set it in your shell environment so the command does not contain the literal key. For a Bash-compatible shell, for example:

    export YOUTUBE_RTMPS_URL='YOUR_YOUTUBE_SERVER_URL'
    export YOUTUBE_STREAM_KEY='YOUR_STREAM_KEY'

    Use the exact server URL shown in Live Control Room. The command below appends the key as a path component, matching the common RTMP-style ingest format; if YouTube’s displayed URL already includes a key or uses a different format, follow the URL format shown for your stream instead.

    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.
  3. Run FFmpeg from the directory containing playlist.txt and the video files:

    ffmpeg -re -stream_loop -1 -f concat -safe 0 -i playlist.txt 
      -c:v libx264 -preset veryfast -pix_fmt yuv420p 
      -c:a aac -b:a 128k -ar 44100 
      -f flv "$YOUTUBE_RTMPS_URL/$YOUTUBE_STREAM_KEY"

    This is a starting configuration, not a guarantee for every FFmpeg build, source set, shell, or YouTube stream. -re paces file input in real time; -stream_loop -1 requests indefinite looping; -f concat selects the concat demuxer; and -safe 0 relaxes path restrictions. Use -safe 0 only with a playlist you control. The command encodes video with libx264 and audio with AAC, then writes an FLV stream for RTMP-style ingest.

    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
  4. Watch the incoming preview and stream-health indicators in Live Control Room. When the stream is scheduled and awaiting confirmation, use its Go live control to begin the public broadcast.

Set bitrate, resolution, and keyframes

YouTube’s encoder settings guidance recommends RTMPS, constant bitrate encoding, and a two-second keyframe interval; it says the interval should not exceed four seconds. Its bitrate recommendations vary by codec, resolution, and frame rate, so choose a target from the current table on that page that both your encoder and sustained upload connection can maintain. YouTube’s guidance lists H.264, H.265/HEVC, and AV1 for RTMP/RTMPS, with frame rates up to 60 fps.

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.
  • Resolution and frame rate: Choose settings appropriate to the source footage and the available encoding and upload capacity. Do not upscale low-resolution material to imply more detail.
  • Bitrate: Use the recommendation for the chosen codec, resolution, and frame rate in YouTube’s current guidance. A setting that exceeds sustained upload capacity can destabilize the stream.
  • Keyframes: Configure a constant two-second interval where your encoder allows it, and keep it at or below four seconds.
  • Protocol: Prefer RTMPS when the server URL provided for the stream supports it. Verify current YouTube requirements before changing codecs or output format.

The example command does not explicitly set a target video bitrate, resolution, frame rate, or keyframe interval, so it is not a complete quality profile. Add encoder options appropriate to the source and YouTube’s current recommendations; check your installed FFmpeg build for supported encoder options. Test with representative footage, including motion and audio, and monitor stream health while live. YouTube transcodes incoming video into viewer formats.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When the files need normalization

If the videos cannot be joined reliably through stream copy, create consistent intermediate files or use a filter-based workflow that re-encodes the joined output. The concat filter is not interchangeable with the concat demuxer: it operates on decoded streams and generally requires compatible inputs to be arranged and encoded into a common output. Consult the FFmpeg concat guidance and the manual for the filter and your installed version’s options. There is no single safe normalization command for every set of files without knowing their codecs, dimensions, frame rates, audio layouts, and desired output.

RTMP, HLS, and stream duration

Do not confuse the FFmpeg input playlist above with an HLS media playlist. The concat file tells FFmpeg which local recordings to read; YouTube HLS ingestion is a separate delivery workflow with its own segment and rolling-playlist requirements. YouTube documents HLS as higher latency than RTMP in its HLS setup guidance and HLS ingestion documentation.

YouTube says streams under 12 hours are automatically archived. Do not assume a single continuous stream longer than that will be archived in full under this rule. For a longer run, plan the stream lifecycle and archive separately, and verify current behavior for the channel and workflow.

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

Troubleshooting

  • FFmpeg cannot open a playlist file: Check that the playlist is in the working directory or pass its full path, that the header is the first line, and that each listed path resolves to a readable file.
  • A filename with spaces or punctuation fails: Check ffconcat escaping rules in the FFmpeg manual. Do not assume shell quoting rules also apply inside the playlist.
  • The stream fails or breaks at a clip boundary: The files may not have compatible streams or parameters for the chosen concat and stream-copy approach. Normalize them or encode a consistent output, then test the transition.
  • YouTube shows no incoming video or audio: Confirm the server URL and stream key match the values for the selected Live Control Room stream, and that the output settings are supported. Inspect FFmpeg’s error output and YouTube’s preview before going live.
  • Connection or stream health is unstable: Check whether the chosen bitrate can be sustained by the upload connection and whether the machine can encode at the selected settings. Reduce the target to a supported level and retest.
  • The stream stops when the computer sleeps or loses connection: This local command depends on the machine and its network remaining available. Disable sleep for an attended local run, or use an always-on cloud workflow if the stream must continue without a home computer.

Or let it run in the cloud

If you do not want a computer at home to run FFmpeg continuously, StreamNeo keeps a YouTube channel live from uploaded videos: upload a recording or build a playlist, add your YouTube stream key, and go live. Nothing has to stay on at home; it streams the uploaded quality up to 4K 60fps at one price per slot, automatically recovers if YouTube drops the stream, and the first day is free with no card. Monthly pricing is $9.99 per month. Start the free day on StreamNeo.

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.

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

  1. That’s Greece: How to Choose Your TripAdmit one · ArtThat's Greece: How to Choose Your TripOpened05 OCT 2026Runtime3 min
  2. Class of 92 – Out of Their League – Episode 1Admit one · SportsClass of 92 - Out of Their League - Episode 1Opened05 OCT 2026Runtime2 min
  3. The Rise of the NOTORIOUS: The story of Conor McGregorAdmit one · SportsThe Rise of the NOTORIOUS: The story of Conor McGregorOpened05 OCT 2026Runtime2 min
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver 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.