You can keep a pre-recorded video streaming to YouTube from a Hetzner VPS by running FFmpeg in real time, sending its output to the broadcast’s RTMPS ingest address, and supervising the process so it can restart after failures. YouTube and Hetzner do not guarantee uninterrupted uptime: you still need to check the server’s traffic allowance, protect the stream key, monitor YouTube’s stream health, and test recovery.
What you need before starting
- A Hetzner Cloud server with outbound internet access and enough included traffic for your chosen bitrate.
- A video file available on the VPS, or another media input that FFmpeg can read.
- A YouTube channel with live streaming enabled and a broadcast created in YouTube Live Control Room.
- FFmpeg installed on the VPS, plus a way to supervise and monitor its process.
YouTube’s Live Control Room or Live Streaming API provides the ingest URL and stream key associated with a broadcast. Treat the key as a publishing credential: anyone who obtains it may be able to send video to that broadcast. For ingest, YouTube recommends RTMPS, its secure extension to RTMP. YouTube’s encoder settings and recommendations and Live Streaming API documentation describe the relevant setup.
Choose stream settings that fit your video and server
Use a resolution and frame rate appropriate to the source rather than enlarging a low-resolution file. YouTube’s current encoder guidance supports H.264, H.265, or AV1 video, up to 60 fps, and AAC or MP3 audio. It recommends constant bitrate (CBR) and a two-second keyframe interval; the recommended interval should not exceed four seconds. For a simple SDR stream, H.264 with AAC is a practical starting point.
| Output example | YouTube H.264 bitrate guidance | Two-second GOP example |
|---|---|---|
| 240p–720p at 30 fps | 4 Mbps | 60 frames at 30 fps |
| 1080p at 30 fps | 10 Mbps | 60 frames at 30 fps |
These are YouTube recommendations, not a promise that a particular VPS or source file will stream reliably. Match the bitrate to the selected resolution and frame rate, then make sure the VPS can sustain the outbound connection. Do not use the same bitrate automatically for different resolutions, frame rates, or codecs. YouTube’s current guidance is on its encoder settings page.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →#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.
Check Hetzner networking and estimate traffic
The stream travels outward from your VPS to YouTube, so its bitrate consumes Hetzner outbound traffic for as long as the stream runs. Hetzner’s Cloud traffic allowance varies by product and location. Its traffic page lists 20 TB per month for EU CX, CPX, and CAX Cloud Servers; US and Singapore allowances vary by plan, and excess traffic is charged in 100 MB blocks. Check the current terms for your specific server and region before choosing a bitrate. Hetzner’s traffic and billing information is the authoritative reference for allowances and overage terms.
A rough estimate is bitrate in megabits per second × broadcast hours, converted to data volume. At a sustained 1 Mbps, 30 days of continuous streaming is about 324 GB in decimal units before overhead. Add a margin for audio, protocol overhead, retries, updates, and any other server traffic; compare the result with the plan’s allowance.
Hetzner says Cloud bandwidth is not guaranteed. Its technical FAQ says customers can expect about 300–500 Mbit/s, with Cloud instances sharing the host’s 10 Gbit connection. That is expected host networking, not a per-instance speed guarantee. If you will transcode rather than pass through compatible media, also consider CPU needs: Hetzner distinguishes shared-resource and dedicated-resource plans. Measure actual CPU and network behavior on the server you select. See Hetzner’s Cloud server FAQ.
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.
The server needs a network interface capable of reaching the internet. If you use a Hetzner Cloud Firewall, review its egress rules so outbound connections to YouTube are not blocked. Hetzner documents Cloud networking and public Primary IP options in its Cloud documentation.
Create the YouTube broadcast and obtain its ingest details
- Open YouTube Live Control Room and create or select the broadcast you intend to use. You can also create broadcasts through the Live Streaming API; API setup includes ingestion type and stream URL fields.
- Copy the ingest URL and stream key shown for that broadcast. Confirm that they belong together and to the intended broadcast.
- Keep the key out of shell history, source control, public logs, and files readable by other users. Store it in a restricted configuration or environment file. Regenerate it if it is exposed.
- Before making the broadcast public, start the encoder and inspect the preview and YouTube stream-health diagnostics in Live Control Room.
Use RTMPS where the ingest details offer it. It protects the encoder-to-ingest connection in transit, but it does not make a leaked key safe. Limit SSH access to the server and keep its software updated.
Run FFmpeg in real time and loop a video
For an existing compatible file, FFmpeg can pace input in real time and loop it continuously. This illustrative command uses a 30 fps output, 4 Mbps video, AAC audio, and a 60-frame GOP (two seconds at 30 fps):
Rank #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.
ffmpeg -re -stream_loop -1 -i /path/to/video.mp4
-c:v libx264 -preset veryfast -b:v 4M -maxrate 4M -bufsize 8M
-r 30 -g 60 -c:a aac -b:a 128k
-f flv 'rtmps://INGEST_HOST/APP/STREAM_KEY'
Replace the endpoint placeholders with the exact ingest address and secret key provided for the broadcast. The example is a pattern, not a verified command for every FFmpeg build, account, or source; test it with your actual media. Choose a bitrate and output profile suited to the source and YouTube’s current guidance. A file that needs scaling, has unusual timestamps, or contains unsupported streams may need additional input or filter options.
FFmpeg’s -stream_loop -1 repeats the input indefinitely, while -re paces reading so the file is sent at real-time speed. The example encodes video with libx264; that uses CPU. A compatible source may allow a stream-copy approach, but do not assume every file can be passed through unchanged. Check FFmpeg’s output logs and YouTube’s preview to confirm the stream is actually arriving and playing.
Free tools Windows power users keep installed
One-click scans. No signup required.
Keep the process running and plan for recovery
A command in an SSH session is not a production supervisor. Run FFmpeg under a process manager such as systemd, using a dedicated unprivileged account and a configuration file with appropriately restricted permissions. Configure restart-on-failure behavior, but do not treat it as proof that every interruption will recover cleanly.
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
Monitor the FFmpeg process and logs, CPU and memory use, outbound traffic, source-file availability, and YouTube’s stream-health status. Test what happens when the network connection drops, FFmpeg exits, the server restarts, or the media file becomes unavailable. Confirm that a restart reconnects to the intended broadcast and that YouTube accepts the resumed feed. Restart behavior depends on the selected command, source, and server and should be tested rather than assumed.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Rights, channel policies, and continuity limits
A working encoder does not establish permission to broadcast the video, music, artwork, or other material in your loop. Confirm that you have the rights needed for continuous streaming and review YouTube’s current live-streaming, copyright, and channel policies for your content. A 24/7 format does not itself guarantee monetization or eligibility, and the applicable rules may depend on the channel and material.
Even with a supervisor and automatic process restarts, a continuous stream can be interrupted by source, software, network, server, or platform issues. Hetzner does not guarantee Cloud bandwidth, and YouTube’s ingest acceptance is not a guarantee of uninterrupted playback.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteBest 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.
Common problems and what to check
| Symptom | Likely checks |
|---|---|
| YouTube shows no incoming stream | Verify that the ingest URL and key match the selected broadcast, that the key has not been revoked, and that the VPS can make outbound connections. Check firewall egress rules and FFmpeg logs. |
| YouTube reports unstable stream health | Check sustained outbound capacity, server load, and packet or connection problems. Confirm that bitrate fits the chosen output and the VPS plan’s actual conditions; Hetzner’s expected Cloud networking is not a per-instance guarantee. |
| Video appears at the wrong frame rate or resolution | Inspect the source and FFmpeg output settings. Make sure the chosen output profile is intentional and that the bitrate is appropriate for it. |
| Audio is missing or out of sync | Check whether the file contains an audio stream and review FFmpeg’s audio mapping and encoding logs. Confirm the broadcast preview before going public. |
| FFmpeg stops after a disconnect or reboot | Check supervisor status and logs, restart policy, source-file access, and server network connectivity. Reproduce the failure and verify recovery rather than relying on an untested restart configuration. |
| Traffic allowance may be exceeded | Recalculate monthly egress from the sustained bitrate and hours, include overhead and other usage, then compare with the current region- and plan-specific Hetzner allowance and excess-traffic terms. |
Or let it run in the cloud
StreamNeo is an alternative if you do not want to manage a VPS, FFmpeg, or recovery configuration. Upload a recording or build a playlist, add your YouTube stream key once, and go live; StreamNeo loops uploaded video from the cloud, so your computer and home connection do not have to stay on. It streams to YouTube, not from a camera or to other platforms.
- Nothing has to stay on at home; the stream runs in the cloud.
- Uploaded quality is preserved up to 4K 60fps at one flat price per slot, without re-encoding 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).
Monthly: $9.99 per month. See StreamNeo for details, then start your free day.
Quick Recap
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.




