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

To loop a video playlist into YouTube Live with FFmpeg, put the files in a concat list and use -stream_loop -1 to repeat that input. The command below is a starting template for compatible media—not a universal fix for mismatched files. You must also set the output bitrate and keyframe interval for your chosen resolution and frame rate, and keep the computer and network running while FFmpeg streams.

Build a playlist for FFmpeg

Create a plain-text file named playlist.txt in the directory where you will run FFmpeg. Add one file entry per line, in playback order:

file 'video-01.mp4'
file 'video-02.mp4'

Use paths FFmpeg can access from its working directory. With -safe 0, the command below permits paths the concat demuxer would otherwise reject as unsafe; use trusted filenames and playlist contents.

Check that the files are compatible

The concat demuxer joins media at the packet and stream level; it does not automatically convert unlike files into a common format. FFmpeg says the files must have the same streams, including matching codecs and time bases. Differences in dimensions, frame rates, audio layouts or other stream properties can also cause errors or poor transitions.

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.

Inspect each file’s streams before you start. If the files do not match, normalize them to common properties first, or use a filter workflow that decodes, joins and re-encodes them. FFmpeg’s FAQ points to the concat filter for cases that require conversion. See the FFmpeg concat demuxer documentation and FFmpeg FAQ on joining video files.

Set up YouTube Live and protect your key

  1. Confirm live streaming is enabled on your YouTube account, then create or select a stream in YouTube Studio’s Live Control Room. Initial live-stream enablement may take time.
  2. Copy the stream URL and stream key shown in the Live Control Room. YouTube describes the key as functioning like a password: keep it out of public scripts, repositories, screenshots and logs. Store it in a protected environment variable or secret store.
  3. Use YouTube’s current encoder guidance to choose a codec, resolution, frame rate, bitrate and keyframe interval. Its encoder guide lists RTMP and RTMPS ingestion, H.264, H.265 (HEVC) and AV1 video, AAC or MP3 audio, and CBR encoding. YouTube recommends RTMPS for encrypted ingest. The exact URL and key are account-specific and are provided in the Live Control Room.

For the command below, define YOUTUBE_RTMP_URL as the ingest URL and YOUTUBE_STREAM_KEY as the secret key in your shell’s protected environment. Do not paste a real key into a public example or share a terminal log containing it.

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.

Start the looping stream

This illustrative command targets a 30 fps H.264 output. It is not a tested or guaranteed command; confirm your local FFmpeg build has the required encoder and FLV muxer, and validate it with your files and connection.

ffmpeg -re -stream_loop -1 -f concat -safe 0 -i playlist.txt 
  -c:v libx264 -pix_fmt yuv420p -preset veryfast 
  -b:v 5000k -maxrate 5000k -bufsize 10000k -g 60 
  -c:a aac -b:a 128k -ar 44100 
  -f flv "$YOUTUBE_RTMP_URL/$YOUTUBE_STREAM_KEY"
  • -re paces file input at its native rate so a file is sent in real time rather than as fast as the machine can read it.
  • -stream_loop -1 tells FFmpeg to repeat the input indefinitely. It is an input option, so it appears before -i playlist.txt.
  • -f concat selects the concat demuxer; -safe 0 allows the playlist paths described above.
  • -c:v libx264 and -c:a aac encode video and audio for this example. -pix_fmt yuv420p selects a widely compatible pixel format.
  • -b:v, -maxrate and -bufsize configure the example video rate control. YouTube calls for CBR; use its current table to set an appropriate target for your actual output rather than copying the example value blindly.
  • -g 60 sets a 60-frame GOP. At 30 fps, that is a two-second interval. For another frame rate, choose a GOP that gives about two seconds between keyframes; YouTube recommends two seconds and says not to exceed four.
  • -f flv packages the output for the RTMP-style ingest used in this template. Follow YouTube’s current guide if choosing a different supported ingest configuration.

