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

To loop a local video into YouTube Live with an NVIDIA GPU, use FFmpeg’s h264_nvenc encoder and -stream_loop -1. The command below is an adaptable template, not a tested recipe: it assumes 1080p30 input, and its bitrate must be changed to match your intended output and YouTube’s current guidance.

FFmpeg command to loop a video to YouTube Live

ffmpeg -re -stream_loop -1 -i input.mp4 
  -c:v h264_nvenc -preset p4 
  -rc cbr -b:v 14M -maxrate 14M -bufsize 14M 
  -g 60 
  -c:a aac -b:a 128k -ar 44100 
  -f flv "rtmps://a.rtmp.youtube.com:443/live2/STREAM_KEY"

Replace input.mp4 with the local video path and STREAM_KEY with the key for your YouTube broadcast. Keep the key private. The example uses 14 Mbps as YouTube’s recommended H.264 bitrate for 1080p30 and a 60-frame GOP, which is two seconds at 30 fps. If your output resolution or frame rate differs, change the bitrate and GOP to match the applicable settings below. YouTube recommends RTMPS for encrypted transport.

The template’s settings are starting points, not a guarantee that your GPU, driver, operating system, FFmpeg build and source file will work together. Check encoder availability and test the ingest in YouTube Live Control Room before relying on a long-running stream.

What the command options do

Option Purpose What to check
-re Reads the file at its native playback rate rather than sending it as fast as possible. Useful for simulating a live feed from a local recording.
-stream_loop -1 Repeats the input indefinitely. It appears before the input it applies to. This example loops one file; multiple-file playlists and seamless transitions require different input construction.
-i input.mp4 Selects the local source video. Use a valid path and a file FFmpeg can read.
-c:v h264_nvenc Selects NVIDIA’s hardware H.264 encoder. Your GPU and FFmpeg build both need to support and expose NVENC.
-preset p4 Chooses an NVENC preset. Available options can vary with FFmpeg build and version; inspect the encoder help for your installation.
-rc cbr Requests constant bitrate rate control. YouTube’s published ingest guidance calls for CBR.
-b:v, -maxrate, -bufsize Set target bitrate, maximum rate and rate-control buffer. The template sets them equally; do not treat that bitrate as universal.
-g 60 Sets GOP length in frames, controlling the interval between keyframes. Calculate frames for about two seconds at your output frame rate; YouTube’s maximum keyframe interval is four seconds.
-c:a aac -b:a 128k -ar 44100 Encodes stereo audio as AAC at 128 Kbps and 44.1 kHz. These are the stereo AAC values in YouTube’s published guidance.
-f flv Uses the FLV container for the RTMP-family live output. The destination in this example is YouTube’s RTMPS ingest endpoint.

Check FFmpeg and NVIDIA encoder availability

  1. In a terminal, run ffmpeg -encoders and look for h264_nvenc. FFmpeg options depend on the installed build and version. See the FFmpeg documentation.

    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.
  2. Inspect encoder-specific options with ffmpeg -h encoder=h264_nvenc. Confirm that the options used by your command are recognized.

  3. Confirm that the NVIDIA GPU supports NVENC. NVIDIA describes NVENC as a hardware encoder in supported GPUs, independent of the graphics and CUDA cores; the sources do not identify one GPU model that is required for this command. See NVIDIA’s NVENC Application Note.

    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.

NVIDIA’s FFmpeg with NVIDIA GPU Hardware Acceleration guide documents the h264_nvenc encoder. Its examples demonstrate file-to-file transcoding; a live broadcast also needs an appropriate live input and destination.

Choose the right bitrate and keyframe interval

Use the row matching your intended ingest resolution, frame rate and codec. The following H.264 recommendations are from YouTube Help’s current settings page, accessed October 3, 2026. They are platform recommendations, not independent quality measurements.

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.
H.264 output YouTube recommended bitrate YouTube minimum bitrate Two-second GOP length
720p30 8 Mbps 3 Mbps 60 frames
720p60 8 Mbps 3 Mbps 120 frames
1080p30 14 Mbps 5 Mbps 60 frames
1080p60 17 Mbps 6 Mbps 120 frames
1440p30 21 Mbps 7 Mbps 60 frames
1440p60 34 Mbps 8 Mbps 120 frames
2160p30 42 Mbps 11 Mbps 60 frames
2160p60 50 Mbps 14 Mbps 120 frames

