Use FFmpeg’s -stream_loop -1 to repeat an MP4 indefinitely and -re to send the file at real-time speed. In Windows Command Prompt, start with the template below, then replace the video path and YouTube RTMPS destination with the values for your stream.
Windows FFmpeg command to loop an MP4 on YouTube Live
ffmpeg -re -stream_loop -1 -i "C:pathvideo.mp4" -c:v libx264 -preset veryfast -b:v 4500k -maxrate 4500k -bufsize 9000k -g 60 -keyint_min 60 -sc_threshold 0 -c:a aac -b:a 128k -ar 44100 -f flv "rtmps://YOUR_INGEST_URL/YOUR_STREAM_KEY"
Change C:pathvideo.mp4 to the full path of your MP4. Replace the destination placeholder with the RTMPS server URL and stream key shown for the selected stream in YouTube Studio. Keep the URL and key private: together they authorize a feed to your channel.
This is a starting template, not a command tested on a particular Windows PC. It assumes a 30-fps source for its 60-frame GOP, uses H.264 video and AAC audio, and targets an approximately 4.5 Mbps video bitrate. Check that your FFmpeg build includes libx264, adjust the settings to suit your file and connection, and check the preview before broadcasting publicly. See the FFmpeg command-line documentation and YouTube encoder settings.
What the important options do
-rereads a file at its native frame rate, so FFmpeg sends it at real-time pace rather than as quickly as the computer can process it.-stream_loop -1repeats the input indefinitely. The value-1means infinite looping.-iidentifies the input MP4. Both-reand-stream_loop -1are input options, so put them before the relevant-i. FFmpeg options apply to the next input or output.-c:v libx264encodes video as H.264;-c:a aacencodes audio as AAC. The template re-encodes rather than copying the original streams.-b:vsets the target video bitrate;-maxrateand-bufsizeconstrain rate variation. This template is not a substitute for matching settings to the source and available upload bandwidth.-g 60sets a 60-frame GOP. At 30 fps that is a two-second interval; at another frame rate, change the GOP to match a two-second keyframe cadence. YouTube recommends keyframes every two seconds and says not to exceed four seconds.-f flvselects the output container used for this RTMP/RTMPS feed.
Set up the YouTube stream and start FFmpeg
- In YouTube Studio, select Create → Go Live, then create or select a stream in Live Control Room. Follow YouTube’s encoder setup instructions.
- Copy that stream’s server URL and stream key into the command’s destination. Use the values for the stream you selected, not another channel or stream. YouTube recommends RTMPS for encrypted transport.
- Open Windows Command Prompt, paste the edited command, and press Enter. If Windows cannot find
ffmpeg, install or locate an FFmpeg build and make its executable available from the command prompt, or run the command from the folder containingffmpeg.exe. - For a scheduled stream, wait for the incoming preview in Live Control Room and click Go live when ready. For a stream configured to start immediately, follow the controls and settings shown for that stream.
- Check that the preview has both the expected picture and audio. Test representative motion and sound, and watch stream health and warnings while live. YouTube’s instruction is: “Make sure to test before you start your live stream.”
- To stop, interrupt FFmpeg and use End Stream in Live Control Room when applicable. YouTube says streams shorter than 12 hours are automatically archived; that statement does not establish the same archive guarantee for longer broadcasts.
Choose bitrate, keyframes, and compatibility settings
YouTube’s current guidance, accessed October 3, 2026, lists RTMP/RTMPS ingest and supports H.264, H.265, and AV1 video with AAC or MP3 audio for RTMP/RTMPS. The command uses the broadly used H.264/AAC pairing. YouTube recommends constant bitrate (CBR) and a two-second keyframe interval, not exceeding four seconds. Its table lists these H.264 settings for 1080p at 30 fps:
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware match#1 Best Overall
- Spacious Design: Measuring 21.1" wide and 14.1" deep, our lap desk comfortably fits most laptops up to 15.6". Extra room for accessories ensures convenience.
- Enhanced Functionality: Packed with handy features, including a 5x9" precision tracking mouse pad and a built-in phone slot for seamless work or video calls. Plus, enjoy ergonomic support with the integrated cushioned wrist rest.
- Cool Comfort: Enjoy a stable surface with our lap desk's dual bolster cushion, designed for comfort and airflow, keeping your lap cool during extended use.
- Durable Surface: Work with confidence on our lap desk's solid surface, featuring a sleek black carbon color, ensuring optimal air circulation to prevent your laptop from overheating.
- On-the-Go Convenience: With an integrated handle and lightweight design (2.8 lbs), our lap desk is portable for travel or moving around the house, offering flexibility in any space.
| Setting | YouTube guidance |
|---|---|
| Video bitrate | 5 Mbps minimum; 14 Mbps recommended |
| Keyframe interval | Two seconds recommended; no more than four seconds |
| Rate control | CBR recommended |
Those bitrate figures are YouTube configuration recommendations for 1080p/30 H.264, not independent performance measurements and not universal targets for every resolution, frame rate, or codec. The example command’s 4.5 Mbps target is below the stated 1080p/30 minimum, so do not use it unchanged for that format. Choose a bitrate suitable for the source and for upload capacity that can be sustained reliably; leave headroom rather than setting the feed at the full theoretical connection speed. If the connection or PC cannot sustain the chosen settings, reduce resolution or bitrate.
For a 30-fps file, a GOP of 60 frames corresponds to two seconds. For 25 fps, for example, use a 50-frame GOP to preserve that interval; calculate using the actual frame rate rather than copying -g 60. YouTube recommends testing before broadcast and monitoring stream health once live. Its encoder settings guidance provides the applicable settings table.
Rank #2
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Troubleshoot common FFmpeg and YouTube problems
- The video plays only once or stops looping: Check that
-stream_loop -1appears before the input’s-i, and confirm that the file exists and can be read. - The feed races ahead or arrives in bursts: Keep
-rebefore-iwhen reading a file. FFmpeg documents it as native-frame-rate input reading for cases where packet flow must be real time. Do not use it on actual capture or live input. - YouTube rejects the feed or reports a stream problem: Verify that the URL and key belong to the selected stream, use a supported codec and container, and align bitrate and keyframe interval with YouTube’s encoder guidance.
- There is no audio: Check whether the MP4 contains an audio stream and whether the FFmpeg build has the required audio codec. The template encodes audio as AAC; it cannot create audio that is absent from the file.
- The stream is unstable or upload capacity is insufficient: Lower resolution or bitrate to settings the connection can sustain, then test again. If Wi-Fi is unreliable, a wired Ethernet connection is an optional way to avoid relying on it; it is not a requirement of the command.
- The key no longer works, or may have been exposed: Reset the stream key in Live Control Room and update the command with the new key. YouTube explains key management in Manage live stream settings. Never publish the key or include it in a publicly shared command.
Or let it run in the cloud
If the goal is a YouTube channel that keeps a prerecorded video or playlist running, StreamNeo is an alternative to keeping a Windows PC and FFmpeg session running at home. Upload a recording or build a playlist, add your YouTube stream key once, and go live; StreamNeo loops the uploaded video from the cloud. It plays uploaded videos rather than broadcasting a camera feed, and it streams to YouTube.
- Your 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, without re-encoding or quality tiers.
- It automatically recovers if YouTube drops the stream.
- The first day is free, with no card required; it is one free day per account.
The monthly option is $9.99 per month. See StreamNeo for details, or start your free day.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Quick Recap
Best Value
- Spacious Design: Measuring 21.1" wide and 12" deep, our lap desk comfortably fits most laptops up to 15.6". Extra room for accessories ensures convenience.
- Enhanced Functionality: Packed with handy features, including a 5x9" precision tracking mouse pad and a built-in phone slot for seamless work or video calls. Plus, enjoy laptop support with the integrated device ledge.
- Cool Comfort: Enjoy a stable surface with our lap desk's dual bolster cushion, designed for comfort and airflow, keeping your lap cool during extended use.
- Durable Surface: Work with confidence on our lap desk's solid surface, featuring a blush pink color, ensuring optimal air circulation to prevent your laptop from overheating.
- On-the-Go Convenience: With an integrated handle and lightweight design (2.14 lbs), our lap desk is portable for travel or moving around the house, offering flexibility in any space.
Rank #4
- Anti-Slip Surface - Transform your laptop into a mobile workstation with the AboveTEK portable laptop lap desk. The anti-slip surface provides a strong grip for laptops up to 15.6 inches(Diagonal), while the double rubber strip on the bottom ensures a stable display or typing experience on your lap, couch, or bed.
- Retractable Mouse Pad - Retractable laptop mouse pad extends on both directions for the left/right handed with elevation along the edges for stopping mouse from falling off. The size of laptop tray is 14" X 9.7" and the size of mouse pad is 7.4" X 6.1".
- Effective Heat Shield - The effective heat shield made of sturdy and thick material protects your laptop from overheating. Prioritizes your comfort and safety, an ideal lap pad or board for working anywhere.
- EASY to Carry and Store - With an ergonomic and simplistic design, the lap desk is portable to store in a backpack. Only 15" in size, 2.2 lb of weight and with slim 0.6 inch thickness, it is ready to be easily carried around.
- Widely Applicable - The smooth platform accommodates laptops and tablets up to 15.6 inches(Diagonal), making it a versatile accessory and one of the best gifts for mom, dad, students and professionals. Perfect for use as a laptop bed tray or tablet holder anywhere at home, library, or park.
Rank #3
- Note: Not suitable for MacBooks released after 2023 or devices with a protruding front camera; Not applicable to full-screen or notch-style tempered glass screen protectors; Do not use on the rear camera of the phone.
- 💻 Why Do You Need a Webcam Cover Slide? — Safeguard your privacy by covering your webcam with our reliable webcam cover when not in use. Don't let anyone secretly watch you. Stay protected!
- ✅ Thin & Stylish — Enhance your laptop's functionality and aesthetics with our 0.027" ultra-thin webcam covers. Seamlessly close your laptop while adding a touch of sophistication.
- ✅ Fits Most Devices — Compatible with laptops, phones, tablets, desktops! Keep your privacy intact on Ap/ple, Mac/Book, iPh/one, iP/ad, H/P, L/novo, De/ll, Ac/er, As/us, Sa/msung devices.
- ✅ 365 Days Protection — Our upgraded 3.0 adhesive ensures a strong hold that won't damage your equipment. Experience reliable, long-term privacy protection day in and day out.
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.




