Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
Mountain View desk5 min

How to Stream a 4K Prerecorded Loop to YouTube Live with FFmpeg

Use FFmpeg to repeat a 4K file at normal speed and send it to YouTube Live over RTMPS, with the right bitrate, keyframe interval, and test steps.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To loop a 4K video into a YouTube Live broadcast, use FFmpeg’s -stream_loop -1 to repeat the file, -re to send it at normal playback speed, and an RTMPS destination with the stream URL and key from YouTube Live Control Room. The command below is a starting point for a 4K, 30 fps SDR file encoded as H.264; match the bitrate and keyframe interval to your chosen output settings.

Before you start

  • Install an FFmpeg build that includes the encoder you plan to use. The example below requires libx264.
  • Have a 4K video file ready and check its resolution, frame rate, audio, and whether it is SDR or HDR. The example assumes 30 fps, SDR video, and stereo audio.
  • In YouTube Live Control Room, create or schedule a stream and copy its stream URL and stream key. Treat the key like a password: do not publish it, and reset it if it is exposed. See YouTube’s instructions for creating an encoder stream.
  • Check that your sustained upload connection can carry the selected video and audio bitrate with headroom. A speed test is useful, but no single upload-speed figure guarantees a stable stream on every connection.

Choose 4K output settings

YouTube’s current encoder guidance gives different recommended video bitrates for 2160p according to frame rate and codec. These are ingest recommendations, not a promise that every viewer will receive 4K; YouTube processes live video into outputs, and playback quality depends on its processing and the viewer’s device and connection. The recommendations below are from YouTube’s encoder settings page, accessed in 2026.

As an Amazon Associate I earn from qualifying purchases.

Output YouTube-recommended video bitrate
2160p, 30 fps, AV1 or H.265/HEVC 30 Mbps
2160p, 30 fps, H.264 42 Mbps
2160p, 60 fps, AV1 or H.265/HEVC 35 Mbps
2160p, 60 fps, H.264 50 Mbps

The example uses H.264 at 30 fps, so its video bitrate is 42 Mbps. For a 60 fps output, use the row matching your codec instead. YouTube recommends CBR and a two-second keyframe interval, and says not to exceed four seconds. For HDR, YouTube recommends H.265; its guidance says AV1 is not supported for HDR. Check the current YouTube encoder settings for codec-specific details.

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

At 30 fps, a two-second GOP is 60 frames, hence -g 60 below. If you output at another frame rate, set GOP length to approximately twice that rate: for example, 120 frames at 60 fps. The example does not force a frame rate, scale the image, or set pixel format or color metadata. Inspect the file first and add conversion options only if the source and target require them.

#1 Best Overall
Sale
Capture Card, 4K HDMI Video Capture Card, Game Capture Card, 1080P 60FPS Video Capture Device, HDMI to USB 3.0 Capture Card for Streaming, Work with Camera/Xbox/PS4/PS5/PC/OBS
  • 【1080P HD High Quality】Capture resolution up to 1080p for video source and it is ideal for all HDMI devices such as PS4, PS3, Xbox One, Xbox 360, Wii U, DVDs, DSLR, Camera, Security Camera and set top box. Note: Video input supports 4K30/60Hz and 1080p120/144Hz. Does not support 4K120Hz/144Hz. Output supports up to 2K30Hz.
  • 【Plug and Play】No driver or external power supply required, true PnP. Once plugged in, the device is identified automatically as a webcam. Detect input and adjust output automatically. Won't occupy CPU, optional audio capture. No freeze with correct setting.
  • 【Compatible with Multiple Systems】suitable for Windows and Mac OS. High speed USB 3.0 technology and superior low latency technology makes it easier for you to transmit live streaming to Twitch, Youtube, Facebook, Twitter, OBS, Potplayer and VLC.
  • 【HDMI LOOP-OUT】Based on the high-speed USB 3.0 technology, it can capture one single channel HD HDMI video signal. There is no delay when you are playing game live.
  • 【Support Mic-in for Commentary】Rybozen capture card has microphone input and you can use it to add external commentary when playing a game. Please note: it only accepts 3.5mm TRS standard microphone headset.

