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

To loop a local 4K 60fps SDR video to YouTube Live with an NVIDIA GPU, use FFmpeg’s -stream_loop -1 to repeat the file and -re to feed it at real-time speed. This H.264/NVENC command is a starting point aligned with YouTube’s listed 2160p60 recommendations; it does not upscale a lower-resolution source or guarantee that a particular GPU, file, FFmpeg build, or network can sustain the stream.

FFmpeg command for a 4K60 YouTube Live loop

Replace the final RTMPS address with the ingest URL and stream key shown in YouTube Live Control Room. Keep the stream key private.

ffmpeg -re -stream_loop -1 -i "input.mp4" 
  -map 0:v:0 -map 0:a:0? 
  -c:v h264_nvenc -preset p5 -rc cbr 
  -b:v 50M -maxrate 50M -bufsize 100M 
  -g 120 -bf 2 
  -c:a aac -b:a 128k -ar 44100 
  -f flv "rtmps://YOUR_INGEST_URL/YOUR_STREAM_KEY"

The command assumes the input is already 3840×2160 at 60 fps, has audio or can be streamed without it, and is suitable for an SDR H.264 stream. It encodes with NVIDIA NVENC; it does not convert an arbitrary video into 4K60.

What the important options do

  • -re reads the file at its native frame rate so it is paced like a live stream rather than sent as fast as FFmpeg can process it.
  • -stream_loop -1 repeats the input indefinitely. These are input options and must appear before -i.
  • -map 0:v:0 -map 0:a:0? selects the first video stream and, if present, the first audio stream. Change the mapping if your file’s streams differ.
  • -c:v h264_nvenc selects NVIDIA’s hardware H.264 encoder. The installed GPU and FFmpeg build must support it.
  • -rc cbr selects constant-bitrate rate control. -b:v 50M and -maxrate 50M set the target and maximum video bitrate; -bufsize 100M sets the rate-control buffer.
  • -g 120 sets a 120-frame GOP, equal to two seconds at 60 fps. -bf 2 requests two B-frames.
  • -c:a aac -b:a 128k -ar 44100 encodes audio as AAC at 128 Kbps and 44.1 kHz.
  • -f flv uses the FLV output format used for RTMP(S) streaming.

Check the source, GPU, and connection first

Inspect the video and audio

Confirm the file’s dimensions, frame rate, audio stream, pixel format, and SDR or HDR characteristics with a media probe before choosing an encoding path. A file without an audio stream is allowed by the optional audio mapping, but verify that the resulting stream behaves as intended. A loop repeats any visible or audible jump at the end-to-start boundary; use a source with a clean transition if that matters.

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.
#1 Best Overall
Sale
ASUS Dual GeForce RTX 5060 Ti 16GB GDDR7 OC Edition Gaming Graphics Card
  • AI Performance: 767 AI TOPS
  • OC mode: 2632 MHz (OC mode)/ 2602 MHz (Default mode)
  • Powered by the NVIDIA Blackwell architecture and DLSS 4
  • Axial-tech fan design features a smaller fan hub that facilitates longer blades and a barrier ring that increases downward air pressure
  • A 2.5-slot design maximizes compatibility and cooling efficiency for superior performance in small chassis

Confirm NVENC support and real-time capacity

NVENC is NVIDIA’s hardware-based encoder, but supported codecs, profiles, bit depth, dimensions, frame rate, and performance depend on the exact GPU. Check the installed FFmpeg encoder options with ffmpeg -h encoder=h264_nvenc and confirm the GPU can sustain the desired 4K60 encode. Seeing the encoder listed does not establish that it can maintain real-time performance for your workload. See NVIDIA’s NVENC application note and NVIDIA’s FFmpeg guide.

Allow network headroom

Make sure stable upload capacity exceeds the total stream bitrate with room for audio and protocol overhead. YouTube’s recommended video bitrate is not the full amount of network traffic the stream requires.

Rank #2
GIGABYTE GeForce RTX 5070 Ti Gaming OC 16G Graphics Card, 16GB 256-bit GDDR7, PCIe 5.0, WINDFORCE Cooling System, GV-N507TGAMING OC-16GD Video Card
  • Powered by the NVIDIA Blackwell architecture and DLSS 4
  • Powered by GeForce RTX 5070 Ti
  • Integrated with 16GB GDDR7 256bit memory interface
  • PCIe 5.0
  • WINDFORCE cooling system

