October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
DocumentaryTube
Admit one · Blog

FFmpeg Command to Loop 4K 60fps Video to YouTube Live with NVENC

A practical FFmpeg command for looping a 4K60 SDR video to YouTube Live with NVENC, plus YouTube ingest settings, hardware checks and fixes for common problems.
Opened Runtime5 min Written byDocumentaryTube Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To loop a local 3840×2160, 60 fps SDR video to YouTube Live with an NVIDIA GPU, use FFmpeg’s -stream_loop -1 to repeat the file and -re to read it in real time. This H.264/NVENC command is a starting point; check your source, GPU, network and YouTube stream health before relying on it.

FFmpeg command for a 4K60 SDR file

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"
  1. Replace input.mp4 with the path to your video.
  2. In YouTube Live Control Room, copy the ingest address and stream key into the final RTMPS URL. Keep the key private; anyone with it may be able to broadcast to your channel.
  3. Run the command in a terminal on a computer with a compatible NVIDIA GPU and an FFmpeg build that includes h264_nvenc.

The command assumes the input is already 3840Ă—2160 at 60 fps, has audio, and is suitable for an SDR H.264 stream. It does not upscale or convert a different source to 4K60.

What the options do

  • -re reads the file at its native frame rate, pacing file playback in real time rather than sending it as fast as possible. -stream_loop -1 repeats the input indefinitely. Both are input options, so they belong before -i. See the FFmpeg documentation.
  • -map 0:v:0 selects the first video stream. -map 0:a:0? selects the first audio stream if one exists; the question mark makes that mapping optional. Change the mapping if your file’s streams differ.
  • -c:v h264_nvenc selects NVIDIA’s hardware H.264 encoder. -preset p5 and -rc cbr select an encoder preset and constant-bitrate rate control; available options and performance depend on your GPU and FFmpeg build.
  • -b:v 50M sets the target video bitrate to 50 Mbps. -maxrate 50M sets its maximum, and -bufsize 100M sets the rate-control buffer.
  • -g 120 sets a 120-frame GOP, equivalent to a two-second keyframe interval 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. If your file has no audio, remove the audio mapping and audio options.
  • -f flv selects the output container used for this RTMP(S) stream.

Match the stream to YouTube’s ingest guidance

YouTube Help’s current encoder recommendations, checked on 2026-10-03, list 50 Mbps for H.264 at 2160p60 and 35 Mbps for AV1 or H.265/HEVC at that resolution. The retrieved page does not state a publication year. It recommends CBR, a two-second keyframe frequency (not exceeding four seconds), frame rates up to 60 fps, and AAC or MP3 audio. For stereo 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. See YouTube’s encoder recommendations.

YouTube recommends RTMPS, the secure extension to RTMP. Its guidance also says 2160p streams use normal latency because low latency is unavailable at that resolution. Test with representative picture movement and audio, then watch stream health in Live Control Room before depending on the broadcast.

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
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

Check your file, FFmpeg build, GPU and upload connection

  • Inspect the source before streaming: confirm its dimensions, frame rate, audio streams, pixel format and SDR or HDR characteristics. Configure the command for what the file actually contains.
  • Check encoder availability with ffmpeg -h encoder=h264_nvenc. A listed encoder does not guarantee that your specific GPU supports the required format or can sustain a 4K60 encode. NVIDIA’s NVENC application note describes hardware encoder capabilities; supported codecs, profiles, bit depth, dimensions, frame rate and performance vary by GPU. The NVIDIA FFmpeg guide includes 4K60 and live-streaming examples.
  • Make sure your upload connection can sustain the video bitrate plus audio and protocol overhead, with headroom. YouTube’s recommended video bitrate alone is not the total stream bitrate.
  • Watch and listen to a test broadcast. The end-to-start transition can create a visible or audible jump; use a seamless source if that matters.

Choosing a codec, including for HDR

The command uses H.264 because its 50 Mbps target matches YouTube’s listed 2160p60 H.264 recommendation. YouTube lists 35 Mbps for AV1 or HEVC at 2160p60, but that does not make either codec universally better: compatibility, supported GPU encoding and the source all matter. Check your exact card and installed FFmpeg options rather than assuming a codec or setting is available.

For HDR, do not use the SDR command unchanged. YouTube recommends H.265/HEVC over RTMP(S) for HDR, with 10-bit HDR and the relevant color metadata; its listed settings do not support AV1 for HDR. Verify that the source, encoder, metadata and full delivery path preserve the intended color characteristics before going live. See YouTube’s encoder recommendations.

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

Troubleshooting a failed or unhealthy stream

Symptom What to check
FFmpeg cannot find or initialize h264_nvenc Confirm your FFmpeg build includes the encoder and your NVIDIA GPU supports the required input and 4K60 encode. Check ffmpeg -h encoder=h264_nvenc and your GPU’s capabilities.
YouTube does not receive the broadcast Recheck the ingest address and stream key in Live Control Room, the RTMPS URL, outbound connectivity and firewall rules. Do not expose the key when sharing logs or command lines.
Stream health reports problems or playback stutters Check network stability and available upload capacity against the full stream bitrate, not just the video target. Confirm the GPU sustains real-time encoding and review FFmpeg output and YouTube stream health.
No audio reaches the stream Check whether the file contains an audio stream and whether -map 0:a:0? selects the intended one. Adjust mapping for files with a different stream layout.
FFmpeg exits or the stream behaves unexpectedly Check file timestamps and formats, encoder initialization, the selected audio stream, network stability and ingest settings. Test with the same source and settings before relying on an unattended run.
A hitch or jump repeats at the loop point The file’s end and beginning may not join cleanly. Edit or prepare a seamless loop if the boundary must be unobtrusive.

Because this is file input, real-time pacing with -re is appropriate. FFmpeg cautions against applying read-rate limiting carelessly to an actual capture or live input, where it can cause packet loss.

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

Or let it run in the cloud

If the goal is an always-on YouTube channel rather than managing a local FFmpeg process, StreamNeo loops uploaded videos from the cloud. Upload a recording or build a playlist, add your YouTube stream key once, and go live. Your computer and home connection do not have to stay on; StreamNeo automatically recovers if YouTube drops the stream. It sends videos as uploaded, 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. Monthly: $9.99 per month.

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

Quick Recap

Bestseller 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,249.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,814.90
Bestseller 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
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
Rank #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
  • 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
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

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Screening Room

  1. How to stream Glastonbury 2025 in 4K for free: what was available and what you can watch nowAdmit one · BlogHow to stream Glastonbury 2025 in 4K for free: what was available and what you can watch nowOpened13 AUG 2026Runtime8 min
  2. Earth Story: How Our Planet Has Changed Over TimeAdmit one · NatureEarth Story: How Our Planet Has Changed Over TimeOpened05 OCT 2026Runtime3 min
  3. The Internet’s Own Boy: The Story of Aaron SwartzAdmit one · SocialThe Internet's Own Boy: The Story of Aaron SwartzOpened05 OCT 2026Runtime2 min
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.