To loop a local video as a 4K 60fps YouTube Live stream, use FFmpeg’s -stream_loop -1 to repeat the input and -re to pace file playback in real time. Then encode to 3840×2160 at 60 fps, use a two-second keyframe interval, and send the output to the ingest URL and stream key for your YouTube Live event. The command below is an adaptable SDR H.264 template—not a guarantee that a particular computer or connection can sustain the stream.
FFmpeg command for a looping 4K 60fps stream
This template assumes a local video file with an audio stream, an FFmpeg build that includes libx264, and a standard SDR output. Replace the filename and the event-specific ingest URL and stream key. Do not publish or share a real stream key.
ffmpeg -re -stream_loop -1 -i "input.mp4"
-map 0:v:0 -map 0:a:0?
-vf "scale=3840:2160:force_original_aspect_ratio=decrease,pad=3840:2160:(ow-iw)/2:(oh-ih)/2"
-r 60 -c:v libx264 -pix_fmt yuv420p -preset veryfast
-b:v 50M -maxrate 50M -bufsize 100M -x264-params "nal-hrd=cbr"
-g 120 -keyint_min 120 -sc_threshold 0
-c:a aac -b:a 128k -ar 44100
-f flv "<YOUTUBE_INGEST_URL>/<STREAM_KEY>"
The final argument is a placeholder, not a URL to copy. Use the RTMPS ingest URL shown for your event if your FFmpeg build and FLV workflow support it; test that endpoint before relying on it. YouTube’s API describes the combined form as STREAM_URL/STREAM_NAME. Keep the stream key private.
What the important options do
-rereads the file at its playback rate so a prerecorded input is delivered like a live feed rather than as fast as FFmpeg can process it.-stream_loop -1, placed before the input, asks FFmpeg to repeat the file indefinitely. Looping and real-time pacing are separate jobs: the loop option alone does not make file playback a live-rate stream.-map 0:v:0 -map 0:a:0?selects the first video stream and optionally maps the first audio stream. The question mark makes audio mapping optional at this stage; it does not make an audio-free stream suitable for YouTube.- The scale-and-pad filter fits the picture inside a 3840×2160 frame while preserving its aspect ratio. Depending on the source shape, this can add bars. Check the result; it does not crop the picture to fill the frame.
-r 60requests 60 output frames per second. If the source has a different frame rate, frames may be duplicated or converted. Check whether that result is acceptable and verify the outgoing resolution and frame rate in Live Control Room.-b:vand-maxrateset the video target and ceiling in this template;-bufsizesets the rate-control buffer. Thenal-hrd=cbrsetting requests CBR behavior from x264. YouTube recommends CBR for live ingestion.-g 120 -keyint_min 120 -sc_threshold 0configures a fixed 120-frame keyframe interval. At 60 fps, 120 frames is two seconds.- The audio options encode AAC stereo-style audio at 128 kbps and 44.1 kHz. Confirm that the input has audio and that the output contains exactly one supported audio stream.
Check the source file and FFmpeg build first
- Confirm that
input.mp4exists at the path you provide and contains the intended video and audio. If the source has no audio, supply a suitable audio input and map it deliberately; YouTube reports a missing audio stream as an ingestion problem. - Confirm your FFmpeg build supports
libx264. If it does not, this command will fail at encoder initialization. Select an encoder available in your build and adapt the options to that encoder rather than assuming x264-specific settings will work unchanged. - Choose a preset that your actual machine can encode in real time at 4K/60.
veryfastis only a starting point; it does not guarantee that the hardware can keep up. Watch FFmpeg’s reported processing speed during a test. - Check the filter output for your source’s aspect ratio and inspect it in Live Control Room. The filter creates a 16:9 canvas, which may add letterboxing or pillarboxing.
Bitrate, keyframes, codec, and audio settings
The English YouTube Help page accessed on October 3, 2026 lists these recommended video bitrates for live ingestion. The page’s figures differ from a localized search result for 4K/60 H.264, so verify the values currently shown for your event in Live Control Room rather than combining the tables.
#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.
| Ingest format | Minimum video bitrate | Recommended video bitrate |
|---|---|---|
| 2160p (4K), 60 fps, H.264 | 14 Mbps | 50 Mbps |
| 2160p (4K), 60 fps, H.265 or AV1 | 10 Mbps | 35 Mbps |
| 2160p (4K), 30 fps, H.264 | 11 Mbps | 42 Mbps |
| 2160p (4K), 30 fps, H.265 or AV1 | 8 Mbps | 30 Mbps |
For this template, 50 Mbps is YouTube’s listed H.264 recommendation for 4K/60 on that page, not a promise of quality or uninterrupted delivery. Your upload connection needs to sustain the video bitrate plus audio and transport overhead; the reviewed guidance does not specify an overhead margin. Run an upload-speed test and monitor stream health.
- YouTube lists RTMP/RTMPS ingestion, H.264, H.265, and AV1, with frame rates up to 60 fps. Use a codec your FFmpeg build and encoding hardware can sustain at the target resolution and frame rate.
- YouTube recommends a two-second keyframe interval and sets a maximum of four seconds. At 60 fps, the two-second interval in the example is 120 frames; at 30 fps it would be 60 frames.
- For stereo audio, the listed settings are AAC or MP3, 128 kbps, and a 44.1 kHz sample rate. The example uses AAC.
- For SDR, YouTube recommends Rec. 709 and 8-bit video. The template sets
yuv420pbut does not explicitly set color metadata; verify the source’s color characteristics and the output rather than assuming the pixel format alone establishes them. - YouTube’s page recommends H.265 for HDR and says AV1 is not supported for HDR. This command is an SDR H.264 example, not an HDR workflow.
- YouTube says its low-latency improvement option is unavailable for 4K streams, which use normal latency.
Connect FFmpeg to the correct YouTube Live event
- Open the intended event in YouTube Live Control Room and obtain that event’s ingest URL and stream key. Do not substitute a key from another event or expose the key in a public post, screenshot, or shared command.
- Replace
<YOUTUBE_INGEST_URL>/<STREAM_KEY>with the event’s assigned endpoint and key in the command. Use the RTMPS endpoint if available and supported by your chosen FFmpeg workflow. - Start FFmpeg, then check Live Control Room for the incoming picture, audio, resolution, frame rate, and stream-health messages. A running FFmpeg process by itself does not prove YouTube is receiving a healthy stream.
- Test with representative picture movement and audio before depending on the stream. YouTube specifically advises testing before starting a live stream.
Troubleshoot common failures
| Symptom | Likely check | What to do |
|---|---|---|
| FFmpeg reports an unknown encoder or fails to initialize x264 | The local build may not include libx264. |
Use a build with that encoder or adapt the command to an encoder available on the machine. Confirm any encoder-specific rate-control and keyframe options. |
| YouTube reports no audio | The input may be silent or lack an audio stream; optional mapping does not create audio. | Provide a suitable audio source, map it intentionally, and verify exactly one supported audio stream reaches YouTube. |
| Stream health reports starvation or the picture falls behind | The machine may not encode 4K/60 in real time, or upload capacity may not sustain the output. | Check FFmpeg’s reported speed, run an upload test, and monitor YouTube’s health feedback. Reduce the target or change the encoding setup if the system cannot keep pace. |
| YouTube rejects the video or reports an unsupported format | Codec, container, resolution, frame rate, or keyframe interval may not match the selected ingest requirements. | Check the event’s current settings and YouTube health messages. Confirm the outgoing stream is 3840×2160 at the intended frame rate and that keyframes are no more than four seconds apart. |
| FFmpeg continues running but the event is offline | The endpoint or stream key may be wrong, or YouTube may have dropped ingestion. | Recheck the URL and key for that event, then use Live Control Room’s status and health messages to identify the issue. Do not infer success from the local process alone. |
| Picture has bars or looks stretched | The source aspect ratio may not match the 16:9 output canvas. | Inspect the scale-and-pad result and decide whether bars are acceptable. Do not remove the padding without checking whether that would crop important content. |
Keep a 24/7 stream running: FFmpeg or cloud hosting
With FFmpeg, the computer running the process and its network connection must remain available, and the machine must sustain real-time encoding if it is doing the encode locally. A community example documents the loop pattern, but it is not a guarantee that a particular server or workstation will stay live; the right capacity depends on your setup.
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.
Or let it run in the cloud
- Upload a recording or build a playlist.
- Add your YouTube stream key once.
- Go live; StreamNeo loops the uploaded videos from the cloud, so your computer and home connection do not have to stay on.
StreamNeo is a YouTube-only cloud service for uploaded videos, not camera streaming. Every slot streams the uploaded file as made, up to 4K 60fps, at one flat price per slot with no re-encoding or quality tiers; it includes 10 GB of storage per slot, pooled across active slots, 24/7 looping and playlists, automatic recovery if YouTube drops the stream, and StreamNeo team support. The first day is free with no card (one free day per account). Monthly service is $9.99 per month. Shorter and longer billing periods are also available, and plans differ by billing length, not features. See StreamNeo; start the free day at StreamNeo registration.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Copyright and YouTube policy checks for prerecorded loops
Before looping a recording, make sure you have the rights needed to stream its video and audio on YouTube. Repeating a file through FFmpeg does not change its ownership or grant permission. YouTube’s live stream health and copyright checks are separate from whether FFmpeg successfully sends data; review any notices in YouTube Studio and resolve rights issues before relying on a continuous broadcast.
Quick Recap
Best 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.
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
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.
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.