YouTube’s encoder guide, accessed in 2026, gives these H.264 reference points: 1080p at 30 fps has a 5 Mbps minimum and 14 Mbps recommended bitrate; 720p at 30 fps has a 3 Mbps minimum and 8 Mbps recommended bitrate. These are YouTube’s encoder settings, not independent performance measurements. Do not apply either row to a different resolution or frame rate. Check the current table for your format, then make sure your sustained upload capacity can carry the output reliably. YouTube recommends a speed test and a test stream with similar motion and audio to the planned broadcast. See YouTube’s encoder settings for live streaming.

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.

Choose the right method for your playlist

Workflow Use it when What it does
One file with -stream_loop -1 You want to repeat a single compatible source. Loops that input without building a multi-file playlist.
Concat demuxer plus -stream_loop -1 Playlist files have matching stream layouts and properties. Joins packets from the listed files without using a filter to convert them.
Concat filter with re-encoding Inputs need to be converted to common output properties. Decodes and joins media through a filter workflow, then encodes a consistent output; it needs more processing than packet-level concatenation.

For variable sources, a reliable preparation step is to normalize each file to the same video and audio properties before using the concat demuxer. The precise filter graph depends on the input streams, so there is no universal concat-filter command that can safely be prescribed for arbitrary files. FFmpeg’s manual is the normative reference; a 2024 FFmpeg-user thread also discusses the same stream-matching limitation in a playlist scenario.

Test the stream before relying on it

  1. Run the command with a private or unlisted test stream where appropriate.
  2. Check YouTube’s stream-health messages and verify audio, picture, motion and transitions between playlist items.
  3. Monitor FFmpeg’s output for decode, demux, encoder or connection errors. If a problem occurs, identify whether it originates in the media, local encoding load or network/ingest before changing options.
  4. Keep the machine awake and FFmpeg running for the entire broadcast. A local process cannot continue if its host shuts down or loses its network connection.

Troubleshoot common failures

  • Concat errors or playback stops at a file boundary: compare the files’ stream layouts, codecs and time bases. Normalize the sources or use a concat-filter workflow with consistent re-encoding.
  • YouTube does not receive the stream: check that live streaming is enabled, the URL and key came from the selected Live Control Room stream, and the key has not been mistyped or revoked. Keep the key secret while inspecting configuration.
  • Stream-health warnings or dropped frames: compare the actual output format and bitrate with YouTube’s current encoder table, run a sustained upload speed test, and distinguish a connection problem from local encoding overload.
  • Keyframes arrive too far apart: set the GOP for roughly two seconds at the selected frame rate; the example’s -g 60 is two seconds only at 30 fps.
  • FFmpeg rejects an option or cannot find an encoder: check the documentation for your installed FFmpeg build and confirm that the build includes the requested encoder and muxer. FFmpeg’s online documentation follows its newest revision, which may differ from an installed build.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Keep FFmpeg running locally or move the loop to the cloud

What a local FFmpeg setup requires

The FFmpeg method costs no dedicated streaming appliance, but it depends on a computer, power, a stable upload connection and an operator able to diagnose failures. If you need unattended operation, hosted compute is an operational alternative; it does not change the need to use compatible files and correct YouTube settings.

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

Or let it run in the cloud

StreamNeo is an option if you want uploaded videos to keep a YouTube channel live without leaving FFmpeg or a home computer running. Upload a recording or build a playlist, add your YouTube stream key once, and go live; StreamNeo loops the uploaded media from the cloud and can automatically recover if YouTube drops the stream. It does not stream from a camera.

  • Nothing has to stay on at home.
  • Any quality up to 4K 60fps streams as uploaded, at one price per slot with no re-encode or quality tiers.
  • Automatic recovery if YouTube drops the stream.
  • The first day is free, with no card required.
  • One slot includes one always-on stream, 10 GB storage pooled across active slots, 24/7 looping and playlists, and StreamNeo team support. The same product is included on every plan; only billing length changes.

Monthly: $9.99 per month. UPI and cards are available in India; card checkout is available worldwide. For five or more slots, contact support. See StreamNeo for details, or start the free first day.

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.

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.