The GOP values in the last column are calculated for a two-second interval: multiply the output frame rate by two. For a frame rate other than 30 or 60 fps, set -g accordingly. YouTube recommends two-second keyframes and sets a maximum interval of four seconds. Confirm the current settings on YouTube’s encoder settings and bitrate page before a broadcast, since platform guidance can change.

NVIDIA’s streaming guidance uses CBR and shows equal -b:v, -maxrate and -bufsize for a one-second buffer. Its separate low-latency guidance describes a one-frame buffer, calculated as bitrate divided by frame rate. These are different buffer choices with different latency trade-offs; the template uses the one-second-style equal-value configuration rather than combining them.

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
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Start the YouTube broadcast and send the stream

  1. In YouTube Live Control Room, create or open the broadcast and copy its stream key. The exact interface labels may change; use the key associated with the broadcast you intend to test.

  2. Set the output resolution and frame rate to the values you have chosen, then select the corresponding bitrate and GOP values in the command. The source file’s properties and the encoded output are not necessarily identical, so verify the incoming stream in YouTube before depending on it.

    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.
    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.
  3. Run the command from a terminal where FFmpeg can access the input file. Watch FFmpeg’s output for encoding or connection errors, and check Live Control Room for the incoming preview and stream status.

  4. When ready to end the broadcast, stop FFmpeg with Ctrl+C, then end the stream in YouTube if the control room still shows it as live.

Troubleshooting common failures

Symptom Likely area to check What to do
Unknown encoder 'h264_nvenc' or encoder unavailable FFmpeg build or supported NVIDIA hardware Run ffmpeg -encoders and ffmpeg -h encoder=h264_nvenc. Confirm GPU support before changing unrelated command options.
FFmpeg connects poorly or YouTube does not show an incoming stream Ingest URL, key or broadcast selection Check that the endpoint and key belong to the active YouTube broadcast, and ensure there are no accidental spaces or truncated characters. Keep the key private.
YouTube flags or rejects stream settings Codec, CBR, resolution/frame rate, bitrate, audio or keyframes Compare the actual incoming settings with YouTube’s current guidance. Select the bitrate row for the intended resolution, frame rate and codec; verify AAC stereo at 44.1 kHz and 128 Kbps and a keyframe interval within YouTube’s limits.
Loop stops or output is not the expected playlist Input construction -stream_loop -1 applies to the one input shown. A set of files, playlist, or transition-free sequence needs a different FFmpeg input arrangement; this single-file template does not establish one.
Stream starts locally but is unreliable over time End-to-end hardware, driver, OS, build, source and network combination Test the exact combination in a short broadcast and review both FFmpeg logs and Live Control Room status before using it for a long-running stream. The command alone cannot establish compatibility or continuity.

Copyright and repeated-video considerations

A successful FFmpeg connection does not grant rights to the video or audio. Use material you own or are authorized to stream, and check YouTube’s applicable copyright rules and monetization policies before looping a recording. Repeating the same file also means repeating its audio and visuals; a technically continuous stream is not, by itself, evidence that content complies with YouTube policies.

Or let it run in the cloud

If your goal is to keep uploaded recordings live on YouTube without leaving a computer running at home, StreamNeo is a cloud alternative. Upload a recording or build a playlist, add your YouTube stream key once, and go live. StreamNeo loops uploaded videos from the cloud; it does not broadcast from a camera and streams to YouTube only.

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.
  • Nothing has to stay on at home: the stream runs from the cloud.
  • Every slot is one flat price for any quality up to 4K 60fps, as uploaded, with no re-encode or quality tiers.
  • Automatic recovery is included if YouTube drops the stream.
  • The first day is free with no card, one free day per account.
  • Monthly: $9.99 per month.

Each slot includes one always-on stream, 10 GB storage per slot pooled across active slots, 24/7 looping and playlists, automatic recovery if YouTube drops, and StreamNeo team support. The same product is included on every plan; only the billing length changes. UPI and cards are accepted in India; card checkout is available worldwide. For five or more slots, contact support. See StreamNeo pricing for the available billing lengths.

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.