DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober 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 Scan×
Skip to content
FFmpeg

How to Loop a YouTube Live Stream from a VPS with FFmpeg

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

To loop a prerecorded video on a VPS and send it live to YouTube, run FFmpeg with -stream_loop -1 to repeat the input, -re to read it at its native rate, and the RTMPS URL and stream key shown in YouTube Live Control Room. Match the encoding settings to YouTube’s current guidance, test the stream, and monitor both FFmpeg and YouTube’s stream health. A running command is not proof of uninterrupted 24/7 operation or policy approval for continuous prerecorded broadcasts.

What you need before you start

  • A VPS with the authorized video file on disk and enough sustained CPU capacity to encode it, if you choose to re-encode.
  • FFmpeg installed on the VPS. Confirm the file can be read and contains the audio and video streams you expect.
  • A YouTube channel and a stream created or selected in Live Control Room, where you can copy its stream key and RTMPS URL.
  • Outbound network capacity that can sustain the bitrate you select. The necessary CPU and network capacity depend on your encoding settings; there is no universal VPS minimum established here.

Use only media you have permission to broadcast. Keep the stream key private: anyone who obtains it may be able to publish to the configured stream.

Get the YouTube RTMPS destination

  1. Open YouTube Live Control Room and create or select the stream you intend to use.
  2. Copy the stream key for that stream. YouTube Help says the RTMPS address can be displayed by clicking the lock icon beside Stream URL.
  3. Use the exact RTMPS URL presented for that stream configuration. Do not substitute an ingestion address copied from an unrelated tutorial. YouTube’s ingestion configuration supplies the destination; the stream key must match the selected stream.

Use rtmps on port 443 with the valid YouTube ingestion host and application path. RTMPS protects the connection with TLS/SSL. See YouTube’s RTMPS instructions and Google’s RTMPS delivery documentation.

Build and run the FFmpeg loop

Start with the command pattern

FFmpeg’s -stream_loop -1 repeats an input indefinitely. The -re option reads it at its native frame rate, avoiding a file being sent as fast as the VPS can read it. Input options belong before the input they apply to.

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.
ffmpeg -re -stream_loop -1 -i /path/to/authorized-video.mp4 [encoding and audio/video options] -f flv 'rtmps://HOST:443/APP/STREAM_KEY'

This is a template, not a ready-to-run command: replace the file path and destination with your own, and choose audio/video options appropriate to the source and YouTube’s current encoder guidance. The RTMPS URL format is supplied by Live Control Room; do not publish or expose the real key in a public script, log, or article.

Choose whether to encode

Your encoding options determine the outgoing codec, resolution, frame rate, keyframe interval, and bitrate. If you re-encode, choose a setting combination the VPS can sustain while maintaining the required upload bitrate. A VPS that cannot encode quickly enough can fall behind or drop frames. If you stream without re-encoding, check that the source’s codecs and parameters are accepted by the selected ingestion configuration; do not assume every file will work unchanged.

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.

FFmpeg documents looping and input timing in its documentation. For protocol support and connection behavior, consult the FFmpeg protocols documentation.

Launch and verify

  1. Run the command in a shell on the VPS and watch FFmpeg’s output for connection or encoding errors.
  2. Check Live Control Room to confirm YouTube is receiving the signal and that stream health is acceptable before relying on the broadcast.
  3. Monitor the process and stream during a test. A service manager or process supervisor may restart FFmpeg after a crash, but a restart alone does not prove an uninterrupted broadcast or preserve the same live session.

Choose settings YouTube can accept

Use YouTube’s current encoder table for the resolution and bitrate you plan to send. Its guidance covers RTMP/RTMPS, H.264/H.265/AV1 video, AAC or MP3 audio, frame rates up to 60 fps, and a recommended two-second keyframe interval that should not exceed four seconds. Check the current table rather than relying on settings copied from an old example: supported combinations and recommendations can change.

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.

YouTube advises choosing a quality that is reliable for the available connection, testing before going live, and monitoring stream health during the event. Its encoder guide also recommends running a speed test to test upload bitrate. Read Choose live encoder settings, bitrates, and resolutions for the current values associated with your resolution.

  • Resolution and bitrate: A higher-resolution stream needs more sustained upload capacity. Select a bitrate within YouTube’s current recommendation and below what the VPS can reliably send.
  • Frame rate and keyframes: Keep the frame rate within the source and encoder capabilities; configure keyframes to the current recommendation, with an interval no longer than YouTube’s stated maximum.
  • CPU and codec: Encoding workload varies by codec, resolution, frame rate, and settings. Confirm the VPS has enough sustained CPU for your chosen software encoding; no minimum CPU specification is established for all VPS plans.
  • Protocol: YouTube lists RTMP, RTMPS, HLS, and DASH ingestion. RTMPS is the straightforward default for this FFmpeg file-loop workflow. Consider HLS or DASH only where their specific capabilities and implementation requirements fit your use case; protocol choice can affect latency.

YouTube transcodes incoming live streams for viewers, but that does not remove the need for a stable, correctly configured input stream. See Google’s ingestion protocol comparison.

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
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Protect the key and account for YouTube rules

Do not commit a stream key to a public repository, include it in a public command example, or leave it in logs that others can access. If it is exposed, replace or reset it in YouTube’s stream settings before using it again.

Technical success is separate from permission and policy compliance. Use media you are entitled to stream, and review YouTube’s current copyright and live-streaming rules for your specific content. The available technical guidance does not establish whether a particular continuous loop is allowed, set a maximum live duration, or guarantee that a restarted process will continue the same broadcast. Do not treat an FFmpeg loop as confirmation of platform approval or uninterrupted 24/7 availability.

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.

Troubleshoot common failures

Symptom Likely check What to do
Connection timeout or SSL/TLS error Destination, protocol, port, or encoder RTMPS support Copy the RTMPS URL from the correct Live Control Room stream again. Verify it uses rtmps, port 443, the correct host and application path, and an FFmpeg build that supports RTMPS.
YouTube receives no signal Stream key or selected stream mismatch Confirm that the key and URL belong to the same selected stream configuration, then check FFmpeg’s output for authentication or connection errors.
FFmpeg cannot open the input File path, permissions, or media readability Check that the path is correct, the VPS user can read the file, and the file plays with expected audio and video streams.
Stream health is poor or frames are dropped Bitrate versus sustained network capacity, or encoding load Run an upload speed test, lower the resolution or bitrate to a reliable level within YouTube’s current table, or use encoding settings the VPS CPU can sustain.
Video or audio is rejected or missing Codec and source stream compatibility Inspect the file’s audio/video streams and compare the output codec, resolution, frame rate, and keyframe interval with YouTube’s current encoder guidance.
Process stops after an error or server restart Process supervision and VPS lifecycle Use a process supervisor or service manager to detect and restart a failed process, then verify the new signal in Live Control Room. A restart mechanism does not establish that the broadcast remains uninterrupted or that YouTube accepts an ongoing stream.

Or let it run in the cloud

If you do not want a VPS, FFmpeg process, and server connection to manage, StreamNeo runs prerecorded video as a YouTube live stream from the cloud:

  1. Upload a recording or build a playlist.
  2. Add your YouTube stream key once.
  3. Go live; StreamNeo loops the uploaded video from the cloud.

Nothing has to stay on at home. Every slot streams uploaded video at its original quality up to 4K 60fps for 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. Monthly is $9.99 per month. It streams to YouTube only and plays uploaded video; it does not go live from a camera. Start your free 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.

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
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver 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.