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 DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
Mountain View desk5 min

Best FFmpeg Command for Looping a Recorded Lecture to YouTube Live

A practical FFmpeg command for endlessly looping a recorded lecture to YouTube Live, plus the settings and checks needed for a healthier stream.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a recorded 1080p/30 lecture with audio, use FFmpeg’s input-side -stream_loop -1 to repeat the file indefinitely and -re to send it at its normal playback rate. The command below is a starting template: replace the destination with the stream URL and key shown for your YouTube event, then verify the result in Live Control Room.

FFmpeg command for a 1080p/30 lecture

ffmpeg -re -stream_loop -1 -i "lecture.mp4" 
  -map 0:v:0 -map 0:a:0? 
  -c:v libx264 -preset veryfast 
  -b:v 5M -maxrate 5M -bufsize 10M 
  -pix_fmt yuv420p -g 60 -keyint_min 60 -sc_threshold 0 
  -c:a aac -b:a 128k -ar 44100 
  -f flv "rtmps://a.rtmps.youtube.com/live2/STREAM_KEY"

Replace lecture.mp4 with the path to your recording. Replace the example destination with the stream URL and key for the actual event; the endpoint shown is a template, not a substitute for checking YouTube’s event settings. Treat the key like a password: do not publish it in a script, screenshot, or article example.

As an Amazon Associate I earn from qualifying purchases.

This template targets H.264 video at 1080p/30 with AAC audio. It is not a tested or guaranteed result for every file, FFmpeg build, or connection. Confirm your build supports the encoders and protocol you use, and test the source in Live Control Room.

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

What the loop and pacing options do

  • -stream_loop -1 repeats the input indefinitely. It is an input option, so it must appear before -i. FFmpeg documents the option in its stream_loop documentation change.
  • -re reads the file at its native rate, pacing the prerecorded input for live output. FFmpeg’s protocol documentation shows the same real-time pattern with a file sent to an RTMP destination.
  • -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. Check the resulting audio behavior rather than assuming a video without audio is suitable for your broadcast.
  • -c:v libx264 encodes H.264 video. -preset veryfast is an x264 speed-versus-compression setting; if your machine cannot encode in real time, test a faster preset or a compatible hardware encoder.
  • -b:v 5M -maxrate 5M -bufsize 10M set the video rate-control values in this example. Five Mbps is YouTube’s listed H.264 minimum for 1080p/30, not a universal ideal.
  • -pix_fmt yuv420p selects a broadly used pixel format. -g 60 -keyint_min 60 -sc_threshold 0 requests a 60-frame GOP and disables scene-cut keyframes; at 30 fps, 60 frames is two seconds.
  • -c:a aac -b:a 128k -ar 44100 encodes AAC audio at 128 kbps and 44.1 kHz, matching YouTube’s listed stereo recommendations when the source and output are stereo.
  • -f flv selects the FLV container used for this RTMP-style ingest command.

Match the output to YouTube Live

YouTube lists RTMP and RTMPS ingest, recommends RTMPS, supports H.264, HEVC, and AV1 video options, and lists AAC or MP3 audio and CBR bitrate encoding. It recommends a two-second keyframe interval and says not to exceed four seconds. See YouTube’s current live encoder settings. FFmpeg describes RTMPS as RTMP over a secure SSL connection in its protocol documentation.

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

Bitrate for the example and other output sizes

YouTube’s current H.264 guidance lists 5 Mbps minimum and 14 Mbps recommended for 1080p/30, and 6 Mbps minimum and 17 Mbps recommended for 1080p/60. The retrieved guidance page does not state a publication year; these are current figures accessed in 2026, not claims about when the page was published. Consult the live bitrate table for the resolution and frame rate you actually send.

The example’s 5 Mbps is the listed minimum for 1080p/30. Choose settings for the source’s resolution, frame rate, and motion, and leave upload capacity headroom. YouTube advises testing upload capacity and monitoring stream health. For a different frame rate, set the GOP to about two seconds’ worth of frames—for example, frame rate multiplied by two—while staying within YouTube’s keyframe guidance.

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

Audio and connection

