October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
FFmpeg

How to Run Two FFmpeg YouTube Loop Streams on One VPS

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

Run two prerecorded YouTube Live loops from one VPS by launching two independent FFmpeg processes. Give each process its own media input, YouTube stream key, log, and restart policy; pace file playback in real time with -re; and use -stream_loop -1 to repeat the input indefinitely. Before relying on it, test both streams together: the VPS must sustain their combined upload bitrate, and any re-encoding must fit its available CPU.

What you need before starting

  • A Linux VPS with both media files available locally and enough disk space for them.
  • Two YouTube Live stream configurations, each with its own stream key and ingest URL from YouTube Studio’s Live Control Room.
  • An installed FFmpeg build with the protocols and codecs required by your inputs and outputs.
  • A plan to monitor both FFmpeg processes, outbound network use, and YouTube’s stream health.

Use the exact RTMPS endpoint displayed for each stream. YouTube recommends RTMPS, which encrypts the connection using TLS/SSL; do not assume an RTMP URL and an RTMPS URL can be interchanged. A stream key tells YouTube where to accept the encoder feed, so protect it like a password. YouTube’s current help pages, accessed 2026-10-03, cover managing live stream settings and encrypting a stream using RTMPS.

Prepare each stream’s command

For a compatible local video file, this is a representative command structure for the first stream. It is an example, not a universal preset or a tested VPS sizing recipe:

ffmpeg -re -stream_loop -1 -i /path/to/stream-one.mp4 
  -c:v libx264 -preset veryfast -b:v 5M -maxrate 5M -bufsize 10M 
  -g 60 -keyint_min 60 -sc_threshold 0 
  -c:a aac -b:a 128k -ar 44100 
  -f flv 'rtmps://INGEST_URL/STREAM_KEY'
  1. Replace /path/to/stream-one.mp4 with the actual file path.
  2. Replace the output URL with the exact RTMPS ingest URL and stream key shown in Live Control Room. Keep credentials out of shared scripts and unredacted logs.
  3. Build a separate command for stream two, with its own input file, output URL, and stream key. Keep the two commands independently manageable.
  4. Check the media’s actual resolution, frame rate, video and audio codecs, and whether it contains audio. Set output options to match your intended stream and YouTube’s supported settings.

-stream_loop -1 repeats the input indefinitely. -re reads the file at its native rate, which is important when sending a file as a live-style feed rather than consuming it as fast as the server can read it. FFmpeg documents these options and its real-time RTMP example in the FFmpeg documentation. FFmpeg options generally apply to the next input or output, so put input options before -i and output options before the output URL.

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.

The example’s 5 Mbps video rate corresponds to YouTube’s recommended H.264 bitrate for 720p30, but it does not mean your file is 720p30 or that these settings suit it. Confirm resolution and frame rate before using the value. YouTube’s current encoder guidance, accessed 2026-10-03, lists H.264, H.265/HEVC, and AV1 for RTMP/RTMPS video, recommends constant bitrate (CBR), supports frame rates up to 60 fps, and recommends a two-second keyframe interval that should not exceed four seconds. Consult the full YouTube encoder settings and bitrate guidance for settings specific to codec, resolution, and frame rate.

Choose stream copy or re-encoding

The sample re-encodes video with libx264 and audio with AAC, giving you control of output settings at the cost of encoding work. Each FFmpeg process that re-encodes adds work to the VPS; two simultaneous software encodes can be demanding, but there is no universal CPU-core or memory requirement established for a particular quality.

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.

If a file already has codecs and media characteristics that YouTube accepts, stream copy may reduce CPU use. It does not change the source streams to meet a different bitrate, resolution, frame rate, or codec requirement, so check compatibility rather than assuming that copy will work. FFmpeg’s documentation describes its input and output options; test the exact media and command before leaving either stream unattended.

Run and supervise two independent processes

Start one process per stream, with distinct commands, keys, and logs. This separation is practical deployment guidance: it lets you identify which stream failed and restart it without confusing its output with the other stream. The official documentation does not provide a ready-made two-process VPS recipe.

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.
  1. Run the first command and verify that YouTube receives its video and audio and reports a healthy stream.
  2. Run the second command and verify it independently.
  3. Leave both running together long enough to check sustained CPU, memory, and outbound network use, plus dropped frames and YouTube stream-health messages.
  4. Use a process supervisor configured to restart a process if it exits, and retain separate logs and alerts for each stream.
  5. Test what happens when a process or network connection fails. Do not treat a successful initial connection as proof of unattended recovery.