Get the YouTube RTMPS destination

  1. Open YouTube Live Control Room and create a new stream or open a scheduled stream.
  2. Copy the server URL and stream key shown for the stream. Use the RTMPS server information YouTube provides; do not paste your key into a public post, screenshot, or shared script.
  3. For a scheduled broadcast, start the encoder and wait for the preview in Live Control Room. Select Go live there when the preview and stream health are satisfactory. The exact controls can vary with the stream setup; YouTube documents stream settings at Manage live stream settings.

Start the prerecorded loop with FFmpeg

Replace input.mp4 with the file path and replace the RTMPS destination with the server URL and stream key from Live Control Room. Keep the destination private because it contains the key.

ffmpeg 
  -stream_loop -1 -re -i "input.mp4" 
  -c:v libx264 -preset veryfast 
  -b:v 42M -maxrate 42M -bufsize 84M 
  -g 60 
  -c:a aac -b:a 128k 
  -f flv "rtmps://SERVER/APP/STREAM_KEY"

-stream_loop -1 repeats the input indefinitely; FFmpeg documents that option and its placement in the FFmpeg command documentation. It must appear before the input it applies to. -re is also before -i; it reads the file at its native playback rate rather than sending it as fast as the computer can process it. The output uses H.264, a constant target and maximum video bitrate, a two-second GOP for 30 fps, and AAC audio at 128 kbps.

Rank #2
4K Video Capture Card, HDMI to USB Capture Card 1080P for Streaming, Recording, Gaming, Compatible with Nintendo Switch, PS5, Xbox
  • 【1080P 30FPS Full HD Recording】The HDMI capture card connects to your video source and computer, and captures high-definition video up to 1080p 60fps
  • 【HDMI Video Capture】Based on high-speed USB 2.0 technology, you can capture a high-definition HDMI video and HDMI audio signal of a signal channel, sending audio and video signals to computers /pc. The gaming capture card is suitable for devices with HDMI output, such as devices for PS4, for Xbox one, for Wii U and for Switch
  • 【Screen Sharing for Meetings】The video capture card is a fast, familiar and economical way to share content in conference rooms and online meetings. Connect to presentations without software, just connect to a laptop or tablet via HDMI to start sharing
  • 【Plug and Play】This USB capture card does not need to install a driver, so you can use the built-in functions of the current software to get a seamless experience. Because the video capture device is compatible with most third-party software, it can be plug-and-play for Windows, for Ma OS X, and for Linux. The USB2.0 high-speed transmission port makes it easier for you to have real-time streaming for Twitch, for Youtube, for OBS, for Potplayer and for VLC
  • 【Compact & Portable】The capture card is small size & easy to carry, convenient for outdoor and indoor live broadcasting. We provide 30 days no question asked money back and lifetime technical support, if you have any problem, please feel free to contact us

This is an illustrative command, not a tested universal recipe. FFmpeg’s RTMP/FLV output pattern is documented in FFmpeg Documentation (all); YouTube recommends RTMPS for a secure connection. Make sure the actual server address and key are exactly as YouTube gives them. If FFmpeg reports that libx264 is unavailable, install a build with that encoder or choose an encoder present in your build and use settings appropriate to it.

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

If your source is already compatible

You can try stream copying with -c copy instead of encoding when the source codecs, bitrate, keyframe spacing, frame rate, and container/ingest compatibility meet YouTube’s requirements. Copying avoids video re-encoding and can reduce CPU load, but it cannot change the encoded bitrate or keyframe spacing. FFmpeg describes copy as copying the stream without re-encoding in its command documentation.

