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
VGSources
FFmpeg

How to Stream a Prerecorded Video to YouTube Live With a Free Linux VPS

A Linux VPS can run FFmpeg to send a prerecorded video to YouTube Live, but free transfer limits and server capacity can make continuous streaming impractical. Set up the event, protect your stream key, use real-time pacing, and verify the preview before going live.

By VGSources Team 7 min read
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can use a Linux VPS to stream a prerecorded video to YouTube Live: run FFmpeg on the VPS, pace the file in real time with -re, and send it to the YouTube ingestion URL with your stream key. The VPS is optional; it is simply a remote place to run the encoder. The main obstacle to streaming for long periods is usually not the command but the provider’s outbound-transfer limit and the VPS’s ability to encode and send the video reliably.

What you need before you start

  • A YouTube channel eligible to livestream. YouTube says the channel must be verified and have no live-streaming restrictions in the preceding 90 days; check its current live-streaming requirements.
  • A Linux VPS with FFmpeg, the video file on disk, enough CPU if you need to re-encode, and sufficient sustained outbound bandwidth and monthly transfer.
  • A live stream created or scheduled in YouTube Studio, with its server URL and stream key available from Live Control Room.
  • Permission to broadcast the video and its audio. A livestream can still be subject to copyright claims, blocks, or other YouTube policy enforcement. Only stream content you have the right to broadcast.

You do not need a webcam or capture card for this workflow. FFmpeg reads the file and sends the outgoing stream; -re makes file input proceed at its normal rate rather than as fast as the VPS can read it.

Create a YouTube Live event and get its key

  1. Sign in to YouTube Studio and create or schedule a livestream, then open Live Control Room. YouTube’s encoder setup guide explains this workflow and where to find the connection details.
  2. Copy the current server URL and stream key shown for the event. The URL identifies YouTube’s ingestion endpoint; the key authorizes your stream. Keep the key secret, just like a password. Do not include a real key in a script you share, a screenshot, or a public repository.
  3. Prefer an RTMPS endpoint when YouTube offers one. Confirm that the address begins with the secure protocol shown in Live Control Room; do not guess or reuse an endpoint from an old stream.

If the event is scheduled, the encoder can connect before you start the broadcast. You will check the preview and stream health before selecting Go live in Live Control Room.

Prepare the VPS and video file

Install FFmpeg

On an apt-based Linux distribution, Google Cloud’s FFmpeg example uses:

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.

sudo apt update && sudo apt install ffmpeg

Package availability and FFmpeg builds vary by distribution. Use your provider’s supported package manager or an official FFmpeg build if the package is unavailable. Verify the installed command with ffmpeg -version.

Upload and inspect the file

Copy the recording to the VPS using a secure transfer method, then confirm its path and inspect its streams and properties:

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.

ffprobe -hide_banner /path/to/video.mp4

Check the video codec, resolution, frame rate, audio codec, and duration. These determine whether the file can be passed through without re-encoding and whether your VPS can handle any conversion required. A file that looks playable locally is not necessarily configured to match YouTube’s live encoder recommendations.

Choose an output that YouTube can ingest

YouTube’s current encoder settings guidance recommends H.264 video, AAC or MP3 audio, constant bitrate (CBR), and keyframes every two seconds, with intervals no longer than four seconds. Check the current page and the settings shown for your event, because available choices and labels 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.
  • If the file already matches: stream-copying its audio and video can reduce VPS CPU use. It does not fix an incompatible codec, unsuitable keyframe spacing, or other format mismatch.
  • If it does not match: re-encode to a compatible output. CPU demand depends on resolution, frame rate, codec, and encoder preset, as well as the VPS allocation. There is no universally safe instance size; monitor the actual VPS under load.
  • For either route: use a steady bitrate appropriate to the selected resolution and frame rate, and make sure the VPS can sustain it. YouTube recommends leaving 20% bandwidth headroom; for a VPS, this refers to outbound capacity from the provider’s network, not your home upload speed. See YouTube’s streaming tips.

Start FFmpeg and verify the preview

Use the following as a command shape, not a copy-and-run command: replace the file path and placeholders with the values for your stream, and use an output format and options appropriate to your file and YouTube’s current settings.

ffmpeg -re -i /path/to/video.mp4 -c:v copy -c:a copy -f flv 'rtmps://YOUR_INGEST_HOST/YOUR_INGEST_PATH/YOUR_STREAM_KEY'

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

