Use FFmpeg’s concat demuxer to play an explicit, ordered playlist of video files, loop it, and send the output to a YouTube Live event. This works most simply when the files have matching streams, codecs and time bases; mixed files may need normalization or re-encoding. The steps below show how to prepare the playlist, configure YouTube and FFmpeg, and diagnose common failures.
Before you start
- Install an FFmpeg build that includes the demuxers and encoders you need. The exact command can vary with your operating system, shell and FFmpeg build.
- Prepare the video files and decide their playback order. A named playlist is more reliable than assuming a folder will be read in a particular order.
- Create or select a YouTube Live event and keep its stream URL and stream key private.
- Use a stable internet connection with enough upload capacity for the selected output bitrate.
- Confirm you have the rights to stream every video and audio track. A technically successful stream does not grant permission to use copyrighted material.
The command below is a template, not a tested, universally portable command. Replace its placeholders, check option placement against your installed FFmpeg version, and test with your own files before relying on it unattended.
Build an ordered playlist
Create a plain-text file named playlist.txt and add one file line per video, in the order you want them played. For example:
file '/path/to/videos/first video.mp4'
file '/path/to/videos/second video.mp4'
file '/path/to/videos/third video.mp4'
Use paths appropriate to your operating system. Spaces and special characters need correct quoting or escaping for the concat script and your shell. FFmpeg’s concat demuxer defaults to safe=1, which rejects paths it considers unsafe. Keep that protection where possible; disable it only for a playlist you trust and only if needed. See the FFmpeg concat demuxer documentation.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →#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.
Check whether the videos can be concatenated directly
The concat demuxer joins files as a virtual input; it does not make incompatible media compatible. FFmpeg requires the files to have the same streams, codecs and time bases for this method. A folder containing a mix of frame rates, codecs, resolutions or audio layouts may not work correctly with stream copy.
- If the files match: stream copy may avoid a decode-and-re-encode step, but test transitions and audio before using the playlist continuously.
- If the files differ: normalize them to compatible properties before using the demuxer, or use FFmpeg’s concat filter and re-encode. The filter is the appropriate route when re-encoding is needed; see the FFmpeg FAQ on concatenating video files.
- If durations or stream lengths are inaccurate or unequal: timestamps may produce artifacts or gaps at transitions. Check the source files and inspect the output during a representative test.
Create a YouTube Live event and retrieve its ingest details
- Open YouTube Studio and go to the Live Control Room. Create or select the event you intend to use.
- Copy the event’s current stream URL and stream key/name from YouTube’s live-stream configuration. Do not reuse an endpoint copied from an old tutorial.
- Treat the stream key as a password. Do not publish it in a command example, share it in a screenshot, or leave it in logs or files others can access. If it is exposed, replace it in YouTube’s controls.
- Use RTMPS when available. YouTube recommends RTMPS for encrypted transport. The Live Streaming API describes the stream URL and stream name as separate values or as a combined
STREAM_URL/STREAM_NAMEvalue: YouTube Live Streaming API: LiveStreams.
Set output options and start the loop
Use the following as a command outline only. Substitute your playlist path, encoder settings and the RTMPS URL and stream name supplied for your event. The exact syntax, quoting and placement of options can depend on your shell, FFmpeg build and input files.
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 1 -i "/path/to/playlist.txt"
-f flv "[RTMPS_URL]/[STREAM_NAME]"
-stream_loop -1 requests an indefinite input loop, and -f concat selects the concat demuxer. -re is a pacing option for file inputs so FFmpeg reads at real-time speed rather than sending the files as fast as it can. The encoding options must produce a format and bitrate appropriate to your sources and YouTube’s current guidance. -f flv is used here for the RTMP(S) output path. Do not paste a real stream key into a public article, shared script or support request.
This continuous FFmpeg process does not guarantee that YouTube will keep a live event available indefinitely. Watch the Live Control Room for stream health, status and messages, and handle any event-side limits or interruptions there.
Recommended Free Tools
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.
Choose encoder settings using YouTube’s guidance
YouTube’s current encoder guidance supports RTMP/RTMPS ingest and lists H.264, H.265 and AV1 video, with AAC or MP3 audio. It recommends constant bitrate (CBR), frame rates up to 60 fps, and a two-second keyframe interval that should not exceed four seconds. Bitrate guidance varies by codec, resolution and frame rate; for H.264 at 1080p30, YouTube’s table recommends 10 Mbps. That is a recommendation for that configuration, not a universal minimum. Check YouTube’s current table before choosing settings: Choose live encoder settings, bitrates, and resolutions.
- Choose a resolution and frame rate that your source material and encoder can sustain.
- Set the video encoder’s keyframe interval to two seconds where possible, and keep it at four seconds or less.
- Use CBR and select a bitrate based on the codec, resolution and frame rate rather than copying a number intended for another configuration.
- Make sure your sustained upload capacity can support the output bitrate reliably; leave capacity for normal network variation.
- Test representative footage with motion and audio, then inspect YouTube’s stream-health messages before leaving the process unattended.
RTMP(S) or HLS?
The command outline above uses the RTMP(S) path. HLS is a separate ingest workflow, not a drop-in replacement for the output URL in that command. YouTube’s HLS setup requires HTTPS POST/PUT requests, MPEG-TS segments and a rolling playlist with no more than five outstanding segments; segment duration must be between one and four seconds. YouTube notes that HLS has higher latency than RTMP because it sends segments rather than one continuous stream. Use HLS only when you deliberately implement that workflow and its requirements: Set up an HLS stream.
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
Troubleshoot common problems
The playlist will not open
- Check that the playlist path passed to
-iis correct and that FFmpeg can read it. - Check each
fileline for correct quoting, escaping and file paths. - If FFmpeg rejects a path as unsafe, do not disable
safeby default. Verify that the playlist and every referenced path are trusted; only then consider whether the safe-path restriction is the issue.
Playback breaks or looks wrong at a file boundary
Check the files’ stream layouts, codecs and time bases. The demuxer expects them to match. If they do not, normalize the files or use the concat filter with re-encoding. Also check for inaccurate duration metadata or audio/video streams of unequal length, which can cause timestamp artifacts or gaps.
YouTube does not receive the stream
- Verify that the event is active and that the current stream URL and stream key/name are correct.
- Check that you selected RTMP(S) output for the RTMP(S) endpoint and have not substituted an HLS endpoint or configuration.
- Read FFmpeg’s connection errors and YouTube’s Live Control Room status. Keep the key private while troubleshooting.
YouTube reports poor stream health
Check the selected bitrate against YouTube’s guidance for your codec, resolution and frame rate, then check that your connection can sustain it. Test representative audio and movement and follow the specific health messages in the Live Control Room.
Best 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.
The stream stops after an interruption
FFmpeg looping the input does not by itself guarantee recovery from every network, process or YouTube-side interruption. Monitor the process and YouTube status, and restart or reconnect according to the error shown. Do not treat continuous local output as proof that the platform-side event remains live.
Copyright and channel considerations
Only stream material you own or are authorized to use, including music and other audio. A playlist that runs continuously does not change the rights status of its contents. YouTube may also evaluate a channel under its applicable monetization and content policies; technical continuity alone does not establish eligibility. Review YouTube’s current rules for your channel and the material you plan to broadcast.
Or let it run in the cloud
If you want the YouTube stream to keep running without leaving a computer at home on, StreamNeo is a cloud service for looping uploaded videos to YouTube. Upload a recording or build a playlist, add your YouTube stream key once, and go live. It runs without OBS or a home computer, and can automatically recover if YouTube drops the stream. Your uploads stream as made, up to 4K 60fps, at one flat price per slot rather than quality-based tiers. Each slot includes 10 GB of storage, pooled across active slots, 24/7 looping and playlists, and StreamNeo team support. The first day is free with no card; one free day is available per account. UPI and cards are available in India, and card checkout is available worldwide. See StreamNeo for details.
Monthly pricing: $9.99 per month. Same product on every plan; only the billing length changes.
Quick Recap
Start your free first day with 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.




