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
Compute Engine

How to Stream a Prerecorded Video to YouTube Live from Google Cloud

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

Yes. You can use a Google Cloud Compute Engine VM as the encoder: make a YouTube Live event, place the video where the VM can read it, and send an encoded feed from the VM to YouTube’s ingestion address. The video file and the YouTube broadcast are separate; YouTube receives a live feed, not the original file as a regular upload. The steps below describe a practical setup, but they are not a tested, end-to-end Google Cloud recipe. Test your chosen VM, media, and encoder settings in an unlisted event before relying on them.

What you need before you start

  • A YouTube channel eligible to live stream. YouTube requires channel verification and no live-stream restriction in the preceding 90 days. First-time live-stream enablement can take up to 24 hours, so check well before your event.
  • A Google Cloud project with permission to create and operate a Compute Engine VM.
  • A video file the VM can access, either on its disk or retrieved from storage before playback.
  • An encoder on the VM, such as FFmpeg, configured to send a live feed to the YouTube event.
  • The event’s ingestion URL and stream key from YouTube Live Control Room. Treat the key as a credential: do not expose it in public scripts, repositories, logs, screenshots, or command output.

Use a scheduled event if you want a watch page and advance promotion. YouTube recommends setting up an encoder event two hours ahead and starting the encoder at least 15 minutes before the scheduled start.

1. Create or schedule the YouTube Live event

  1. Open YouTube Studio and go to Live Control Room.
  2. Create or schedule an encoder stream. Set the event’s visibility and other event settings, then retrieve the stream URL and stream key.
  3. Keep the Live Control Room page available. Once the encoder connects, use its preview to check the feed before selecting Go live for a scheduled event.

The stream key connects your encoder feed to the event. Use the exact URL and key shown for that event rather than assuming an endpoint or reusing a key without checking the event configuration.

2. Prepare the Compute Engine VM and media

Choose the VM for the actual encoding workload

Size the VM for the codec, output resolution, frame rate, and number of simultaneous outputs you intend to run. Encoding can require substantially more CPU or accelerator capacity than simply sending an already compatible stream. The sources here do not establish a particular machine type, startup script, or storage layout as a tested solution, so validate your chosen configuration with the actual file and output settings.

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.

Make the source file available

Place the video on a disk attached to the VM or retrieve it from storage before playback. Check that the file is readable and that the VM has enough local space if you download it. A prerecorded file must be played out as a live encoder input; uploading it to YouTube as a normal video does not make it a live broadcast.

Check network access and capacity

The sender needs outbound connectivity to YouTube’s ingestion endpoint. Google Cloud’s default VPC rules generally allow outbound connections and block inbound ones, but inspect the project’s actual VPC and hierarchical firewall policies. Do not open inbound ports unless you have a separate management or source-ingest requirement.

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.

Google Cloud egress limits vary by VM type and destination, and published maxima are not guaranteed throughput. Plan for the encoded bitrate plus at least 20% upload-bandwidth headroom, as YouTube recommends. If sending a simultaneous backup feed, include both feeds in the capacity calculation.

3. Configure the encoder and delivery protocol

Prefer RTMPS for a typical encoder setup

YouTube supports RTMP, RTMPS, HLS, and DASH ingestion. For a conventional encoder workflow, use the RTMPS URL provided in Live Control Room. RTMPS is RTMP protected with TLS; the endpoint, URL path, protocol scheme, and port must match YouTube’s supplied ingest details. YouTube identifies RTMPS as a secure extension of RTMP. HLS is intended for some high-quality or high-resolution workflows at relatively higher latency, while DASH involves segment and manifest handling; neither is necessary for the basic workflow here.

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

Match output settings to the source and event

YouTube’s published encoder guidance recommends H.264 video, constant bitrate, AAC or MP3 audio, up to 60 fps, and a two-second keyframe interval; do not exceed four seconds between keyframes. Match the output resolution and frame rate to the source and event needs. These are recommendations, not a requirement to transcode every file: stream copying may work when the source codecs, frame rate, keyframes, and container are compatible with the ingestion requirements. Confirm the result in a test event.

If you transcode, use a bitrate appropriate to the chosen resolution and frame rate, and confirm the exact current encoder targets in YouTube’s guidance and Live Control Room. The supplied material does not establish a single bitrate for every source or event, so do not copy an arbitrary bitrate without checking the output and bandwidth budget.

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

Illustrative FFmpeg command template

The following is an implementation template, not a tested Google Cloud or YouTube command. Replace each placeholder, verify the installed FFmpeg build and your media, and test before a real broadcast. Use the exact RTMPS ingest address and stream key from Live Control Room in the form supported by your FFmpeg build; protect the completed command because it contains the stream key.