In this example, -re appears before the input so FFmpeg reads the file at its native rate. The output URL is illustrative: use the full endpoint displayed in Live Control Room and append the key only in the format required by that endpoint. Do not paste a real key into a public tutorial or leave it in shell history where other users can access it. If you re-encode rather than stream-copy, replace the copy options with encoder settings suitable for the file, VPS, and YouTube’s current recommendations. FFmpeg documents -re as a way to simulate a live input when reading from a file; it does not guarantee that the VPS can keep up.

  1. Start FFmpeg early enough to troubleshoot before the planned broadcast.
  2. Open the event in Live Control Room and confirm the video preview, audio, and stream-health indicators.
  3. Once the preview is correct, select Go live when you are ready to begin the broadcast.
  4. Monitor Live Control Room and the VPS while the stream runs. YouTube advises checking setup ahead of time and monitoring stream quality.
  5. For a one-time program, stop FFmpeg when the video ends. Do not assume that an unattended command will restart after a failure or run forever.

Google’s RTMPS ingestion guide describes the secure connection: RTMPS uses TLS and port 443, and the TLS handshake needs the correct server hostname for SNI and certificate validation. The command above is a general FFmpeg pattern, not a claim that one exact command has been tested on every VPS or FFmpeg build.

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

Estimate the bandwidth and cost of “free”

Calculate transfer from the actual encoded bitrate and the time you expect to stream. As a rough conversion, a constant 1 megabit per second is about 0.45 gigabytes per hour before protocol overhead; actual transfer varies with bitrate and overhead. Multiply by runtime, allow headroom, and compare the result with the VPS provider’s current outbound quota. If you send both a primary and backup feed, include both.

A “free VPS” label does not guarantee enough monthly transfer, CPU, storage, sustained network capacity, or uninterrupted availability. Providers may also restrict eligible regions, require an account or payment method, or apply preemption and other conditions. Read the current plan terms and consider setting a budget alert before launching a long stream.

As one dated-by-its-current-listing example—not a general rule for free VPS plans—the Google Cloud Free Program lists one eligible non-preemptible e2-micro VM per month in one of three US regions and 1 GB per month of outbound transfer for Compute Engine under its stated conditions. That transfer allowance is not evidence that a continuous video stream will fit; check the current terms, region eligibility, and your account’s quota before relying on it.

Troubleshoot common failures

Symptom What to check Practical fix
FFmpeg cannot connect or times out Endpoint spelling and protocol, stream key, port access, VPS network rules, and outbound connectivity. Copy the current URL and key again from Live Control Room. Prefer the RTMPS endpoint; its secure connection uses port 443. Check the provider’s firewall or egress rules.
TLS or certificate error Whether the URL is truly RTMPS, whether the hostname and path are correct, and whether the client uses the correct hostname for SNI. Use the current RTMPS endpoint from YouTube, not a cleartext RTMP address. Check FFmpeg’s TLS diagnostics and the hostname/certificate details against Google’s RTMPS guide.
FFmpeg reports an invalid or rejected stream Stream key, output container/protocol, codecs, audio presence, bitrate mode, and keyframe interval. Re-copy the event’s key and URL; compare output to YouTube’s current encoder recommendations. A correct key cannot compensate for an incompatible output.
Preview is choppy or stream health is poor Actual outgoing bitrate, VPS CPU load, packet loss or throttling, and whether FFmpeg is keeping real-time pace. Check provider network and process metrics. Reduce the output bitrate or re-encoding workload if needed, while keeping the output within YouTube’s current settings and the provider’s limits. Preserve YouTube’s recommended 20% bandwidth margin.
Video appears but audio is missing Whether the input contains an audio stream and whether the output maps and encodes it. Inspect the file with ffprobe; configure audio mapping and an accepted audio codec if necessary, then verify audio in the Live Control Room preview.
Stream stops when the file ends Whether the input is a single finite recording. That is expected for a one-time file input. Stop the broadcast or implement and test a deliberate looping workflow; loop behavior and transitions require separate handling, and a loop does not itself provide recovery after an encoder or network failure.
Livestream option is unavailable Channel verification and live-stream restrictions. Check YouTube’s current eligibility requirements before changing FFmpeg settings.

Or let it run in the cloud

If your goal is simply to keep prerecorded video playing as a YouTube livestream, StreamNeo is a hosted alternative: upload a recording or build a playlist, add your YouTube stream key once, and go live. It loops the uploaded video from the cloud, so nothing has to stay on at home. It streams the upload as made, up to 4K 60fps, at one price per slot; it also attempts automatic recovery if YouTube drops the stream. The first day is free with no card, one free day per account. Monthly pricing is $9.99 per month. You can review the service at StreamNeo and its pricing page. Start the free day with StreamNeo.

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.

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.

More from Patch Notes

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
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.