To repeat a video while streaming to YouTube with FFmpeg, loop the media input, pace the file in real time with -re, and send the output to YouTube’s ingest URL with a protected stream key. These are separate jobs: looping keeps the video content repeating; an FFmpeg FIFO recovery wrapper can attempt to reconnect after some temporary output failures. Neither prevents every visible interruption if FFmpeg, your network, or YouTube’s ingest fails.
Choose how FFmpeg repeats the video
There are two useful approaches, depending on whether you need to repeat a whole file or a section of video. Choose the audio strategy separately: the loop video filter repeats frames, not an audiovisual program with synchronized sound.
Repeat the whole input file
For a file you want to replay from beginning to end, use FFmpeg’s input-loop option before the input:
ffmpeg -re -stream_loop -1 -i "video.mp4" ...
-stream_loop -1 requests infinite input looping. This is a straightforward starting point when the file contains the video and audio you want to repeat together. Check the output at the loop boundary: source formats, timestamps, and audio tracks can affect how seamless the transition sounds or looks.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minute#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Repeat buffered video frames
FFmpeg’s loop filter repeats buffered video frames. Its options include loop=-1 for infinite repetitions, size for the number of frames buffered, and start for the first frame. The filter applies to video only. It does not automatically loop, synchronize, or mix audio, so define an audio path separately and test the transition before going live.
See the FFmpeg filters documentation for the loop filter’s syntax and option details. The choice between whole-input looping and a frame-filter loop depends on the source, audio synchronization, and the boundary you want.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Pace the file as a live source
When reading a file for live output, put -re before the relevant -i so FFmpeg reads at the input’s native frame rate rather than sending the file as fast as possible:
ffmpeg -re -stream_loop -1 -i "video.mp4" ...
FFmpeg documents -re as equivalent to -readrate 1 and notes that it is useful when flow speed matters, such as streaming. Options generally apply to the next input or output, so placement matters. Do not apply low read rates to an actual live capture input; FFmpeg warns that doing so can cause packet loss. Consult the FFmpeg documentation for option scope and read-rate behavior.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Match YouTube’s encoder settings
Use YouTube’s published encoder guidance for the codec, resolution, frame rate, and bitrate you actually plan to send. YouTube lists RTMP and RTMPS ingest, H.264, H.265, and AV1 video, AAC or MP3 audio, and frame rates up to 60 fps. Its guidance recommends constant bitrate (CBR), a two-second keyframe frequency, and says not to exceed four seconds. Pick the corresponding bitrate from YouTube’s table for your codec, resolution, and frame rate; the upload connection must be able to sustain it.
YouTube recommends RTMPS. Choose it where your FFmpeg build and destination support it; RTMP may be needed for compatibility with a particular setup. The protocol choice does not remove the need for a stable upload connection. See YouTube’s encoder settings, bitrate, and resolution guidance for its current values and supported combinations.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Connect FFmpeg to your YouTube event
- Open YouTube Live Control Room. Create or open the live event and follow YouTube’s encoder setup workflow.
- Copy the server URL and stream key. Use the values shown for that event in your FFmpeg output configuration. Do not publish or share the key; treat it like a password. If you reset it in YouTube, update the FFmpeg configuration too.
- Set the output format and destination. Send an FLV output to the YouTube RTMP(S) server URL combined with your stream key, using the selected video and audio codecs and settings. The exact output options depend on your file, installed FFmpeg build, and YouTube’s selected ingest details.
- Check your local FFmpeg version and options. Run
ffmpeg -versionand consult that build’s help or documentation before relying on a particular option. Do not copy a real stream key into a public script, screenshot, or example.
YouTube’s encoder setup instructions explain how to connect an encoder to a live stream. Because the source format, audio tracks, FFmpeg build, and event settings vary, there is no single command that is correct for every file and account.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Attempt output recovery after temporary failures
Media looping does not keep the RTMP(S) connection healthy. To handle some temporary output failures, FFmpeg’s FIFO muxer documentation gives an RTMP example using recovery options:
Free tools Windows power users keep installed
One-click scans. No signup required.
Best Value
- 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.
-f fifo -fifo_format flv -attempt_recovery 1 -recovery_wait_time 1 -drop_pkts_on_overflow 1
In an output setup, these options tell the FIFO muxer to attempt recovery, wait before retrying, and drop packets if its queue overflows rather than allowing processing to fall behind real time. The example is not a guarantee of uninterrupted playback: viewers may see a gap, and YouTube event continuity is not guaranteed if the connection or process fails. Confirm these options are available and behave as expected in your installed FFmpeg build. The example and its context are in this FFmpeg-devel FIFO recovery discussion from March 2024.
Test the stream and monitor it live
Before the event, test with representative movement and audio, not just a static frame or silent opening. Confirm that the video loops, sound behaves correctly at the boundary, and YouTube receives the expected resolution and stream health. During the stream, watch YouTube’s health messages and FFmpeg’s output for connection or encoding errors. YouTube recommends testing before starting and monitoring stream health during the event.
Troubleshoot common failures
- The file races ahead instead of playing live: Put
-rebefore the file’s-i. It is intended here to pace a file input in real time. - Video repeats but audio does not, or the boundary sounds wrong: The
loopfilter repeats video frames only. Set up an audio loop or other audio strategy separately, then test synchronization and the transition. - YouTube does not receive a stream: Recheck the event’s server URL and stream key, output format, and selected encoder settings. A reset key must also be updated in FFmpeg.
- The stream drops during network trouble: FIFO recovery options can attempt to reconnect after some temporary output failures; they cannot guarantee that viewers see no interruption. Check the installed build’s support and inspect FFmpeg and YouTube health messages.
- Frames or audio stall, or YouTube reports poor health: Check that the selected bitrate matches YouTube’s guidance for the chosen codec, resolution, and frame rate, and that the upload connection can sustain it. Test representative audio and movement before restarting the event.
- A command option is rejected: Verify
ffmpeg -versionand that build’s help or documentation. Option availability can depend on the installed version and build.
Or let it run in the cloud
If the goal is a YouTube channel that keeps looping uploaded videos without leaving a computer running, StreamNeo is a cloud alternative: upload a recording or build a playlist, add your YouTube stream key once, and go live. It plays uploaded videos, not a camera feed, and streams to YouTube only. Nothing has to stay on at home; each slot streams your upload as made, up to 4K 60fps, for one flat price per slot. If YouTube drops the stream, StreamNeo attempts automatic recovery. The first day is free with no card. Monthly pricing is $9.99 per month. Visit StreamNeo or start the free first day.
Quick Recap
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.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problems




