October DealsAmazon USOctober deal check: compare before you payAmazon 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 NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Mountain View desk6 min

How to Run a 4K 60fps YouTube Live Loop with FFmpeg on a Google Cloud VM

Use FFmpeg to loop a prerecorded 4K60 file into YouTube Live from Google Cloud. Learn the key settings, VM and egress trade-offs, cost factors and tests to run.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To loop a prerecorded video into YouTube Live from Google Cloud, create a YouTube live event, prepare a Compute Engine VM that can sustain your chosen FFmpeg workload and outbound bitrate, then run FFmpeg with -stream_loop -1 and file-input pacing. The exact VM cannot be chosen safely without knowing whether you can copy the source streams or must re-encode them—and testing the actual VM, route and file is essential.

Before you start: decide whether FFmpeg will copy or encode

Inspect the media file and decide whether its existing video and audio streams are suitable for YouTube’s ingest requirements. If they are, stream-copying avoids a new encode. If they are not—or if you need to change the codec, resolution, frame rate or bitrate—FFmpeg must encode the output. Encoding a 4K60 stream can impose substantially different compute demands from copying compatible streams.

As an Amazon Associate I earn from qualifying purchases.

No single Google Cloud machine type is established as sufficient for every source file and encoding workload. The required capacity depends on the input, output codec and settings, and whether encoding is CPU- or GPU-assisted. Choose a candidate VM and test it with the representative file and command before relying on it.

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

Create a YouTube Live event and protect its stream key

  1. In YouTube Studio, create or schedule the live stream and open its stream settings. YouTube provides a stream URL and stream key for the encoder.
  2. Configure FFmpeg to send the stream to YouTube’s ingest URL using the key. Treat the key like a password: do not publish it, place it in a public script or share terminal output that exposes it. If it is compromised, reset it in YouTube Studio. See YouTube’s stream settings guidance.
  3. Use RTMPS where available, as YouTube recommends. Confirm that the event is ready to receive the encoder before starting FFmpeg.

Choose the ingest settings for 2160p60

YouTube’s encoder guidance supports H.264, H.265/HEVC and AV1, recommends constant bitrate (CBR), allows up to 60 fps, and recommends a two-second keyframe interval, not exceeding four seconds. Select settings from the current YouTube guidance row for the codec you actually send; the bitrate is codec-specific, not a universal 4K60 figure.

#1 Best Overall
KOTIN Prebuilt Gaming PC RTX 5070 12GB, Ryzen 7 9700X, 32GB DDR5, 1TB SSD
  • POWERED BY RTX 5070 12GB + RYZEN 7 9700X - The GeForce RTX 5070 12GB GDDR7 graphics card pairs with an 8-core AMD Ryzen 7 9700X processor to drive smooth 1440p and 4K gameplay, giving this gaming PC the headroom for modern titles, streaming, and creative work.
  • 32GB DDR5 6000MHz MEMORY & 1TB NVMe SSD - 32GB of high-speed DDR5 memory and a 1TB PCIe 4.0 NVMe solid state drive deliver quick load times, smooth multitasking, and generous storage, keeping this prebuilt gaming desktop responsive under heavy workloads.
  • BUILT-IN 11.3-INCH Smart DISPLAY - An integrated smart screen shows real-time CPU and GPU temperatures, usage, and weather while you play, adding a distinctive and functional touch to your battlestation.
  • 850W 80+ GOLD POWER SUPPLY, 360MM LIQUID COOLING & WiFi 7 - An 850W 80 Plus Gold certified power supply provides stable, efficient power with headroom for future upgrades, while a 360mm AIO liquid cooler, WiFi 7, and an ARGB mid-tower case keep the Ryzen 7 CPU cool and connected in a clean build.
  • READY TO PLAY OUT OF THE BOX - Arrives fully assembled and tested with Windows 11 Home pre-installed, so your prebuilt gaming computer is ready to set up in minutes. Assembled in the USA, and backed by a one-year limited warranty and lifetime free technical support.

For H.264 at 2160p60, YouTube’s current Help guidance accessed October 3, 2026 lists 35 Mbps as the recommended setting. That is a recommendation for this codec and resolution/frame-rate combination, not a promise that a VM or network route will sustain it. Verify YouTube’s live encoder settings, bitrates and resolutions before configuring the stream.

Run the prerecorded file as a real-time loop

FFmpeg’s -stream_loop -1 input option repeats an input indefinitely. For a file intended to be sent as a live stream, -re paces reading at the file’s native frame rate; FFmpeg documents it as equivalent to -readrate 1. Place these input options before the matching -i. Output options depend on your source and whether you copy or encode.

Rank #2
msi Codex Z2 Gaming Desktop, AMD R7-8700F, RTX 5070, 32GB DDR5, 2TB SSD | NVIDIA GeForce RTX 5070, USB Type-C, VR-Ready, Windows 11 Home. Model A8NVP-436US
  • POWERHOUSE 8-CORE GAMING PERFORMANCE — Driven by the AMD Ryzen 7 8700F with 8 cores and 16 threads, boosting up to 5.0 GHz for smooth, responsive gameplay and the ability to handle AAA titles, streaming, and background tasks all at once
  • NEXT-GEN BLACKWELL ARCHITECTURE — The NVIDIA GeForce RTX 5070 is powered by NVIDIA's cutting-edge Blackwell GPU architecture, delivering a massive generational leap in rasterization and ray tracing performance so you can experience your games the way they were meant to be played.
  • Simplistic Design: Enjoy the latest generation of Windows 11 Home for your everyday needs. *MSI recommends Windows 11 Pro for business use.
  • Cool While Gaming: In conjunction with an ARGB fan Air Cooler, the Codex R2 features four system cooling fans; three in the front and one in the rear to pull in cool air and push heat out of the PC.
  • Turn on the Bright Lights: With the built-in RGB lighting, take your gaming experience to the next level by pressing the MSI LED button to cycle through lighting options. Customize lighting even further with MSI Center software.
ffmpeg -re -stream_loop -1 -i /path/to/video.mp4 [output options] -f flv "rtmps://INGEST_URL/STREAM_KEY"

This is a command shape, not a complete universal command: replace the file path and ingest URL/key, and supply output options that match the chosen codec and source. Do not assume that copying the source is valid without checking its codecs and stream properties, or that a particular encode will run in real time on an untested VM. Keep the stream key out of shell history and logs where possible.

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

FFmpeg cautions against using low read rates with a live stream or capture device because packet loss may result. That warning matters if you adapt this command to a live input; the workflow here uses a prerecorded file. See the FFmpeg command-line documentation for the definitions of these options.

Rank #3
ZOTAC MEK Gaming PC Desktop, Ryzen 7 9800X3D, NVIDIA GeForce RTX 5080 16GB
  • Effortless Gaming: MEK from ZOTAC comes with all hardware and Windows 11 Pro pre-installed. Crafted in the USA, simply unbox, plug in, power up, and dive into your favorite games with ease. Backed by a 1-Year Complete System Warranty and 3-Year GPU Warranty — no registration required.
  • Heart of the MEK: the ZOTAC GAMING GeForce RTX 5080 16GB GDDR7 uses NVIDIA Blackwell architecture with AI-enhanced technologies including DLSS 4 Multi Frame Generation and real-time ray tracing — delivering exceptional 4K gaming performance with AI-driven frame rates and next-gen visual fidelity.
  • Powerful Processor: the AMD Ryzen 7 9800X3D AM5 Desktop CPU — featuring AMD's industry-leading 3D V-Cache technology — delivers up to 5.2GHz with 8 cores, 16 threads, and 96MB L3 Cache for elite gaming performance, seamless multitasking, and professional content creation.
  • Well-Rounded: 32GB DDR5-6000MHz RAM, 2TB NVMe M.2 SSD, and 850W 80+ Gold PSU provide quick loading times and stable power. Connections: HDMI 2.1b, 3x DisplayPort 2.1b (up to 4 displays), USB 3.2 Gen 2 (10Gbps), WiFi 6E, Bluetooth 5.3, 5-Gigabit LAN, 7.1 HD Audio.
  • 360mm AIO Liquid Cooling + Optimized Airflow & Warranty Support: MEK features a powerful 360mm all-in-one liquid cooler with front 2x 120mm Infinity fans and rear 1x 120mm Infinity fan for optimized system airflow, keeping your RTX 5080 and Ryzen 7 9800X3D running at peak performance during extended gaming sessions. Warranty service is provided through ZOTAC USA. Return shipping after warranty service is available only for U.S. addresses.

Select a VM and verify sustained outbound throughput

A successful connection at startup does not prove that the VM can maintain the selected bitrate. Google Cloud documents external egress limits that depend on the VM and applicable per-instance, per-flow and project-level limits. Published limits are ceilings, not guaranteed throughput for a particular stream or route. Compare the sustainable egress available to your VM with the bitrate you intend to send, allowing practical headroom rather than sizing exactly to the target.

