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

To loop a prerecorded video on YouTube Live from Windows, use FFmpeg with -stream_loop -1 to repeat the file and -re to send it at normal playback speed. Encode to a YouTube-compatible format, then send the output to the current server URL and stream key shown in YouTube Live Control Room. The command below is a configurable template, not a tested command.

Before you start

  • An eligible YouTube channel: YouTube says the channel must be verified and must not have had live-streaming restrictions in the past 90 days. First-time live-stream activation can take up to 24 hours, according to YouTube Help pages accessed in 2026. YouTube encoder setup and live-stream eligibility.
  • FFmpeg available in Command Prompt: Confirm ffmpeg runs and that your Windows build includes the libx264 encoder used below. This guide does not specify a download provider.
  • A video file and reliable upload: Choose output settings supported by your source, and leave upload capacity beyond the stream bitrate. YouTube recommends keeping 20% of upload bandwidth available beyond the total stream bitrate. YouTube streaming tips.
  • Your current YouTube ingest credentials: A server URL and stream key for the stream you intend to broadcast. Treat the key like a password.

Set up YouTube Live and get the stream key

  1. Open YouTube Studio and enter Live Control Room. Create or select the stream you want to use.
  2. In the encoder setup, copy the server URL and the matching stream key. Use the values shown for that stream; do not assume a URL format or reuse credentials from a different event. YouTube recommends RTMPS for encoder ingest. YouTube encoder setup and YouTube encoder settings.
  3. Keep the key private. If it is exposed, reset it in YouTube Studio and replace it in your FFmpeg command. YouTube stream-key guidance.

Prepare the FFmpeg command

Replace the example file path and destination with your own. The bitrate and GOP shown are examples for 1080p30 H.264, not universal settings. YouTube’s current encoder guidance recommends H.264 at 5–14 Mbps for 1080p30, CBR, and a two-second keyframe interval; do not exceed four seconds. Select values from YouTube’s table for your actual codec, resolution, and frame rate. YouTube encoder settings.

ffmpeg -re -stream_loop -1 -i "C:Videosprerecorded.mp4" -c:v libx264 -preset veryfast -b:v 6000k -maxrate 6000k -bufsize 12000k -pix_fmt yuv420p -g 60 -c:a aac -b:a 128k -f flv "rtmps://SERVER/APP/STREAM_KEY"

At 30 frames per second, -g 60 sets a 60-frame GOP, or two seconds between keyframes. If you use a different frame rate, change -g so the interval remains about two seconds. Replace the destination placeholder with the complete server URL and stream key supplied by Live Control Room; the example URL is not a real destination.

What the options do

  • -re reads the file at its native rate instead of sending it as fast as the computer can process it.
  • -stream_loop -1 repeats the input indefinitely. It is an input option, so it appears before the associated -i.
  • -i selects the prerecorded file.
  • -c:v libx264 encodes H.264 video, provided your FFmpeg build includes that encoder.
  • -b:v sets the target video bitrate. -maxrate and -bufsize shape rate control in this example; verify the full configuration against YouTube’s current guidance.
  • -pix_fmt yuv420p selects a commonly used pixel format for compatibility.
  • -g sets GOP spacing in frames; set it in relation to your frame rate.
  • -c:a aac -b:a 128k encodes audio as AAC at the example bitrate. If the source is silent or has no audio stream, adapt the command accordingly.
  • -f flv selects the output container used with RTMP-family ingest. YouTube recommends RTMPS; use the destination supplied in Live Control Room.

FFmpeg documents -stream_loop and -re as input options for looping and real-time pacing. FFmpeg command-line documentation.

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

Start, check, and stop the broadcast

  1. Open Command Prompt, enter the completed command, and press Enter. Watch FFmpeg’s output for input, encoder, or connection errors.
  2. Wait for the stream preview to appear in Live Control Room. Before broadcasting to an audience, test with representative movement and audio, inspect the preview, and monitor stream health. YouTube says, “Make sure to test before you start your live stream.” YouTube encoder settings.
  3. For a scheduled broadcast, use the controls in Live Control Room to start the event after the preview is present. Keep monitoring the stream while it runs.
  4. To finish, end the event in YouTube when applicable, then stop FFmpeg in the Command Prompt window. YouTube states that streams under 12 hours are automatically archived; its guidance does not establish the same behavior for longer streams. YouTube archive guidance.

Make the loop sound and look right

Looping the input does not guarantee a seamless transition. Listen and watch at the file boundary during a test. If the audio clicks, drops, or restarts awkwardly, or the picture visibly jumps, edit or re-encode the source and test the revised loop. Copying a file without re-encoding may save CPU, but compatibility depends on its codecs, timestamps, container behavior, and stream parameters; it is not a reliable assumption for every file.

Confirm the file contains the audio you expect. A silent source may need a different command, and neither FFmpeg’s loop option nor YouTube’s guidance guarantees gapless audio at each repeat.

Rank #2
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.

Copyright and YouTube live-stream rules

Only broadcast video and audio you have the rights or permission to use. A prerecorded file being sent through an encoder does not make copyrighted music, footage, or other material safe to rebroadcast. Check YouTube’s applicable copyright rules and any licenses or permissions covering the complete recording before going live. Repeating a video also does not change whether you are entitled to use it.