Rank #3
Guermok Video Capture Card, 4K USB3.0 HDMI to USB C, 1080P 60FPS & 2K 30FPS
  • 【1080P 60FPS Video Capture Card】 This HDMI game capture card is based on USB3.0 high speed transmission port, input resolution up to 4K@30HZ, output resolution up to 2K@30Hz or 1920×1080@60Hz. Type c and USB interface can meet most of the devices in daily life. Easily meet the online capture, real-time recording, online meetings, live gaming and other functions, so you have a better visual enjoyment. Note: For capture use only; requires capture software to function and is not intended for direct screen casting to a monitor or TV
  • 【Ultra Low Latency Screen Sharing】 HDMI capture card is made of good quality aluminum alloy with strong heat dissipation, allowing you to enjoy ultra low latency while live gaming or video recording or live streaming, avoiding blue screens and lag. This HDMI to USBC capture card supports easy recording of good quality audio or HD video and transferring it to your computer or streaming platform, allowing you to record 60 fps HD video directly on your hard drive and real-time preview
  • 【Plug and Play, Easy to Carry】 This HDMI 1080P video capture card does not require any additional drivers or external power supply, just plug and play for fast capture. The capture card is small and lightweight, so you can put it in your bag for emergencies, making it very portable for outdoor live streaming. It's also a great way to share content in game recording, video conference, video recorder and online teaching
  • 【Wide Compatibility USB Capture Card】 Easily streams to Facebook, Youtube or Twitch. With the connection, this HDMI to USB C/3.0 video capture devices can be working on several Operating Systems and various software: Windows 7/ 8/ 10, Mac OS or above, Linux, Android, Laptop, Xbox One, PS3/PS4/PS5, Camera, DVDs, Set Top Box, Webcame, DSLR, Switch/Switch 2, TV BOX, HDTV, Potplayer/VLC, ZOOM, OBS Studio etc.
  • 【Package Content & Note】 1x HD Audio Capture Card , 1x USB 3.0 to USB C Adapter (A-side 3.0, B-side 2.0), 1x user manual. Please note that you need to restart the OBS Studio software after the audio setup is complete, otherwise it will result in no sound output. When using an adapter, if the device is recognized as USB 2.0, try using the other side with the USB-C port. Simply flip the capture card and reconnect it to be recognized as USB 3.0

Test and monitor the broadcast

  1. Before a real event, run a private or otherwise appropriate test using the same file, motion, audio, encoder, and network conditions you expect to use. YouTube specifically advises testing with audio and movement similar to the intended stream.
  2. Watch the encoder preview and stream-health indicators in Live Control Room. Confirm the picture, audio, and incoming resolution look right before selecting Go live for a scheduled stream.
  3. Keep the FFmpeg process and the computer running for the entire broadcast. A local FFmpeg process depends on that computer, power, and network remaining available.
  4. For 4K, plan on normal latency: YouTube says the low-latency option is unavailable for 2160p streams.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting common problems

  • FFmpeg exits with an encoder-not-found error: the installed build may not include libx264. Use a build that does, or select an available encoder and adjust the command for it.
  • YouTube does not receive the stream: check that the server URL and stream key were copied correctly, the key has not been reset, and the destination uses the RTMPS details shown in Live Control Room. Never reveal the key while troubleshooting.
  • The computer cannot encode smoothly: H.264 encoding at 4K is compute-intensive. Try an appropriate hardware or software encoder available in your FFmpeg build, or use compatible source streams with -c copy; copying only works if the source already meets ingest requirements.
  • Stream health warns about bitrate or connection: compare your output with YouTube’s recommendation for the selected resolution, frame rate, and codec, then test sustained upload capacity with additional headroom. Network variation can cause trouble even when a brief speed test looks adequate.
  • The loop is not 4K or the motion looks wrong: the command does not scale or force frame rate. Inspect the source and decide whether you need explicit scaling or frame-rate conversion; conversion can alter the image or motion and adds processing.
  • The stream stops when you close a terminal or shut down: FFmpeg is running on your machine, so the process, power, and internet connection must stay available. For recovery, check the process, connection, and Live Control Room health before restarting with a valid key.

Or let it run in the cloud

If the goal is a continuous prerecorded YouTube stream without keeping a computer on at home, StreamNeo runs the uploaded video or playlist from the cloud. Upload a recording, add your YouTube stream key once, and go live. Nothing has to stay on at home; each slot streams the file as uploaded at any quality up to 4K 60fps for one flat price per slot, and StreamNeo automatically recovers if YouTube drops the stream. The first day is free with no card required. Monthly pricing is $9.99 per month. The service plays uploaded video to YouTube; it does not stream from a camera. Start your free StreamNeo day.

Rank #4
Sale
Elgato Cam Link 4K Capture Card for DSLR, Camcorder, Action Cam
  • Turn Your Camera into a Pro Webcam: Connect your DSLR or mirrorless camera to any computer and go live in stunning quality
  • Stunning quality: Stream and record in 1080p60 or even 4K60 for razor-sharp detail (Requires a compatible camera and the latest Cam Link 4K model)
  • Connect More Than Just Cameras: Use a camcorder, action cam, or even your iPhone to level up your content
  • No Lag, No Delays: Ultra-low latency keeps your video and audio perfectly in sync, just like it should be
  • Your iPad, Now a Pro Field Monitor: Preview your shots in real time on an iPad with USB-C

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 Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

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.