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
DocumentaryTube
Admit one · Blog

How to Stream a Pre-Recorded Video to YouTube Live with a Free Linux VPS

Run FFmpeg on a Linux VPS to send a prerecorded video to YouTube Live. This guide covers YouTube setup, RTMPS, encoding, bandwidth limits, and troubleshooting.
Opened Runtime7 min Written byDocumentaryTube Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can stream a pre-recorded video to YouTube Live from a Linux VPS by running FFmpeg at the file’s normal playback speed and sending its output to YouTube’s ingest server. First create a live event in YouTube Studio, then provide FFmpeg with the event’s server URL and stream key. A VPS is optional: it is simply a remote place to run the encoder. The main catch is that a “free” VM may not include enough outbound data, CPU capacity, or reliability for a sustained stream.

Before you start: check channel eligibility and rights

YouTube says a channel must be verified and have no live-streaming restrictions in the preceding 90 days to livestream. Check eligibility before diagnosing encoder problems in YouTube’s live-streaming requirements. You do not need a webcam or capture hardware for this workflow; FFmpeg reads the video file directly.

Only stream videos you have the rights to broadcast. A video being publicly available online does not itself grant permission to rebroadcast it. YouTube’s copyright and other content policies still apply to live streams.

Create the YouTube live event and get its connection details

  1. Sign in to YouTube Studio, create or schedule a live stream, and open its Live Control Room. Follow YouTube’s current encoder setup steps; labels and available options can change.
  2. In the stream settings, copy the server URL and stream key shown for the event. The URL identifies YouTube’s ingestion endpoint; the key authorizes your encoder to send to your channel.
  3. Use the RTMPS server URL when YouTube provides one. Keep the key private: do not publish it in a screenshot, paste it into a public script, or leave it in shared shell history. If it is exposed, reset it in YouTube Studio before streaming again.

The key is sensitive even though it is not your YouTube account password. Anyone who obtains it may be able to send a feed to the associated live event.

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.

Prepare the VPS and video file

Install FFmpeg

Connect to a Linux VPS over SSH, transfer the recording to it, and install FFmpeg using the package manager for that distribution. On an apt-based system, Google’s documentation uses:

sudo apt update
sudo apt install ffmpeg

That package-install example is for apt-based Linux; commands and available FFmpeg builds vary by distribution. Google also shows FFmpeg reading an input in real time in its near-real-time preview example, but that example is for its Live Stream API input, not a complete, tested YouTube VPS command.

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.

Inspect the recording and plan the output

Use FFmpeg’s probe utility to inspect the file before choosing whether to copy or re-encode its streams:

ffprobe -hide_banner /path/to/video.mp4

Check the video codec, resolution, frame rate, audio codec, and whether an audio stream exists. YouTube’s current encoder guidance lists H.264 video, AAC or MP3 audio, constant bitrate (CBR), and keyframes every two seconds, with an interval no longer than four seconds. Check the current YouTube encoder settings and the event’s Live Control Room rather than assuming a particular bitrate or resolution is right for every file and event.

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.
  • Stream-copy: If the file’s video and audio are compatible with YouTube’s current requirements, copying them without re-encoding can reduce CPU use. It does not fix incompatible codecs, unsuitable keyframes, missing audio, or an unsuitable bitrate.
  • Re-encode: If the source needs conversion, encode it to a compatible format and configure CBR and the required keyframe interval. CPU load depends on resolution, frame rate, codec, encoding preset, and the VPS allocation. Do not assume a particular VM size can handle a chosen profile without checking its performance.

Send the file to YouTube with FFmpeg

For a one-time stream, the basic pattern is to put -re before the input file so FFmpeg reads it at its normal frame rate, then specify an output compatible with YouTube and the server URL and stream key from Live Control Room. FFmpeg describes -re as mainly used to simulate a capture device or live input when reading from a file; it paces the input but does not make an underpowered VPS encode or transmit reliably. See the current FFmpeg documentation.

ffmpeg -re -i /path/to/video.mp4  -f flv "[RTMPS_SERVER_URL]/[STREAM_KEY]"

Replace the bracketed values with the exact endpoint and key displayed for your event, and replace with options appropriate to the input and YouTube’s current encoder settings. The brackets are explanatory placeholders, not literal FFmpeg syntax. Do not publish a real key or leave it in a script that others can read. The output muxer and destination format must match the protocol and endpoint in use; consult the current FFmpeg build’s protocol support and YouTube’s RTMPS requirements if the connection fails.

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

Google recommends RTMPS, which uses TLS and port 443. Its RTMPS technical guide specifies a valid endpoint and correct hostname/SNI handling for TLS authentication. Use the hostname and path YouTube supplies rather than guessing or substituting an address.