ffmpeg -re -stream_loop -1 -i "/path/to/video.mp4" 
  -c:v libx264 -preset veryfast -b:v VIDEO_BITRATE 
  -maxrate VIDEO_BITRATE -bufsize VIDEO_BUFFER_SIZE 
  -g KEYFRAME_INTERVAL_IN_FRAMES -keyint_min KEYFRAME_INTERVAL_IN_FRAMES 
  -c:a aac -b:a AUDIO_BITRATE -f flv 
  "RTMPS_URL_WITH_STREAM_KEY"

-re reads the file at approximately its playback rate rather than sending it as fast as possible, and -stream_loop -1 requests repeated playback. This example re-encodes video and audio; it will not work as written unless the placeholders are replaced with valid values and the VM has the required FFmpeg encoder. Set the keyframe interval in frames to match a two-second interval at the chosen frame rate; for example, that calculation changes with frame rate. Choose bitrate and buffer values based on the output and current YouTube guidance. If the input lacks audio, audio encoding may require a different configuration. Test looping behavior, file end transitions, audio continuity, and stream health rather than assuming the flags fit every file.

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.

For a compatible source where no recompression is needed, a stream-copy configuration can avoid re-encoding, but compatibility must be established from the actual media properties and YouTube’s ingestion requirements. A command that works for one file may fail or produce poor output for another.

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

4. Test, start, and monitor the broadcast

  1. Complete setup well before the scheduled start; YouTube recommends two hours of advance setup.
  2. Start the encoder at least 15 minutes before the event, then confirm that Live Control Room receives the feed and displays a usable preview.
  3. Check picture, audio, playback speed, and whether the video loops as intended. Confirm that the event page is reachable with the intended visibility.
  4. When the preview is ready, start the scheduled event from Live Control Room if it is not configured to start automatically.
  5. Monitor stream health and the event continuously. If you configured a backup encoder, test failover rather than assuming it will take over correctly.
  6. At the end, stop the encoder and end the event according to the event’s auto-start and auto-stop settings. YouTube’s encoder instructions state that streams under 12 hours are automatically archived.

5. Understand the API option

If you need to automate event creation and lifecycle management, YouTube’s Live Streaming API separates the ingest feed from the viewer-facing broadcast. A liveStream resource represents the feed and can be associated with one or more liveBroadcast resources. The returned ingestion metadata includes connection details and stream status. This is more involved than creating an event manually in Live Control Room; do not confuse the encoder’s feed resource with the public broadcast.

Common problems and fixes

  • The encoder cannot connect: Recheck the exact RTMPS URL, port, and stream key in Live Control Room. Confirm outbound access from the VM and inspect the project’s firewall policies.
  • YouTube does not show a preview: Confirm that the encoder is running and sending to the right event, then allow time for the feed to appear. Check the encoder’s output and its error messages without exposing the stream key in shared logs.
  • The feed is unstable or drops frames: Check VM resource use, source-file read performance, route conditions, and available outbound bandwidth. Keep the recommended 20% headroom beyond the aggregate outgoing bitrate; a cloud VM’s stated maximum egress is not guaranteed throughput.
  • The picture is rejected or stream health is poor: Check codec, frame rate, keyframe interval, constant-bitrate configuration, and the event’s expected settings. YouTube recommends H.264, up to 60 fps, two-second keyframes not exceeding four seconds, and AAC or MP3 audio.
  • The stream ends instead of looping: Verify that the encoder’s loop option is enabled and that the process remains alive after the file reaches its end. Test the full playback cycle, including the transition between repetitions.
  • The stream is silent or audio is out of sync: Inspect whether the source has an audio track, whether the chosen audio encoder is available, and whether audio remains continuous through the loop. Validate with a private or unlisted test event.

Google Cloud cost considerations

Google Cloud’s VPC pricing information lists transfer from Compute Engine to certain Google products, including YouTube, as no charge. That is a narrow network-transfer pricing statement, not a total-cost estimate. VM runtime, boot disk and media storage, address choices, taxes, and other services can affect the bill. Check the pricing calculator and current terms for your region and configuration before leaving a VM running.

Or let it run in the cloud

If your goal is simply to keep prerecorded video live on YouTube, StreamNeo is a separate cloud service that avoids maintaining your own encoder VM. Upload a recording or build a playlist, add your YouTube stream key once, and go live. It loops uploaded videos from the cloud, so nothing has to stay on at home; it does not broadcast from a camera.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Each slot streams the uploaded quality as provided, 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. One free day is available per account.
  • Monthly billing is $9.99 per month; day, week, six-month, and yearly terms are also available.

See StreamNeo or the plan details. To try it, start your free first 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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.

Read next

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.