Use FFmpeg’s concat demuxer to play a text-file playlist in order, then add -stream_loop -1 to repeat it and -re to send it at real-time speed. The inputs need compatible streams and properties; if your videos differ, normalize them first or use a filter-based re-encoding workflow. This guide covers both the playlist setup and a YouTube-ready starting command.
Before you start
You need FFmpeg installed on a computer that can stay connected while the stream runs, local video files, a stable upload connection, and a YouTube channel eligible to livestream. YouTube says the channel must be verified and must not have had a live-streaming restriction in the preceding 90 days. See YouTube’s live-streaming eligibility and setup guidance.
- Make sure you have the rights needed to stream every video and audio track in the playlist. A live encoder does not grant permission to use copyrighted material.
- Install a build of FFmpeg that includes the encoders you intend to use, such as
libx264for H.264 video. - Check that the machine has enough processing capacity for the chosen resolution and frame rate, and that its upload connection can sustain the stream bitrate.
Create or select a YouTube livestream
- Open YouTube Studio and go to Create → Go live to open the Live Control Room.
- Create a stream or select the one you intend to use. Copy the server URL and stream key shown in the stream settings.
- Use the exact ingest URL and key YouTube provides. Treat the key like a password: do not publish it, share it, or leave it in a public script. If it is exposed, reset it in YouTube Studio before streaming again.
YouTube documents stream URL and key management in Manage live stream settings. The command below uses placeholders so a real key is never embedded in an example.
Check that the playlist files are compatible
The concat demuxer is the simplest option when files have the same streams, codecs, and compatible time bases. It joins the inputs without re-encoding. It is not a general-purpose media normalizer: a playlist that mixes resolutions, frame rates, codecs, or files with and without audio may fail or produce bad transitions. FFmpeg’s concat demuxer documentation describes its input requirements.
Recommended Free Tools
#1 Best Overall
- 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.
- Compare the files’ video and audio streams, codecs, frame rates, resolutions, and audio presence before building a long stream.
- Check that each file is complete and that its duration metadata is accurate. Incorrect durations or truncated inputs can cause artifacts or gaps as FFmpeg moves to the next file.
- If the files differ materially, convert them to a common profile first. For cases that need re-encoding, FFmpeg’s FAQ recommends using the concat filter rather than assuming the demuxer can reconcile them; see FFmpeg’s concatenation FAQ.
Write the playlist file
Create a plain-text file named playlist.txt. Put one file entry on each line, in the order you want the videos to play:
file '/path/to/first.mp4'
file '/path/to/second.mp4'
file '/path/to/third.mp4'
Replace each path with the actual local path to a file. On Windows, for example, use a path such as C:/Videos/first.mp4. Save the text file in a known location and check that every path resolves before starting the stream. Paths with special characters must be quoted or escaped according to the concat demuxer’s syntax in the FFmpeg documentation.
Start the looping livestream
Run this as a starting point for compatible SDR source files and a 1080p30 H.264 stream. Replace the destination with the exact RTMPS server URL and stream key from YouTube Live Control Room:
Rank #2
- 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.
ffmpeg -re -stream_loop -1 -f concat -safe 0 -i playlist.txt
-c:v libx264 -preset veryfast -b:v 5M -maxrate 5M -bufsize 10M
-r 30 -g 60 -keyint_min 60 -sc_threshold 0
-c:a aac -b:a 128k -ar 44100
-f flv 'rtmps://SERVER_URL/STREAM_KEY'
-repaces file input for real-time output instead of sending the playlist as fast as the computer can read it.-stream_loop -1requests indefinite repetition of the input. It is an input option, so keep it before the-iit applies to.-f concat -i playlist.txttells FFmpeg to read the ordered list through the concat demuxer.-safe 0permits paths the demuxer’s safe-path checks would otherwise reject; use it only with a playlist you control.-c:v libx264and-c:a aacencode video and audio in a common YouTube-compatible combination. The example’s-preset veryfasttrades some compression efficiency for lower encoding load.-b:v 5Msets the video bitrate to 5 Mbps.-maxrate 5Mand-bufsize 10Mconstrain rate variation; the upload connection still needs enough sustained capacity for the overall stream.-r 30sets output to 30 frames per second.-g 60and-keyint_min 60set a 60-frame keyframe interval, or two seconds at 30 fps.-sc_threshold 0disables scene-change keyframes so the interval stays regular.-ar 44100sets audio sampling to 44.1 kHz. If your playlist has no audio, the sample command may need an audio track or adjusted mapping and audio options.-f flvselects the FLV output format used here for RTMPS ingest.
The 5 Mbps video bitrate is YouTube’s current H.264 recommendation for 1080p at 30 fps, and YouTube recommends a two-second keyframe frequency that should not exceed four seconds. These are not universal targets: the suitable bitrate depends on resolution, frame rate, source material, and the upload connection. For comparison, YouTube’s currently displayed H.264 guidance lists 14 Mbps for 1080p at 60 fps. Check YouTube’s encoder settings, bitrates, and resolutions for the settings that match your output. YouTube recommends RTMPS as the secure extension to RTMP.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
This is an illustrative baseline, not a command tested against your media files or FFmpeg build. Confirm the installed build supports the chosen encoder, check the console output for errors, and use the ingest details supplied for your stream. Never replace the placeholders with a key in code you plan to publish.
Test the stream before relying on it
- Start with a short test using representative video and audio, including a transition between playlist files.
- Check the YouTube preview for picture, sound, and transitions. Watch the FFmpeg console for input, encoder, or connection errors.
- In Live Control Room, review stream health and any warnings. Confirm that the upload is stable at the selected bitrate before depending on a long-running stream.
- Only after the preview and stream health look right should you rely on the playlist for an extended broadcast.
YouTube recommends testing with audio and video movement similar to the planned broadcast and monitoring stream health while live. Its guidance is at Choose live encoder settings, bitrates, and resolutions.
Rank #3
- 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.
Common problems and fixes
FFmpeg reports an error opening a file
Check spelling, path separators, file permissions, and whether the file exists from the account running FFmpeg. Validate the playlist entries individually; relative paths are resolved from the process’s working directory, which may differ from the playlist’s folder.
The stream fails or glitches at a playlist transition
Compare the files’ stream layouts, codecs, time bases, resolution, frame rate, and audio tracks. The concat demuxer expects compatible inputs. Normalize the files to a common profile or use a filter-based concat-and-encode workflow if they differ.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsThe stream key or ingest connection is rejected
Copy the current server URL and stream key from the selected YouTube stream and verify that the stream is ready in Live Control Room. If the key may have been exposed, reset it there and update the command with the replacement.
Rank #4
- 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
YouTube reports unstable bitrate or dropped frames
The selected bitrate may be too high for the available upload capacity, or the host may be struggling to encode. Test upload bitrate, lower output bitrate or resolution if needed, and inspect FFmpeg’s logs and YouTube’s stream-health messages. A wired Ethernet connection can be an optional way to connect the host, but it does not guarantee that frames will not drop.
Playback pauses, skips, or reaches the end instead of looping
Confirm -stream_loop -1 appears before the playlist’s -i, and that the playlist input is the one being looped. Check FFmpeg’s output during a test, since behavior can depend on the installed version and input details.
The process stops when the computer disconnects or reboots
FFmpeg runs on the host where you start it. A long-running setup needs an operating-system supervisor or restart plan, disk-space monitoring, and regular stream-health checks; exact configuration depends on the host operating system and is not covered by the command alone.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallBest Value
- 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.
Or let it run in the cloud
If your goal is an always-on YouTube channel rather than managing an FFmpeg host, StreamNeo is the cloud option to try first: it keeps uploaded videos looping on YouTube without a computer or home connection staying on.
- Upload a recording or build a playlist.
- Add your YouTube stream key once.
- Go live; StreamNeo loops the uploaded videos from the cloud.
Nothing has to stay on at home; uploaded videos stream as made, up to 4K 60fps at one price per slot; StreamNeo automatically recovers if YouTube drops the stream; and the first day is free with no card. Monthly pricing is $9.99 per month. Start your free first day with StreamNeo.
Quick Recap
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.