Check the preview before going live

  1. Start FFmpeg early enough to allow YouTube to receive and process the feed.
  2. Open the event’s Live Control Room and check the preview for picture and audio. Review any stream-health warnings before proceeding.
  3. When the preview and event are ready, select Go live in YouTube Studio if the event requires that step.
  4. Monitor both the Live Control Room and the VPS while the stream runs. YouTube recommends setting up ahead of time and checking stream quality continuously in its streaming tips.
  5. For a one-time program, stop FFmpeg when the video ends. A continuous loop requires deliberate loop and end-of-file handling; do not assume that a command which sends one file will repeat it forever.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Will a free Linux VPS carry the stream?

“Free VPS” does not tell you whether a provider allows the required sustained outbound traffic or supplies enough CPU, storage, and availability. Check the provider’s current region eligibility, transfer allowance, VM conditions, storage and networking limits, and any preemption or availability terms before starting. Where available, set a budget alert.

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.

Estimate outbound transfer using the actual outgoing bitrate and planned runtime, then compare that amount with the VPS account’s current monthly quota. YouTube recommends leaving 20% bandwidth headroom. For a VPS, that means capacity on the provider’s outbound network, not your home upload speed. Include both feeds if you configure a primary and backup stream. See YouTube’s bandwidth guidance.

As a specific, changeable example, Google Cloud’s current free-program page lists one eligible non-preemptible e2-micro VM per month in one of three US regions and 1 GB per month of Compute Engine outbound transfer under stated free-tier conditions. The allowance is subject to those conditions and is not evidence that the VM can carry a long video stream. Check the current Google Cloud Free Program terms for your account and region.

Troubleshoot common failures

Symptom What to check What to do
YouTube will not accept the stream Channel eligibility, event status, server URL, stream key, and protocol. Confirm the channel meets YouTube’s current live-streaming requirements. Copy the current URL and key from the event settings, and use the provided RTMPS endpoint where available.
TLS or certificate error Whether the endpoint is RTMPS, port 443, and the endpoint hostname/SNI. Use the valid RTMPS URL shown in Live Control Room. Check that the client connects to port 443 and preserves the hostname for TLS/SNI authentication, as described in Google’s RTMPS guide.
Connection times out or drops Provider network limits, actual output bitrate, stream key, and whether FFmpeg is keeping pace in real time. Check the VPS provider’s outbound capacity and transfer quota, review FFmpeg output, and leave YouTube’s recommended 20% bandwidth margin. Reduce the outgoing bitrate or choose a capable plan if the current network cannot sustain it.
Video appears but audio is missing Whether the file contains an audio stream and whether the output includes compatible audio. Inspect the file with ffprobe, select or encode an audio stream in AAC or MP3, and check the Live Control Room preview. YouTube’s LiveStreams reference describes audio and health diagnostics.
Health warnings, stutter, or poor playback CBR configuration, keyframe interval, codec compatibility, available outbound bandwidth, and CPU capacity. Compare the outgoing feed with YouTube’s current encoder settings. Use a two-second keyframe interval, not exceeding four seconds, and check whether the VPS can sustain the selected encoding workload.

Or let it run in the cloud

If your aim is to keep a YouTube channel live from uploaded recordings without maintaining an FFmpeg process on a VPS, 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. Nothing has to stay on at home; it supports the quality you upload up to 4K 60fps at one price per slot, with no re-encode or quality tiers, and automatically recovers if YouTube drops the stream. The first day is free with no card; it is one free day per account. Monthly pricing is $9.99 per month. Each slot includes 10 GB of storage, pooled across active slots, and the same features on every plan; only the plan length changes. It streams to YouTube and plays uploaded videos, not a live camera feed. See plan details or start your free 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.

Free tools Windows power users keep installed

One-click scans. No signup required.

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

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.

More from the Screening Room

  1. How to Migrate a 24/7 YouTube Stream to a New VPSAdmit one · BlogHow to Migrate a 24/7 YouTube Stream to a New VPSOpened04 OCT 2026Runtime6 min
  2. How to Run a YouTube Playlist on a Headless Linux Server—and Broadcast It LiveAdmit one · BlogHow to Run a YouTube Playlist on a Headless Linux Server-and Broadcast It LiveOpened04 OCT 2026Runtime6 min
  3. How to Make a 24/7 Indian Music YouTube Stream Restart After a Server RebootAdmit one · BlogHow to Make a 24/7 Indian Music YouTube Stream Restart After a Server RebootOpened04 OCT 2026Runtime6 min
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.