Check YouTube’s current live-stream eligibility and content policies for your channel and broadcast. Eligibility can be affected by channel status, and YouTube says a channel with live-streaming restrictions in the prior 90 days is not eligible under its stated requirements. YouTube live-stream eligibility.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Video Capture Card, 4K USB3.0 HDMI to USB C, 1080P60FPS HDMI Capture Card for Streaming, Gaming, Video Recording Compatible with Switch, Xbox, PS4/5, OBS,iPad Mac OS Windows,Camera, Zoom(Silver)
  • 【4K HDMI Input, 2K@30Hz Recording】Powered by a true USB 3.0 high-speed interface, the capture card supports up to 4K@30Hz HDMI input and records at 2K@30Hz or 1080P@60Hz. Perfect for gamers, streamers, and professionals who need crisp, smooth video for live streaming, gameplay recording, or online meetings.
  • 【Ultra Low Latency Screen Sharing】Built with a premium aluminum alloy shell and advanced chipset for stable heat dissipation, ensuring ultra-low latency transmission. Capture high-quality video and dual-channel audio in real time—no lag, no frame drop—ideal for Twitch, YouTube, or OBS streaming.
  • 【Easy Plug and Play, Compact & Portable】No driver or external power required—just plug and play via USB 3.0 or Type-C connection to your Windows or macOS computer. Lightweight and compact design makes it easy to carry for outdoor streaming, live shows, or mobile recording setups.
  • 【Wide Compatibility & Multi-Device Support】Compatible with Windows 7 8 10 11, macOS, Linux,Android and supports most popular software such as OBS, Zoom, VLC, Twitch Studio, and more. Works seamlessly with PS4, PS5, Xbox, Switch, DSLR cameras, TV boxes, and other HDMI-output devices for streaming to YouTube, Twitch, etc.
  • 【What You Get】Includes: HDMI Capture Card, USB 3.0 to USB-C Adapter, User Manual. Tips: Make sure your tablet’s OTG function is enabled before connecting. Test your HDMI device with a monitor first to confirm video and audio output, then connect to the Video Capture Card for recording.

Troubleshoot common FFmpeg-to-YouTube problems

Symptom Likely cause What to check or do
No preview or connection error Wrong, outdated, or mismatched server URL or stream key. Copy the current values from the intended stream in Live Control Room. If needed, obtain a new key there and update the command. YouTube encoder setup and stream-key guidance.
YouTube rejects the stream or reports poor health Incompatible protocol or encoding settings, or insufficient upload capacity. Check RTMPS, codec, CBR, resolution, frame rate, bitrate, and keyframe spacing against YouTube’s current settings. Leave the recommended 20% upload headroom and watch stream health. Encoder settings and streaming tips.
Video loops but audio is missing or wrong The source has no intended audio stream, or the command does not match its audio. Check the source file and adapt the audio options, then test the entire repeat boundary. Do not assume the loop will be gapless.
The stream stops unexpectedly FFmpeg input or encoder failure, network interruption, or an issue with the YouTube event. Read the FFmpeg console output, check the connection and source file, and inspect Live Control Room. -stream_loop -1 repeats the input; it does not guarantee continuous internet access or an uninterrupted YouTube event.
Unknown encoder 'libx264' The available FFmpeg build does not include the encoder used in the template. Use a Windows FFmpeg build that includes libx264, or adapt the command to an encoder available in your build and verify its output settings.
The key may have been exposed Someone else could use the stream credential. Reset the key in YouTube Studio and update the command with the replacement before streaming again. YouTube stream-key guidance.
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

With StreamNeo, upload your prerecorded video, add your YouTube stream key, and go live. It loops uploaded videos from the cloud, so your Windows computer and home connection do not have to stay on. Each slot streams the upload as made, up to 4K 60fps, at one flat price per slot, with automatic recovery if YouTube drops the stream. The first day is free with no card, one free day per account. Monthly: $9.99 per month.

Rank #4
Sale
Capture Card 4K HDMI Video Streaming to USB 3.0 1080P 60FPS Capture Device
  • High-Quality Video Capture, 4K HDMI Capture Card Ready: Capture smooth and vibrant video with this 4K HDMI capture card, engineered for gamers and content creators who demand crisp 1080P 60FPS video quality. Whether you're streaming to Twitch or recording gameplay for YouTube, your footage will look professional and detailed
  • Plug-and-Play USB Capture Card, No Drivers Needed: Designed as a USB capture card for streaming, this device works instantly out of the box, just plug into your PC or laptop and start capturing. Fully compatible with popular software like OBS Studio, Streamlabs, and XSplit, making setup quick and stress-free for beginners and pros alike
  • Universal Compatibility PS5, Xbox, Switch & More: Stream or record gameplay from virtually any HDMI-enabled device including Nintendo Switch, PS5, Xbox Series X, DSLR cameras, and PCs. The video capture card for gaming supports seamless passthrough so you can play without lag while your audience watches every frame in real time
  • Low-Latency Performance for Smooth Streaming: This capture card for streaming minimizes delay between gameplay and broadcast, so you get reliable, low-latency capture that works well for competitive gaming, live broadcasts, and podcast sessions. Suitable for those building their channel with high-quality, engaging content
  • Compact & Portable Design for Content Creators: Lightweight and portable, this USB 3.0 capture card works well for creators who travel or switch gaming setups often. Throw it in your bag and stream or record wherever you are, at home, events, LAN parties, streaming or studio sessions

See StreamNeo or start your free first 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.