FFmpeg documents protocol reconnect options, including retries and reconnects for certain network errors, but those options do not guarantee recovery from every RTMP/RTMPS ingest or YouTube-side failure. Check the FFmpeg protocol documentation for the specific protocol options supported by your build, then test your configuration. YouTube also recommends testing with representative moving video and audio and monitoring stream health and messages during streaming; see its encoder guidance.

Size the network for both streams

Add the configured outgoing bitrates of both streams to estimate sustained upload demand, then leave headroom. YouTube says the total bitrate must not exceed available upload bandwidth and recommends 20% upload headroom. Applying that reserve to two independent streams’ combined bitrate is a planning inference, not a published two-stream rule. Transport overhead and bitrate variation also mean the sum of video and audio settings is not an exact measurement of real network use. YouTube’s encoder settings and streaming tips explain its bandwidth guidance.

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
H.264 example YouTube minimum video bitrate YouTube recommended video bitrate
720p30 3 Mbps 8 Mbps
1080p30 5 Mbps 14 Mbps
1080p60 6 Mbps 17 Mbps

These are YouTube’s current H.264 recommendations, accessed 2026-10-03; other codecs and frame rates have different guidance. YouTube recommends 128 Kbps for stereo audio. Verify the VPS’s sustained outbound capacity in its region and test both streams simultaneously. Leave room for other server traffic, filters, scaling, and bursts. No universal VPS CPU, memory, or network plan can be specified without knowing the provider, region, encoding mode, and media properties.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Protect keys and plan for long sessions

Do not publish stream keys in scripts, logs, or support requests. If a key is compromised, YouTube channel owners or managers can reset it in Live Control Room; replace the key in the matching FFmpeg command afterward. YouTube’s live stream settings help explains stream-key management.

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.

Keep YouTube’s archive and DVR behaviors distinct when choosing stream duration. YouTube says streams under 12 hours are automatically archived. Separately, DVR rewind may be limited or unavailable for streams longer than 12 hours; DVR allows viewers to pause, rewind, and resume during a live stream. Check the current channel settings and YouTube help for the behavior that applies to your stream. See creating a YouTube live stream with an encoder and turning on DVR for live streams.

Troubleshoot common failures

Symptom Likely cause What to check or do
YouTube never receives the stream Wrong ingest URL or stream key, or an unsupported endpoint Copy the exact RTMPS URL and key from the matching Live Control Room stream. Check the FFmpeg error output without sharing the key.
One stream works, but the other does not The second process may have the wrong input, key, URL, or conflicting configuration Inspect its command and log separately; verify that it uses the second stream’s own destination and key.
Video or audio settings are rejected or unhealthy Output codec, bitrate, resolution, frame rate, or keyframe interval may not suit the stream Inspect the file’s properties and compare the output with YouTube’s current encoder guidance for that codec and resolution.
Dropped frames or unstable delivery when both run The VPS may lack sustained upload capacity or encoding headroom Check combined outbound bitrate and server CPU during a simultaneous test. Reduce output demands or use a VPS with adequate measured capacity.
A loop plays too quickly or stops at the end Real-time pacing or infinite looping is missing or placed incorrectly Confirm -re and -stream_loop -1 apply to the intended file input, before its -i.
Stream remains down after a disconnection Reconnect behavior may not cover the failure, or FFmpeg may have exited Inspect the process log, verify supported reconnect options, and configure and test a supervisor restart policy and alert.

Or let it run in the cloud

If you would rather not maintain two VPS processes, StreamNeo keeps uploaded videos live on YouTube from the cloud: upload a recording or build a playlist, add your YouTube stream key, and go live. Your computer and home connection do not have to stay on. Each slot streams the uploaded quality up to 4K 60fps at one flat price, with automatic recovery if YouTube drops the stream. The first day is free with no card. Monthly billing is $9.99 per month. StreamNeo is for uploaded videos and YouTube streams, not camera broadcasting. See StreamNeo for details, or start your free first 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

Read next

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.