YouTube lists 44.1 kHz and 128 kbps for stereo audio in its recommended advanced settings. The command follows those values, but check the recording’s actual audio tracks and the Live Control Room preview. Use the event’s actual ingest URL and confirm that your FFmpeg build supports the selected protocol; YouTube recommends RTMPS for encrypted ingest.

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

Start the broadcast and verify it

  1. In YouTube Studio, create or select the live stream and open Live Control Room. Get the stream URL and key from its settings. YouTube explains the setup in Manage live stream settings. Keep the key private.
  2. Run the command with your recording path and event destination. Watch the Live Control Room preview and stream-health messages. YouTube recommends testing with representative audio and video movement and monitoring stream health during the event; see its encoder guidance.
  3. Check the event’s visibility and schedule in YouTube Studio, then confirm viewers can access it as intended. A running FFmpeg process alone does not prove YouTube is receiving or presenting a healthy stream.
  4. Let the source reach its end and verify that playback starts again as expected. The loop option is documented, but behavior should be checked with your specific file and setup.

Adjustments and limitations

If encoding cannot keep up

H.264 software encoding uses local CPU. If it cannot encode in real time, try a faster x264 preset or a hardware encoder supported by your FFmpeg build, while keeping the output compatible with YouTube. The right choice depends on your machine and file; no particular performance level can be assumed.

Rank #3
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

If you want to copy rather than re-encode

-c:v copy -c:a copy can reduce CPU use when the source already matches the ingest codec and parameters. Do not assume an uninspected lecture file meets the required bitrate, keyframe, codec, or audio constraints. When uncertain, transcode and inspect the actual ingest against YouTube’s encoder settings.

Other practical checks

  • If the input has no audio, the optional audio map prevents a hard failure from a missing audio stream; test whether YouTube accepts and presents the resulting output as you intend.
  • If RTMPS fails, confirm the event’s displayed URL and that your FFmpeg build supports the chosen protocol. YouTube recommends RTMPS, but use the endpoint shown for the event.
  • If the preview is absent or unhealthy, check the URL and key, selected video/audio streams, available upload capacity, and encoder settings before treating the local process as proof of a successful broadcast.
  • Use recordings you have the rights to stream. A live encoder does not grant permission to rebroadcast lecture audio, video, slides, or other third-party material, nor does it guarantee YouTube will accept or monetize a stream.
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 you want a YouTube loop without leaving your own computer and home connection running, StreamNeo runs uploaded videos from the cloud. Upload the recording or build a playlist, add your YouTube stream key once, and go live. It plays uploaded videos, not a live camera feed.

Rank #4
Elgato 4K X Capture Card, HDMI 2.1, 4K144 Ultra-Low Latency
  • Seamless Broadcasting and Versatile Streaming: Connect effortlessly to any app such as OBS, Streamlabs, Twitch Studio, Restream, Zoom, Teams, and stream flawlessly on various platforms like YouTube, Twitch, Discord, Facebook Gaming, etc., providing you with unparalleled flexibility and reach.
  • Next-gen capture: Unleash the full potential of your content with cutting-edge 4K resolution, delivering crystal-clear visuals at an impressive 144 frames per second.
  • HDMI 2.1 in/out: Elevate your recording capabilities with HDMI 2.1 support, allowing you to document high frame rates up to 240fps in glorious 1080p resolution for an unparalleled viewing experience.
  • VRR passthrough: Immerse yourself completely in the gaming experience as our Variable Refresh Rate (VRR) passthrough ensures flawlessly smooth gameplay, eliminating screen tearing for an uninterrupted visual feast.
  • Ultra-low latency: Stay in the moment with ultra-low latency powered by USB 3.2 Gen 2, ensuring your broadcast and gameplay remain perfectly synchronized, delivering an immersive and responsive streaming experience.
  • Nothing has to stay on at home; the stream continues from the cloud.
  • Your upload streams as made, up to 4K 60fps, at one flat price per slot, with no re-encode or quality tiers.
  • Automatic recovery is included if YouTube drops the stream.
  • The first day is free with no card; it is one free day per account. Monthly billing is $9.99 per month.

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.

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.

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
Outdated Drivers Are Slowing You DownFree scan - exact matches
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.