Match YouTube’s ingest settings

YouTube Help’s current encoder recommendations, checked on 2026-10-03, list the following 2160p60 video bitrates; the retrieved page does not state a publication year:

Codec YouTube-listed 2160p60 video bitrate Practical note
H.264 50 Mbps Used by the command above.
AV1 or H.265/HEVC 35 Mbps Requires a compatible encoder and end-to-end setup.

YouTube also lists CBR, frame rates up to 60 fps, a recommended two-second keyframe interval (do not exceed four seconds), AAC or MP3 audio, and RTMP/RTMPS transport. For stereo audio, it lists 128 Kbps and 44.1 kHz. Its advanced settings include progressive scan, two B-frames, one reference frame, square pixels, and Rec. 709 for SDR. Consult YouTube’s encoder recommendations when configuring a different codec or format.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
ASUS TUF Gaming GeForce RTX™ 5080 16GB GDDR7 OC Edition Graphics Card
  • Powered by the NVIDIA Blackwell architecture and DLSS 4. System Requirements: Minimum 850W PSU with 16-pin 12V-2x6 (12VHPWR) connector required. Verify before purchasing.
  • Military-grade components deliver rock-solid power and longer lifespan for ultimate durability. Compatibility: 348mm (13.7") length, 3.6 slots, 4.3 lbs. Confirm case clearance and slot spacing. GPU bracket included.
  • Protective PCB coating helps protect against short circuits caused by moisture, dust, or debris
  • 3.6-slot design with massive fin array optimized for airflow from three Axial-tech fans
  • Phase-change GPU thermal pad helps ensure optimal thermal performance and longevity, outlasting traditional thermal paste for graphics cards under heavy loads

Use RTMPS and test before relying on the stream

YouTube recommends RTMPS, a secure extension to RTMP. For a 4K/2160 stream, YouTube sets normal latency; its low-latency option is unavailable at that resolution. Start a test with representative movement and audio, then check YouTube’s stream health before depending on an unattended run.

HDR and alternate codecs need a different setup

The command above is for an SDR H.264 path. YouTube recommends H.265/HEVC over RTMP(S) for HDR, with 10-bit HDR and the appropriate HDR color metadata. Do not apply the SDR command unchanged to HDR footage: verify support across the source, GPU, FFmpeg build, and YouTube ingest, and preserve or set the source’s color characteristics correctly. AV1 is not supported for HDR in YouTube’s listed settings. The best codec depends on the footage and compatible hardware; the available guidance does not establish one universally best choice.

Rank #4
Sale
GIGABYTE GeForce RTX 5060 WINDFORCE OC 8G Graphics Card, Cooling System, 8GB 128-bit GDDR7, PCIe 5.0, Manufactured by NVIDIA, DisplayPort & HDMI - Video Output Interface, GV-N5060WF2OC-8GD Video Card
  • Powered by the NVIDIA Blackwell architecture and DLSS 4
  • Powered by GeForce RTX 5060
  • Integrated with 8GB GDDR7 128bit memory interface
  • PCIe 5.0
  • WINDFORCE cooling system

Troubleshoot a failed or unstable loop

  • FFmpeg cannot find h264_nvenc or fails to initialize it: check that the FFmpeg build includes the encoder, the NVIDIA driver and GPU are available, and the GPU supports the input format and target encode. Review ffmpeg -h encoder=h264_nvenc.
  • YouTube does not receive the stream: verify the ingest address and stream key in Live Control Room, confirm outbound connectivity and firewall rules, and check network stability. Do not expose the stream key in logs or public posts.
  • The stream reports health or bitrate problems: check sustained upload capacity against video, audio, and protocol needs; confirm the selected bitrate and encoding settings; and monitor YouTube’s stream health during a test.
  • There is no audio: inspect the file’s audio streams and revise the mapping if the intended audio is not the first stream. If the source has no audio, the optional map does not create any.
  • The loop has a click, silence, or visual jump: inspect the file’s end and beginning. FFmpeg repeats the source; it does not make a discontinuous edit seamless.
  • Frames or timestamps behave unexpectedly: confirm the source’s timestamps and formats are acceptable and that the input is a file. The real-time pacing flag is appropriate here because the input is a file; FFmpeg cautions against careless read-rate limiting of actual capture or live inputs because it can cause packet loss.

Or let it run in the cloud

If you want a YouTube channel to keep looping uploaded videos without leaving a PC or home connection on, StreamNeo runs the stream from the cloud. Upload a recording or build a playlist, add your YouTube stream key once, and go live. It plays uploaded videos, not a camera feed.

  • Nothing has to stay on at home; StreamNeo automatically recovers if YouTube drops the stream.
  • Each slot streams the upload as made, up to 4K 60fps, at one flat price per slot with no re-encode or quality tiers.
  • The first day is free with no card (one free day per account). The Monthly price is $9.99 per month.

Start your free day with StreamNeo.

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

Frequently Asked Questions

Does this command turn a 30 fps or 1080p file into 4K 60fps?

No. It assumes the input is already 4K60; it does not upscale or convert an arbitrary source.

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

Quick Recap

SaleBestseller No. 1
ASUS Dual GeForce RTX 5060 Ti 16GB GDDR7 OC Edition Gaming Graphics Card
ASUS Dual GeForce RTX 5060 Ti 16GB GDDR7 OC Edition Gaming Graphics Card
AI Performance: 767 AI TOPS; OC mode: 2632 MHz (OC mode)/ 2602 MHz (Default mode); Powered by the NVIDIA Blackwell architecture and DLSS 4
$794.37
Bestseller No. 2
GIGABYTE GeForce RTX 5070 Ti Gaming OC 16G Graphics Card, 16GB 256-bit GDDR7, PCIe 5.0, WINDFORCE Cooling System, GV-N507TGAMING OC-16GD Video Card
GIGABYTE GeForce RTX 5070 Ti Gaming OC 16G Graphics Card, 16GB 256-bit GDDR7, PCIe 5.0, WINDFORCE Cooling System, GV-N507TGAMING OC-16GD Video Card
Powered by the NVIDIA Blackwell architecture and DLSS 4; Powered by GeForce RTX 5070 Ti; Integrated with 16GB GDDR7 256bit memory interface
$1,174.99
Bestseller No. 3
ASUS TUF Gaming GeForce RTX™ 5080 16GB GDDR7 OC Edition Graphics Card
ASUS TUF Gaming GeForce RTX™ 5080 16GB GDDR7 OC Edition Graphics Card
3.6-slot design with massive fin array optimized for airflow from three Axial-tech fans; Auto-Extreme precision automated manufacturing helps ensure higher reliability
$1,831.31
SaleBestseller No. 4
GIGABYTE GeForce RTX 5060 WINDFORCE OC 8G Graphics Card, Cooling System, 8GB 128-bit GDDR7, PCIe 5.0, Manufactured by NVIDIA, DisplayPort & HDMI - Video Output Interface, GV-N5060WF2OC-8GD Video Card
GIGABYTE GeForce RTX 5060 WINDFORCE OC 8G Graphics Card, Cooling System, 8GB 128-bit GDDR7, PCIe 5.0, Manufactured by NVIDIA, DisplayPort & HDMI - Video Output Interface, GV-N5060WF2OC-8GD Video Card
Powered by the NVIDIA Blackwell architecture and DLSS 4; Powered by GeForce RTX 5060; Integrated with 8GB GDDR7 128bit memory interface
$459.99
Bestseller No. 5
ASUS TUF Gaming GeForce RTX 5070 12GB GDDR7 OC EditionGaming Graphics Card
ASUS TUF Gaming GeForce RTX 5070 12GB GDDR7 OC EditionGaming Graphics Card
3.125-slot design with massive fin array optimized for airflow from three Axial-tech fans; Auto-Extreme precision automated manufacturing helps ensure higher reliability
$937.39
Best Value
ASUS TUF Gaming GeForce RTX 5070 12GB GDDR7 OC EditionGaming Graphics Card
  • Powered by the NVIDIA Blackwell architecture and DLSS 4 OC mode: 2640MHz/Default mode: 2610MHz (Boost Clock)
  • Military-grade components deliver rock-solid power and longer lifespan for ultimate durability
  • Protective PCB coating helps protect against short circuits caused by moisture, dust, or debris
  • 3.125-slot design with massive fin array optimized for airflow from three Axial-tech fans
  • Phase-change GPU thermal pad helps ensure optimal thermal performance and longevity, outlasting traditional thermal paste for graphics cards under heavy loads

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.