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

To loop a playlist of local video files into YouTube Live, create an FFmpeg concat-demuxer playlist, then send it to YouTube’s encoder URL and stream key. If the files are compatible, you may be able to stream-copy them; if they differ in codecs or stream parameters, encode them to a consistent output. The command below is a starting point, not a guarantee for every media set or FFmpeg build.

What you need before running FFmpeg

  • An installed FFmpeg build with the required input and output codecs available.
  • Local video files that FFmpeg can read, plus a playlist file containing their paths.
  • A YouTube live stream configured in Live Control Room, where YouTube supplies the encoder server URL and stream key.
  • A computer and sustained upload connection capable of encoding and sending the selected resolution and bitrate for the duration of the stream.

Keep the stream key private: it is a credential. Do not publish it in scripts, screenshots, or logs. YouTube’s encoder setup flow is documented at Create a YouTube live stream with an encoder.

Create the concat playlist

Make a UTF-8 text file named playlist.txt beside your media files. For the explicit ffconcat format, its first line must be the header shown here:

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

Each path must point to a file accessible to FFmpeg. Use correct ffconcat escaping for quotes or special characters in paths; consult the FFmpeg documentation for the format’s syntax and optional per-file directives such as duration and inpoint. Those directives are only appropriate when the playlist needs those behaviors and the media supports them.

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.

Send a looping playlist to YouTube Live

Replace the environment-variable values with the server URL and stream key shown for your live stream. The server URL and key are commonly joined with a slash for an RTMP-style destination; use the exact values and format YouTube provides for the selected ingest setup.

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"
  • -re paces file input in real time rather than sending it as fast as the files can be read.
  • -stream_loop -1 requests indefinite looping of the input.
  • -f concat selects the concat demuxer. -safe 0 relaxes its path restrictions; use it only with a playlist you control.
  • -c:v libx264 and -c:a aac encode video and audio, while the remaining options set an H.264 pixel format and example audio settings. They are not universal quality or compatibility guarantees.
  • -f flv selects the muxer used for this RTMP-style output pattern. YouTube recommends RTMPS; check the server URL and current ingest instructions for your stream.

This command encodes rather than stream-copies. For stream copy, replace the codec options with -c copy only after confirming that the files’ streams, codecs, and parameters are compatible with one another and with continuous muxing and YouTube ingest. If they are not, normalize or re-encode them consistently. FFmpeg distinguishes the concat demuxer, which can join compatible inputs without re-encoding, from the concat filter, which is an option when re-encoding is needed; see the FFmpeg FAQ.

Set encoder parameters and verify the live feed

YouTube’s encoder settings guidance recommends RTMPS and constant-bitrate encoding. It lists H.264, H.265/HEVC, and AV1 for RTMP/RTMPS, with frame rates up to 60 fps. YouTube recommends a two-second keyframe interval and says it should not exceed four seconds. Its bitrate recommendations vary by codec, resolution, and frame rate, so choose a target that both the encoder and the sustained upload connection can support rather than treating the example command’s settings as a prescribed YouTube profile.

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.
  1. Start the live stream setup in YouTube Live Control Room and copy the encoder server URL and stream key.
  2. Check that the command’s output codec, resolution, frame rate, bitrate, and keyframe interval match a supported configuration. Configure or add FFmpeg options as needed; the example command does not set every encoder parameter.
  3. Start FFmpeg and inspect the preview in Live Control Room for picture, sound, and stream health.
  4. When the stream is scheduled and awaiting confirmation, use Live Control Room’s Go live control. Monitor stream health during the run.

YouTube transcodes ingested video into viewer formats. Test with representative motion and audio before relying on the setup unattended. The currently published encoder guidance can change, so check it again when configuring a stream.

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

Choose the right concat workflow

Use the concat demuxer when inputs are compatible

The concat demuxer reads a list of files as a joined input. It is a candidate for stream copy when the files have suitable, compatible streams and parameters. Stream copy avoids encoding, but it does not make arbitrary media files compatible.

Normalize files when they differ

If codecs, stream layouts, or other parameters differ, re-encode to a consistent output. FFmpeg’s concat filter is the documented alternative when re-encoding is needed. This uses more processing capacity than stream copy, and the machine must still encode quickly enough to sustain real-time output.

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.

Do not confuse input concat with YouTube HLS

The text playlist above is an FFmpeg input playlist; it is not a YouTube HLS output playlist. YouTube has a separate HLS ingest path with segment and rolling-playlist requirements. YouTube describes HLS as higher latency than RTMP in its HLS setup help and HLS ingestion documentation. Use that workflow only if you specifically need HLS and can meet its requirements.

Plan for long runs and archives

YouTube Help states that streams under 12 hours are automatically archived. The cited guidance does not promise that a single stream running longer than 12 hours will be archived in full. For longer operation, plan the stream lifecycle separately and verify current behavior for the channel rather than assuming a complete archive.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common failures

FFmpeg cannot open a playlist file

Check that the playlist is readable, that its first line is exactly ffconcat version 1.0 when using the explicit format, and that every listed path resolves from the process’s working directory. Correct special-character escaping. If you use -safe 0, keep the playlist under your control.

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

The stream fails at a file boundary

Files that differ in codec, stream parameters, or layout may not work as a seamless stream-copy concat. Inspect the inputs and either use compatible files or normalize and re-encode them to a consistent output before streaming.

YouTube does not receive a stable feed

Verify the server URL and stream key, the selected ingest protocol, and the available sustained upload capacity. Check that the chosen bitrate is supported by the encoder and connection, then review YouTube’s preview and stream-health indicators.

The output is rejected or the picture is unsuitable

Compare the emitted codec, resolution, frame rate, bitrate mode, and keyframe interval with YouTube’s current encoder guidance. The sample command is only a starting point and does not set a full bitrate or keyframe profile.

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.

The stream stops when you close the computer

A local FFmpeg process depends on the computer and connection running it. For a locally hosted process, prevent sleep and ensure the connection remains available; for an unattended workflow without a home machine running, a cloud service is an alternative.

Or let it run in the cloud

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 loops from the cloud and can recover automatically if YouTube drops the stream. Videos stream as uploaded at any quality up to 4K 60fps, at one flat price per slot. The first day is free with no card, one free day per account. Monthly pricing is $9.99 per month. See StreamNeo or its pricing page, then start the free first 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.