There is no universally optimal VM type or region established for this task. The right choice depends on source media, stream-copy versus transcode, codec, target rate, region and runtime. Test the actual configuration under representative load and consult Google Cloud’s VM network bandwidth documentation.

Rank #4
CyberPowerPC Gaming PC, AMD Ryzen 7 8700F, GeForce RTX 5060 Ti 8GB
  • System: AMD Ryzen 7 8700F 4.1GHz 8 Cores | AMD B850 Chipset | 16GB DDR5 | 1TB PCIe 4.0 NVMe SSD | Windows 11 Home
  • Graphics: NVIDIA GeForce RTX 5060 Ti 8GB Graphics | 1x HDMI | 2x DisplayPort
  • Connectivity: 2 x USB-C 3.2 | 4 x USB-A 3.2 | 2 x USB-A 2.0 | 1 x LAN | WiFi 6 | Bluetooth 5.3 | 7.1 Channel Audio
  • Tempered Side Case Panel | Custom RGB Lighting | Keyboard and Mouse
  • 1 Year Parts & Labor Warranty, Free Lifetime Tech Support
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Estimate the full Google Cloud cost

Budget for the deployed configuration and the entire time it runs, not just the VM’s headline compute rate. Compute Engine prices compute separately from other possible charges; an attached GPU is billed in addition to the machine type, and internet data transfer out is priced separately. Disks and region also affect the total.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Estimate the selected VM in the intended region with the Google Cloud pricing calculator.
  • Include any attached accelerator using GPU pricing; a GPU is an additional charge, not a substitute for VM compute charges.
  • Account for internet data transfer out and applicable network pricing using VPC pricing.
  • Check the applicable egress limits alongside cost; a cheap configuration is not useful if it cannot sustain the stream.

Because machine family, region, disk, duration and encoding workload are unspecified, a reliable flat cost cannot be given. Recheck current prices, quotas and machine availability when deploying.

Test the stream before leaving it unattended

  1. Use the actual video, output settings, VM and network route planned for the continuous stream.
  2. Start the event as a test and confirm that YouTube receives the expected resolution, frame rate, audio and bitrate.
  3. Watch YouTube’s stream health indicators and messages while the stream runs. Look for dropped frames, unstable bitrate, encoder overload or ingest warnings.
  4. Confirm that the loop returns to the beginning cleanly and that the event remains healthy across the transition. YouTube recommends testing with representative audio and movement; it also transcodes received streams into multiple playback formats.

YouTube’s advice is direct: “We recommend testing before you start your live stream.”

Troubleshooting common failures

Symptom Likely area to check What to do
FFmpeg connects, but YouTube reports poor stream health or drops frames The VM or route may not sustain the selected bitrate; encoding may also be too demanding. Check YouTube’s messages and FFmpeg output, then test a representative run. Verify egress constraints and workload capacity before changing the bitrate or VM.
YouTube rejects the stream or reports settings that do not match the event Codec, bitrate, frame rate, keyframe interval, ingest URL or stream key may be wrong. Compare the actual encoder output with the current codec-specific YouTube settings, verify the event’s stream URL/key, and use the recommended two-second keyframe interval (no more than four seconds).
The file plays too quickly or the output does not behave like a live feed File input is not being paced in real time. For a prerecorded file, put -re before its -i input. Use -stream_loop -1 before that input to repeat it indefinitely.
FFmpeg cannot keep up after encoding begins The selected VM may not have enough capacity for the chosen encode. Test stream-copying if the source streams already meet the output requirements, or benchmark a more suitable VM/encoding configuration. Do not assume a GPU or general-purpose VM is sufficient without testing.
The stream key may have been exposed Credential handling or a shared log/script exposed the key. Reset the key in YouTube Studio and update the encoder configuration. Keep replacement credentials private.

Or let it run in the cloud

If you want a YouTube loop without keeping a VM or home computer running, StreamNeo is a cloud service that loops uploaded videos to YouTube. Upload a recording or build a playlist, add your YouTube stream key once, and go live. It is a different workflow from managing FFmpeg on Compute Engine.

Quick Recap

  • Nothing has to stay on at home; the stream runs from the cloud.
  • Each slot streams the uploaded quality as made, up to 4K 60fps, at one flat price per slot, with no re-encode or quality tiers.
  • It automatically recovers if YouTube drops the stream.
  • The first day is free with no card required, one free day per account.
  • The monthly plan is $9.99 per month.

Start your free StreamNeo 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.

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 *

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.

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