Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Mountain View desk6 min

YouTube Live Gaming Rerun: FFmpeg on an Ubuntu VPS

Install FFmpeg on an Ubuntu VPS, connect a prerecorded gaming video to YouTube Live, and test looping, settings, and stream health.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To stream a prerecorded gaming video to YouTube Live from an Ubuntu VPS, install FFmpeg with APT, upload and inspect your video, then send it to YouTube’s current ingest URL and stream key using a real-time FFmpeg input. Installation is only the first step: your YouTube channel must be eligible to stream, and a looping video needs testing because repeated media timestamps can cause errors.

1. Check YouTube Live eligibility first

A working FFmpeg installation cannot bypass YouTube account restrictions. YouTube’s current requirements say a channel must be verified, have no live-streaming restrictions in the previous 90 days, and meet the minimum age requirement of 16. Check that Live Control Room lets you create or select a stream before troubleshooting the VPS.

As an Amazon Associate I earn from qualifying purchases.

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.

YouTube’s live-streaming requirements can change, so confirm the current rules for your account and region.

2. Install FFmpeg on Ubuntu

Connect to the VPS over SSH, update APT’s package index, install FFmpeg, and confirm that the executable is available:

  1. sudo apt update
  2. sudo apt install ffmpeg
  3. ffmpeg -version

The FFmpeg version comes from the Ubuntu release’s configured package repositories. It can differ between releases; for example, the Ubuntu 24.04 (Noble) manual documents that release’s package build, not a universal version for every Ubuntu VPS. See the Ubuntu Noble FFmpeg manual and Ubuntu Server package-management documentation.

3. Upload and inspect the gameplay recording

Copy the video to the VPS using your preferred secure file-transfer method, and note its exact path. For example, if you put it in /home/ubuntu/videos, the file path might be /home/ubuntu/videos/gameplay.mp4. Substitute your actual username and filename in commands.

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

Before streaming, use FFmpeg’s probe utility to check that the file opens and identify its video and audio streams:

ffprobe -hide_banner /home/ubuntu/videos/gameplay.mp4

  • Confirm the file path, video codec, resolution, frame rate, and whether an audio stream is present.
  • Make sure the VPS has enough disk space for the recording and enough CPU capacity to encode at your intended output settings.
  • Use only gameplay and audio you have the rights to stream. A live broadcast is still subject to copyright rules; looping it does not grant permission to use game music, soundtrack recordings, or other third-party material.

4. Get the YouTube server URL and stream key

In YouTube Studio, open Live Control Room, create or choose the stream, and copy the server URL and stream key shown for that stream. YouTube’s encoder instructions state: “To start streaming, enter your YouTube Live server URL and stream key into your encoder.” Use the values displayed for your stream rather than a generic ingest address.

YouTube’s encoder setup instructions explain how to connect an encoder. Treat the stream key like a password: do not publish it in examples, screenshots, shared shell history, or a public script. If it is exposed, replace or reset it in YouTube Studio before continuing.

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

5. Choose output settings that fit the file and VPS

Use YouTube’s current encoder recommendations as the starting point, then make sure the VPS can encode the chosen resolution and frame rate and sustain the outbound bitrate. YouTube lists H.264, H.265/HEVC, or AV1 video; AAC or MP3 audio; constant bitrate (CBR); frame rates up to 60 fps; and a recommended two-second keyframe frequency that should not exceed four seconds. Its bitrate recommendations vary by codec, resolution, and frame rate.

H.264 output example YouTube-recommended video bitrate
720p at 30 fps 8 Mbps
1080p at 30 fps 14 Mbps
1080p at 60 fps 17 Mbps

These are YouTube recommendations, not a guarantee that a particular VPS can encode or deliver them. Check YouTube’s live encoder settings for the current table. Match settings to the source where practical; upscaling a lower-resolution recording does not add detail. YouTube recommends RTMPS for secure ingest, testing with similar movement and audio, checking stream health, and leaving upload headroom.

