You can loop a sequence of MP4 files into a continuous YouTube Live stream with FFmpeg: create a concat-demuxer playlist, configure a broadcast and stream key in YouTube Studio, then send compatible video and audio to YouTube over RTMPS. This is a continuously delivered encoder feed—not a normal video upload—and it still needs monitoring for stream-health problems, file errors, and interruptions.
What you need before you start
- A YouTube account with Live streaming available and a broadcast configured in YouTube Studio’s Live Control Room. A working FFmpeg command does not enable Live access or create the broadcast for you.
- FFmpeg installed on a computer or server that can stay on and maintain a reliable internet connection for the duration of the stream.
- MP4 files you have the necessary rights to stream. Technical compatibility does not establish permission to use music, game audio, or other copyrighted material.
- A private stream key from YouTube. Treat it like a password: do not put it in a public repository, screenshot, or shared command log.
YouTube separates the broadcast from the incoming stream: the broadcast is the live event, while the stream is the encoder feed associated with it. See Google’s explanation of broadcasts and streams.
Prepare a compatible MP4 playlist
Check the files first
The concat demuxer presents files in sequence without decoding and rebuilding them. For that to work reliably, the files need compatible stream layouts, codecs, and time bases. Check that their video and audio streams, dimensions, frame rates, pixel formats, and audio sample rates also match. If they differ, normalize them before using the demuxer, or use FFmpeg’s concat filter and re-encode to a consistent output. Re-encoding costs more CPU but is generally the more suitable route for heterogeneous sources.
Create the playlist file
Make a plain-text file called playlist.ffconcat. The signature must be the first line, exactly as shown:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
#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.
ffconcat version 1.0
file '/media/radio/track-001.mp4'
file '/media/radio/track-002.mp4'
file '/media/radio/track-003.mp4'
Replace the example paths with your own, keeping one file directive per entry. Quote or escape paths containing spaces or special characters. By default, the concat demuxer’s safe-path check rejects some absolute or otherwise unsafe paths. Prefer relative paths where practical; use -safe 0 only if you trust the playlist and need paths the default check would reject. The FFmpeg concat demuxer documentation describes the format and its restrictions.
Do not assume the transitions will be gapless. The demuxer advances timestamps using each file’s duration; unequal stream lengths can create gaps, and inaccurate duration metadata can cause artifacts. Play through a full cycle before relying on the playlist.
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.
Set up the YouTube broadcast and ingest
- Open YouTube Studio and go to Create > Go live to enter Live Control Room.
- Create or select the broadcast you want the encoder to feed. Check that Live streaming is available for your account and that the broadcast is in the correct state.
- In the encoder settings, copy the current stream URL and stream key shown by YouTube. Choose RTMPS when it is available, and use the exact endpoint YouTube provides; ingest URLs can vary.
- Keep the key private. Avoid saving it in a public script or sharing terminal output that exposes it.
YouTube recommends RTMPS, which carries RTMP over an SSL connection. Its encoder-settings guidance covers supported formats, bitrate recommendations, keyframes, testing, and stream health. RTMPS is the typical choice for this workflow. YouTube also documents HLS ingestion as an alternative for compatible encoders and use cases such as HDR or codecs unavailable over RTMP; HLS sends video in segments and has higher latency. It requires the HLS-specific configuration, not merely changing an RTMPS command’s output label. See YouTube’s HLS setup guide.
Run FFmpeg and loop the playlist
For a homogeneous playlist, this command is an illustrative starting point, not a universal tested configuration:
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.
ffmpeg -re -stream_loop -1 -f concat -safe 0 -i playlist.ffconcat
-c:v libx264 -preset veryfast -pix_fmt yuv420p
-b:v 4500k -maxrate 4500k -bufsize 9000k -g 60
-c:a aac -b:a 128k -ar 44100
-f flv 'rtmps://YOUR_CURRENT_INGEST_URL/YOUR_STREAM_KEY'
Replace the endpoint with the current RTMPS URL and stream key from Live Control Room. Do not share the command with a real key embedded in it.
-rereads the media at real-time pace, which is appropriate when sending prerecorded files as a live feed.-stream_loop -1asks FFmpeg to repeat the input indefinitely. Input options belong before the corresponding-i.-f concat -safe 0 -i playlist.ffconcatselects the concat demuxer and reads the playlist. Omit-safe 0if your playlist works with the default safety check.-c:v libx264and-c:a aacencode H.264 video and AAC audio, formats in YouTube’s encoder guidance. This example re-encodes rather than copying the compressed streams.-b:v,-maxrate, and-bufsizeset the example’s video-rate controls;-b:a 128ksets AAC audio bitrate;-ar 44100sets a 44.1 kHz sample rate.-g 60sets a 60-frame GOP. At 30 fps that is approximately a two-second keyframe interval; use a value matched to your chosen frame rate.-f flvselects the output container used for this RTMPS encoder output.
Choose output settings for your actual media
YouTube recommends CBR and a keyframe interval of two seconds, not exceeding four seconds. The example’s -g 60 is not right for every frame rate: for 60 fps, for example, a 60-frame GOP is about one second. Set the GOP to match the selected frame rate and interval.
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
Do not copy the example’s 4.5 Mbps video bitrate without checking YouTube’s current table for your resolution and frame rate. The 128 kbps AAC value is YouTube’s listed stereo audio bitrate; 44.1 kHz is the example’s stereo sample rate. YouTube also lists 48 kHz for 5.1 audio, so do not assume the example’s audio settings suit surround sound. Test representative motion and audio, and ensure your dependable upload capacity has headroom above the target video and audio bitrates plus protocol overhead. The installed FFmpeg version and build can affect option availability or behavior, so check its manual if an option is rejected.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Test the stream before leaving it unattended
- Start with a private or unlisted test broadcast and representative video motion and audio. YouTube’s guidance says, “Make sure to test before you start your live stream.”
- While FFmpeg runs, watch Live Control Room’s stream-health messages and confirm YouTube is receiving the encoder feed.
- Let the playlist complete a full cycle. Check the wrap to the first file, audio continuity, image changes, and whether a damaged or missing file stops output.
- For ongoing operation, run FFmpeg under a process supervisor or service manager with restart behavior configured. Keep logs somewhere persistent, alert on process exit or ingest loss, and assign a person to check stream health.
A supervisor can restart a failed process, but it cannot guarantee a continuous YouTube broadcast. Keep a human monitoring the stream, particularly after playlist or configuration changes.
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.
Troubleshooting common failures
| Symptom | Likely cause | What to check or do |
|---|---|---|
| FFmpeg rejects a playlist path | The concat demuxer’s default safe-path check rejects an absolute or otherwise unsafe path, or the playlist syntax is malformed. | Check that ffconcat version 1.0 is the exact first line and paths are quoted or escaped correctly. Prefer relative paths; use -safe 0 only for a playlist you trust. |
| Playlist will not open or a file is skipped | A path is wrong, the file is inaccessible, or the playlist entry is invalid. | Verify each path from the FFmpeg process’s working environment and confirm the file can be read. Keep one valid file directive per entry. |
| Concat reports stream mismatch or output behaves badly at transitions | Files have different codecs, stream layouts, time bases, or other incompatible properties. | Inspect and normalize the media to a common format, or switch to a concat-filter workflow that re-encodes. Test transitions after changing files. |
| Gaps or artifacts appear between items | Stream lengths differ or duration metadata is inaccurate. | Check the source durations and stream lengths, then watch a full playlist cycle. The demuxer uses durations to set following timestamps. |
| YouTube reports a weak or unstable stream | Upload capacity may not reliably sustain the selected bitrate, or encoder settings may not match YouTube’s recommendations. | Check Live Control Room stream health, test upload capacity, leave headroom above combined video and audio bitrate, and choose settings from YouTube’s current encoder table. |
| YouTube is not receiving the feed | The broadcast may not be ready, Live access may not be enabled, or the ingest URL or key may be wrong. | Check the broadcast state and current encoder settings in Live Control Room. Replace the endpoint and key with the values shown there; do not assume FFmpeg creates or activates the broadcast. |
| FFmpeg stops and the stream ends | The process exited, a source failed, or the host or connection was interrupted. | Review persistent FFmpeg logs, verify the source files and connection, and configure a supervisor to restart the encoder. Confirm the ingest recovers and assign someone to monitor it. |
Or let it run in the cloud
If you do not want a computer and home connection to carry the stream, StreamNeo is a cloud service for keeping a YouTube channel live from uploaded videos. Upload your recording or build a playlist, add your YouTube stream key once, and go live. It loops the uploaded videos from the cloud; it does not stream from a camera.
- Nothing has to stay on at home: the stream runs from the cloud.
- Any quality up to 4K 60fps streams as uploaded, at one flat price per slot, with no re-encode or quality tiers.
- StreamNeo automatically recovers if YouTube drops the stream.
- The first day is free, with no card required.
The monthly option is $9.99 per month. It includes one always-on stream, 10 GB storage per slot pooled across active slots, looping and playlists, automatic recovery if YouTube drops, and StreamNeo team support. UPI and cards are accepted in India; card checkout is available worldwide. For five or more slots, contact support.
Quick Recap
Start your free StreamNeo 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.




