To loop several prerecorded videos in one YouTube livestream from a VPS, run FFmpeg on the server, feed it an ordered playlist or concat input, pace playback in real time, and send the output to the ingest URL and stream key for the intended YouTube Live stream. The key detail is that -stream_loop -1 loops an input, not an arbitrary collection of files: prepare and test the sequence first.
Before you start
- A Linux VPS with the media files available locally or at a mounted path, and an installed FFmpeg build that supports the options and codecs you plan to use.
- A YouTube channel eligible to livestream. YouTube says the channel must be verified and must not have had live-streaming restrictions in the past 90 days; users must be at least 16. First-time live-streaming enablement can take up to 24 hours. Check your current account status in YouTube Studio: Get started with live streaming.
- Permission to broadcast every video, audio track, image, and other element in the files. YouTube says live-stream content must follow its Community Guidelines and Terms of Service; looping does not establish rights or guarantee monetization eligibility.
- Enough VPS compute and sustained outbound network capacity for the chosen encoding and stream. There is no universal CPU, memory, or bandwidth minimum established for this workflow; requirements vary with transcoding, resolution, concurrent streams, and provider limits.
Prepare and order the videos
First decide the exact playback order and whether the whole sequence should repeat. Inspect each file for video and audio streams, codec, dimensions, frame rate, and timestamps. A mismatch can cause failed joins, timestamp problems, unexpected audio, or visible transitions. Test the actual files and watch/listen across every join before relying on the stream.
Use a playlist or concat workflow that is appropriate for your inputs, then make that sequence the repeating input to FFmpeg. FFmpeg documents input looping, but no single multi-file command is guaranteed to work for every combination of files, and the options alone do not guarantee seamless transitions. Stream copying may reduce compute use when the files already match the output requirements, but compatibility and timestamps can make it unreliable. Re-encoding gives more control over output compatibility and consumes more VPS resources.
Configure the YouTube livestream
- Open YouTube Studio and go to the Live Control Room. Create or select the intended live stream using YouTube’s current encoder workflow: Create a YouTube live stream with an encoder.
- Copy that stream’s server or ingest URL and stream key. Use the values for the specific stream you intend to broadcast, rather than a key copied from an unrelated setup.
- Keep the key private. Do not put it in a public script repository, shell history, screenshots, or publicly accessible logs. Store it in a protected configuration or secret mechanism suitable for your VPS, and rotate it if exposed. YouTube’s encoder instructions explain that the key is required to connect the encoder.
- Prefer RTMPS where supported. YouTube recommends it and says it encrypts data to and through Google’s servers: Use RTMPS for live streaming.
Build the FFmpeg workflow
Understand the two input options
For a single file, the conceptual pattern is ffmpeg -re -stream_loop -1 -i video.mp4 ... OUTPUT. Put input options before the corresponding -i: -stream_loop -1 requests an indefinite loop of that input, and -re reads it at its native frame rate instead of sending the file as fast as the VPS can process it. Real-time pacing matters for live output timing. For multiple files, first create an ordered playlist or concat input, then loop the resulting sequence using an approach that works with your FFmpeg build and files. The exact concat syntax and whether stream copying or transcoding is appropriate depend on those inputs, so validate before going live. See the FFmpeg documentation for the installed version: FFmpeg documentation.
#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.
Choose output mapping and encoding deliberately
Map the video and audio streams you actually want to send, and select output codecs supported by both your FFmpeg build and YouTube’s current encoder guidance. YouTube recommends constant bitrate encoding and a two-second keyframe interval, and says not to exceed four seconds. Choose a bitrate for the target resolution, frame rate, and codec from YouTube’s current settings guidance rather than copying a value that may not fit your output: YouTube live encoder settings.
The placeholder ... OUTPUT in the conceptual pattern is intentional: insert the tested playlist/concat input, stream mapping, codec and bitrate options, and the correct RTMPS output URL for your chosen stream. There is no universal command here that can be asserted to work across arbitrary media files or FFmpeg builds. Test your exact command with your media and stream configuration before scheduling an unattended broadcast.
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.
Start the encoder and go live
- Start FFmpeg from the VPS with the tested input sequence and output settings. Confirm the process remains active and is reading the media in real time.
- Watch the Live Control Room for an incoming connection and preview. If you are operating a scheduled stream, use the Live Control Room’s Go live control when ready.
- Confirm video, audio, transitions, and playback order in the preview. Do not assume that a successful process launch means the audience can see or hear the intended output.
- When ending the broadcast, stop the encoder and use the relevant Live Control Room action. Follow YouTube’s current stream-management workflow rather than assuming a session or archive has unlimited duration.
Keep the VPS stream running unattended
-re controls input pacing; it is not a process supervisor, network retry, or recovery system. For unattended operation, separately arrange process supervision, log monitoring, alerts, and a tested restart approach. Check both that FFmpeg is alive and that YouTube is still receiving the feed. The cited FFmpeg and YouTube guidance does not guarantee recovery after a VPS, encoder-process, or network failure, so test how your own setup behaves before depending on it.
Common problems and fixes
- The file plays too fast or the output timing is wrong: use real-time input pacing with
-rebefore the corresponding input and verify that the playlist/concat workflow is not bypassing it. - Only one file repeats:
-stream_loop -1loops the input it is attached to. Check that the input is the ordered multi-file sequence, not just the first file. - A join fails, stutters, or loses audio: inspect streams, codecs, dimensions, frame rates, audio layout, and timestamps across the files. Test the chosen concat strategy; consider re-encoding to a consistent output if stream copying cannot handle the inputs cleanly.
- YouTube does not show an incoming preview: verify the stream-specific ingest URL and key, RTMPS/output compatibility, encoder settings, and that the channel is eligible to livestream. Check the Live Control Room for its connection status.
- The encoder stops or YouTube disconnects: inspect FFmpeg and system logs, VPS resource pressure, and outbound connectivity. Add independent process supervision and alerting; input looping alone does not restart a failed encoder or restore a disconnected feed.
- The key appears in a log or shell history: treat it as exposed, replace or rotate it through the relevant YouTube stream settings, and update the VPS configuration.
Cost and workload considerations
A VPS incurs hosting costs and must sustain the encoding workload and outbound stream for the duration of the broadcast. Transcoding, higher output resolution, more concurrent streams, and the provider’s network or bandwidth limits all affect the required plan. No provider, price, or minimum VPS specification is established here, so compare current sustained outbound rules and test your actual workload rather than buying against a guessed universal benchmark. Stream copy can lower compute demand only when the media already fits the target requirements; re-encoding increases compute load.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →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.
Or let it run in the cloud
If your goal is a continuously looping prerecorded YouTube channel rather than managing an encoder on a VPS, StreamNeo runs the stream from the cloud: upload your recording or build a playlist, add your YouTube stream key once, and go live. Nothing has to stay on at home. Any quality up to 4K 60fps streams as uploaded at one price per slot; there are no quality tiers. StreamNeo automatically recovers if YouTube drops the stream. Its first day is free with no card. The same product is available on daily, weekly, monthly, six-month, and yearly billing, and you can cancel any time. Monthly: $9.99 per month. For Indian customers, UPI and cards are accepted; card checkout is available worldwide. Each slot includes 10 GB of storage pooled across active slots, 24/7 looping and playlists, and StreamNeo team support. StreamNeo streams uploaded videos to YouTube only; it is not a camera-live service. Upload-time calculator, cloud vs PC cost calculator, and copyright safety checklist are available at no cost. Start your free first day on StreamNeo.
Quick Recap
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.
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
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.