6. Start a non-looping stream first

Test one pass before setting up a rerun. This illustrative command paces the file in real time, encodes H.264 and AAC, and sends an FLV stream to the destination YouTube supplied. Change the input path, output settings, and destination to match your file, YouTube stream, installed FFmpeg build, and VPS capacity:

ffmpeg -re -i /home/ubuntu/videos/gameplay.mp4 -c:v libx264 -preset veryfast -b:v 4500k -maxrate 4500k -bufsize 9000k -pix_fmt yuv420p -g 60 -c:a aac -b:a 128k -f flv 'rtmps://YOUTUBE_INGEST_URL/STREAM_KEY'

The bitrate and keyframe values above are illustrative, not YouTube settings for every resolution or frame rate. For example, -g 60 corresponds to a two-second interval only when the output is 30 fps; calculate the interval from your actual frame rate and follow YouTube’s current guidance. Replace the example destination with the exact server URL and stream key from Live Control Room. Keep the real key private. The -re option reads the file at its native rate rather than sending it as quickly as possible; -f flv selects the output container commonly used for RTMP-style ingest. See the Ubuntu FFmpeg manual and its protocol documentation.

7. Loop the recording only after testing

To repeat the source indefinitely, FFmpeg offers -stream_loop -1. Put it before the input option, as in this template:

ffmpeg -re -stream_loop -1 -i /home/ubuntu/videos/gameplay.mp4 -c:v libx264 -preset veryfast -b:v 4500k -maxrate 4500k -bufsize 9000k -pix_fmt yuv420p -g 60 -c:a aac -b:a 128k -f flv 'rtmps://YOUTUBE_INGEST_URL/STREAM_KEY'

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

Do not assume every file will loop cleanly. FFmpeg’s loop documentation warns that looping does not rewrite source timestamps and can produce non-monotonic timestamps. The documented warning concerns the loop filter; behavior also depends on the exact loop method, file, and installed build. Test the complete command and watch FFmpeg’s log and YouTube’s stream health before relying on a long rerun. If timestamps or reconnects fail, inspect the error and test timestamp handling on a copy of the command rather than applying a blind fix. The Ubuntu FFmpeg filter manual documents the loop timestamp caveat; check the manual for your installed build as well.

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

8. Troubleshoot the common failure points

  • ffmpeg: command not found: installation may not have completed, or the shell cannot find the executable. Run sudo apt update, install the ffmpeg package, then check ffmpeg -version.
  • YouTube does not accept the feed: verify channel eligibility, the selected stream, the current server URL, and the stream key. A technically correct command cannot overcome account restrictions.
  • Authentication or connection errors: check that the copied URL and key are current and complete, that the VPS can reach the destination, and that the output protocol matches the destination. Keep credentials private while checking them.
  • Video is too fast or the stream health is poor: confirm that the input is paced with -re, then check whether VPS CPU and outbound capacity can sustain the chosen codec, resolution, frame rate, and bitrate. Leave network headroom.
  • Loop warnings or a stream that stops at the file’s end: check that the loop option is in the right place, inspect FFmpeg’s timestamp messages, and test the exact file and installed version. The loop may need timestamp-related adjustment; there is no single safe fix for every input.
  • No audio: check whether the recording contains an audio stream with ffprobe. If it does not, an audio encoder option cannot create the original game audio.

9. Or let it run in the cloud

If managing an Ubuntu VPS, FFmpeg commands, and loop testing is more than you want to maintain, StreamNeo keeps an uploaded video or playlist live on YouTube from the cloud. Upload your recording, add your YouTube stream key once, and go live. Nothing has to stay powered on at home; it accepts video as uploaded up to 4K 60fps at one price per slot, automatically recovers if YouTube drops the stream, and the first day is free with no card. The Monthly price is $9.99 per month.

Start a 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.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

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.