To stream a Google Drive video to YouTube with FFmpeg on a VPS, first download the file to the server using authorized Google Drive access, then send it to YouTube Live using the RTMPS address and stream key from YouTube Studio. A shared Drive link is not a dependable substitute for an authenticated download. The workflow is Drive → VPS storage → FFmpeg → YouTube Live.
What you need before you start
- A raw video file in Google Drive that your account is permitted to download. Workspace documents such as Google Slides or Docs need exporting rather than a raw-video download.
- A VPS with enough disk space for the source file, outbound bandwidth for the stream, and CPU capacity if FFmpeg must encode the video.
- FFmpeg installed on the VPS.
- A YouTube channel enabled for live streaming, plus its current RTMPS ingestion address and stream key from YouTube Live Control Room.
- Authorized Google credentials with a content-read scope. For Drive files, check that
capabilities.canDownloadis true; owners or shared-drive organizers can restrict downloads. See Google’s Drive download and export guide.
This is a direct FFmpeg workflow. Google Cloud’s Live Stream API is a separate managed service that processes inputs into HLS or DASH output; it is not a required component here. See the Live Stream API overview.
1. Download the Drive video to your VPS
For a raw video file (a Drive blob), Google’s documented API route is files.get with alt=media. Use the API with credentials authorized to read the file’s content. Google’s guide explains authorization and download restrictions, and provides a curl pattern; follow its current authentication instructions rather than copying an access token into a public command or script.
Do not assume a URL copied from Drive’s Share dialog can be passed to FFmpeg as a direct media URL. Share pages may require authentication, permissions, or browser handling. The documented and more predictable approach is to download the authorized file to VPS storage first.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
#1 Best Overall
- 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.
- Confirm the file is a video and that your account can download it.
- Use the Drive API download flow for that file ID, authenticated with a content-readable scope, and save the response to a path on the VPS.
- Check that the download completed and that the file is non-empty. Compare its size with the Drive file details when available.
- Run
ffprobe /path/to/video.mp4to inspect the container, video and audio codecs, dimensions, frame rate, and duration. If FFprobe cannot read it, resolve the download or file-format problem before starting the live stream.
Keep both Google credentials and the YouTube stream key out of shell history, shared logs, screenshots, and source code. Restrict permissions on any credential files and remove temporary credentials when they are no longer needed.
2. Get YouTube’s RTMPS address and stream key
In YouTube Studio, open Create → Go live and use the Live Control Room’s stream setup details. Copy the current server URL (RTMPS ingestion address) and stream key shown for the stream. YouTube recommends RTMPS, which it describes as a secure extension to RTMP. The YouTube Live Streaming API documentation also distinguishes the ingestion address from the stream name/key; use the values presented for your own channel rather than guessing an endpoint.
Treat the key as a password. Anyone who obtains it may be able to send a feed to your live event. If it is exposed, replace or reset it in YouTube Studio before streaming again.
3. Choose copy or transcode
Stream-copy when the existing media is suitable
Stream-copy passes the source audio and video streams through without re-encoding. It can reduce CPU use and avoid another lossy encode, but only use it when the source codecs, frame rate, timestamps, and container are compatible with YouTube’s ingestion requirements and your chosen output. A file extension alone does not establish compatibility. FFprobe can show the actual streams; YouTube’s encoder guidance is the authority for its recommended live settings.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #2
- 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.
Transcode when you need to change or standardize the output
Transcoding lets FFmpeg set a supported video codec, resolution, frame rate, bitrate, audio format, and keyframe interval. It consumes VPS CPU or hardware-encoder capacity, and a slow server may fail to encode in real time. Avoid upscaling a lower-resolution source merely to select a higher output resolution.
The examples below are command templates, not a tested guarantee for every file, FFmpeg build, or VPS. Replace the placeholders with the RTMPS URL and key from YouTube, and validate the resulting stream in your own environment.
4. Send the file to YouTube Live
Example: transcode to H.264 and AAC
For a 1080p30 output, a template is:
ffmpeg -re -i /path/to/video.mp4 -c:v libx264 -preset veryfast -b:v 14M -maxrate 14M -bufsize 28M -r 30 -g 60 -keyint_min 60 -sc_threshold 0 -c:a aac -b:a 128k -ar 44100 -f flv "RTMPS_URL/STREAM_KEY"
Replace RTMPS_URL and STREAM_KEY with the exact values provided by YouTube. Do not publish a command containing a real key. For a public VPS or multi-user system, avoid putting the key directly in a command that can be exposed through process listings or shell history; use an appropriately protected script or secret-handling method.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallRank #3
- 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.
The -re option paces file input approximately in real time instead of sending the entire file as fast as the disk can read it. The example’s 14 Mbps video bitrate corresponds to YouTube’s recommendation for H.264 1080p30; YouTube recommends 17 Mbps for H.264 1080p60. These are recommendations, not universal minimums. YouTube recommends CBR and a two-second keyframe interval, with a keyframe interval not exceeding four seconds. The example uses a two-second GOP at 30 fps. Consult YouTube’s current encoder settings, bitrates, and resolutions for the selected codec and frame rate; its table varies by profile.
Example: stream-copy compatible source streams
If your source streams are compatible and already meet the output requirements, you can try:
ffmpeg -re -i /path/to/video.mp4 -c copy -f flv "RTMPS_URL/STREAM_KEY"
This avoids encoding but does not correct an incompatible codec, bitrate, frame rate, timestamp issue, or keyframe cadence. If YouTube reports an ingestion or format problem, inspect the source with FFprobe and use a suitable transcode profile instead.
Rank #4
- 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
Loop the video
For continuous playback of one local file, place the input loop option before the input:
ffmpeg -re -stream_loop -1 -i /path/to/video.mp4 -c:v libx264 -preset veryfast -b:v 14M -maxrate 14M -bufsize 28M -r 30 -g 60 -keyint_min 60 -sc_threshold 0 -c:a aac -b:a 128k -ar 44100 -f flv "RTMPS_URL/STREAM_KEY"
Check that the file’s end-to-start transition is acceptable, including any abrupt audio cut. To stream a playlist, use FFmpeg’s concat demuxer with a correctly formatted file list and compatible inputs, or prepare a single joined file; test transitions before relying on it for a continuous broadcast.
5. Test and monitor the live stream
- Start the encoder with the YouTube event set up, then check the Live Control Room preview before making the event public or starting the broadcast for viewers.
- Use a representative section with movement and audio. Check picture, sound, synchronization, and transitions rather than judging only a static frame.
- Watch YouTube’s stream-health indicators and encoder messages while the VPS is sending. Check FFmpeg’s output for dropped frames, encoder overload, or connection errors.
- Confirm that the VPS can sustain the chosen output bitrate plus network overhead. A speed test or advertised VPS port speed does not guarantee sustained throughput to YouTube’s ingest endpoint.
- For a long or looping stream, monitor the VPS process and disk, and decide how you will restart FFmpeg if the process or network connection stops.
Settings and resource planning
Bitrate, resolution, and frame rate should reflect the source, YouTube’s profile recommendations, the VPS’s encoding capacity, and its sustained upload capacity. YouTube’s current guidance recommends H.264 1080p30 at 14 Mbps and H.264 1080p60 at 17 Mbps, alongside CBR and a two-second keyframe interval (not over four seconds). Do not extrapolate those example bitrates to other codecs or frame rates; check YouTube’s profile table.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsBest Value
- 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.
No particular VPS CPU, RAM, or network plan is guaranteed to handle a given file by these figures alone. Stream-copy places less encoding load on the VPS; transcoding requires enough processing capacity to encode at least as quickly as real time. Higher output bitrates also require more sustained upload bandwidth. Check the provider’s actual resource limits and test the selected file and profile before relying on the server for a long broadcast.
Troubleshooting
Drive returns an authorization error or the download is blocked
Verify that the credential belongs to an account with access to the file, has a content-read scope, and is being used for the correct file ID. Check capabilities.canDownload and ask the owner or shared-drive organizer to permit downloads if policy allows. A share link being viewable in a browser does not prove API download permission.
FFmpeg says the input is invalid or cannot find streams
Confirm the download finished and the path is correct, then inspect it with ffprobe. If the file is a Workspace document rather than a raw video blob, use the appropriate export path. A partial download or an unsupported/corrupt media file must be fixed before encoding.
YouTube does not receive the stream
Check the exact RTMPS server URL and key from the current Live Control Room setup, confirm the event is ready to receive an encoder, and look at FFmpeg’s connection error. If the key may have been exposed, reset it. Do not substitute a guessed endpoint.
YouTube reports poor stream health or buffering
Check for VPS upload congestion, encoder overload, and a bitrate beyond the network’s sustained capacity. Lower the output profile or bitrate if needed, or use stream-copy when the source is compatible and encoding load is the bottleneck. Recheck the chosen profile against YouTube’s current settings table.
The stream starts but audio, video, or looping is wrong
Inspect the actual streams with FFprobe. Confirm that an audio stream exists and that the selected encoding handles it; verify the source frame rate and GOP behavior if YouTube reports keyframe issues. Preview the file’s loop point and playlist transitions locally before leaving the stream unattended.
Or let it run in the cloud
If your goal is to keep a YouTube channel live with uploaded videos rather than manage an FFmpeg VPS, StreamNeo runs the looping stream from the cloud. Upload a recording or build a playlist, add your YouTube stream key once, and go live. Nothing has to stay on at home; the stream runs at the quality uploaded, up to 4K 60fps, for one flat price per slot. StreamNeo automatically recovers if YouTube drops the stream. The first day is free with no card required.
Quick Recap
Monthly: $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.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →




