October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
DocumentaryTube
FFmpeg

How to Create a Seamless Loop for YouTube Live with FFmpeg

Use FFmpeg’s -stream_loop -1 to repeat a file into YouTube Live, then edit and test the boundary: looping repeats a seam, it does not repair it.

By DocumentaryTube Team 6 min read
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To loop one prerecorded file into YouTube Live, run FFmpeg with -stream_loop -1 before the input and -re to send it at its normal playback rate. That repeats the file; it does not repair the join. A seamless loop depends on editing the first and last frames and audio so they connect naturally, then checking the result before streaming.

What you need before you start

  • FFmpeg installed on a computer that can stay on and connected for the duration of the stream.
  • A prerecorded video you have the rights to stream, with audio and video that are suitable for YouTube Live.
  • A YouTube channel enabled for live streaming, a scheduled or active stream in YouTube Studio, and its stream key. Keep the key private: anyone who obtains it may be able to send video to your stream.
  • An upload connection and encoding capacity that can sustain the resolution, frame rate, and bitrate you choose.

Check YouTube’s current live encoder settings for the selected output. YouTube’s guidance, accessed in 2026, lists RTMP/RTMPS ingest, H.264, H.265 (HEVC), or AV1 video, AAC or MP3 audio, and constant bitrate (CBR). It recommends a two-second keyframe frequency and says not to exceed four seconds. Its bitrate recommendations vary by codec, resolution, and frame rate.

Make the source file loop cleanly

Inspect the join before encoding

Watch the last seconds and first seconds of the file back to back, and listen across the boundary. Look for a jump in position, brightness, motion, or scene; listen for silence, a sudden level change, a musical transient, or a clipped sound. A loop repeats whatever is at the boundary, including a bad cut.

Edit the seam when needed

If the join is jarring, trim or edit the source in a suitable video or audio production workflow, then render a revised file and inspect its join. A crossfade or other transition may help, but the right choice and duration depend on the footage, musical timing, frame rate, and whether the clip must retain its exact duration. FFmpeg’s loop option does not create a crossfade or otherwise correct the seam.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • 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.

Loop a single file with FFmpeg

Replace input.mp4 with your file and the final quoted placeholder with the YouTube ingest URL and stream key shown for your broadcast. The command is a starting template, not a universally tested preset:

ffmpeg -re -stream_loop -1 -i input.mp4 
  -map 0:v:0 -map 0:a? 
  -c:v libx264 -pix_fmt yuv420p -preset veryfast 
  -c:a aac -b:a 128k 
  -f flv "<YouTube ingest URL>/<stream key>"
  1. -re paces file input at its native rate, which is commonly needed when sending a file as a live-style stream.
  2. -stream_loop -1 tells FFmpeg to repeat the input indefinitely. It is an input option, so put it before the corresponding -i.
  3. -map 0:v:0 selects the first video stream. -map 0:a? selects audio if present; the question mark makes that mapping optional. Decide whether the output should have audio and provide an intentional audio source if the file has none.
  4. The example encodes video as H.264 and audio as AAC, then sends the output in FLV format. The example does not set output resolution, frame rate, or video bitrate; choose them to suit the source, your encoding capacity and upload connection, and YouTube’s current guidance.
  5. Use the ingest URL and key supplied for your YouTube stream. Do not expose the key in a public script, screenshot, or shared log.

FFmpeg documents -stream_loop and -re in its official documentation. The command above has not been tested against your media, encoder, network, or channel; confirm its behavior with a test stream before relying on it.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 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.

Choose settings for YouTube’s ingest

Set the encoder’s output to a supported codec and a bitrate appropriate for the chosen output mode. The following H.264 examples are YouTube Help figures accessed in 2026; its table may change, so consult the current encoder settings page before going live.

Output mode H.264 minimum bitrate H.264 recommended bitrate
720p at 30 fps 3 Mbps 8 Mbps
1080p at 30 fps 5 Mbps 14 Mbps
1080p at 60 fps 6 Mbps 17 Mbps

These figures are for the listed H.264 modes, not universal targets for every resolution, frame rate, or ingest codec. Match the video bitrate and output mode to YouTube’s current table; the example command’s illustrative codec settings are not a substitute for that choice.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • 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.

Loop a playlist of multiple files

For compatible files, the concat demuxer can join inputs without re-encoding. Create a trusted text file such as playlist.txt:

file '/media/part1.mp4'
file '/media/part2.mp4'

Pass the playlist to FFmpeg as a concat input, for example:

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • 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
ffmpeg -re -stream_loop -1 -f concat -safe 0 -i playlist.txt 
  -map 0:v:0 -map 0:a? 
  -c:v libx264 -pix_fmt yuv420p -preset veryfast 
  -c:a aac -b:a 128k 
  -f flv "<YouTube ingest URL>/<stream key>"

Use this approach only when the listed files have the same streams and compatible properties. The concat demuxer has timestamp and duration constraints: incompatible streams or inaccurate container durations can produce timestamp gaps or other artifacts. The -safe 0 option allows paths outside the demuxer’s safe subset, so use it only with a playlist you trust.

If inputs differ in codec, time base, stream layout, or other relevant properties, normalize them or use FFmpeg’s concat filter and re-encode. FFmpeg’s concat FAQ explains the distinction: the demuxer can avoid re-encoding for compatible sources, while the filter is suitable when re-encoding is needed. Whichever method you choose, inspect the joins between clips as well as the loop from the end of the final clip back to the beginning of the first.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Test and monitor the live stream

  1. Start a test broadcast with representative motion and audio. YouTube Help advises: “Make sure to test before you start your live stream.”
  2. Check the stream in YouTube’s Live Control Room. Confirm that both picture and sound arrive and that the intended stream appears.
  3. Let the test run through at least one loop boundary. Watch for a pause, duplicated or missing frames, an audio jump, or a timestamp issue.
  4. Monitor YouTube’s stream health and messages during the broadcast. YouTube’s guidance recommends monitoring health; its Live API health messages describe configuration issue categories.

Troubleshoot common loop and ingest problems

  • The stream stops at the end of the file: Confirm that -stream_loop -1 appears before the relevant -i, and that the FFmpeg process is still running. Check its output for continuing frame and timestamp progress through the repeat point.
  • There is no sound: Check that the input contains an audio stream. The optional mapping -map 0:a? does not create audio when none exists. Add an intentional audio source or configure the output for the stream you intend to send.
  • The picture or sound jumps at the loop point: The loop option repeats the file without repairing its ending. Reinspect the last and first frames and audio, edit or render a better join, then test the revised file.
  • A playlist has gaps, artifacts, or stops at a boundary: Verify that files have compatible streams and properties, and check for inaccurate durations. Normalize the sources or use the concat filter with re-encoding when they are not compatible.
  • YouTube reports stream configuration or health problems: Compare the actual codec, bitrate, frame rate, and keyframe cadence with YouTube’s current guidance for your chosen mode. Use the Live Control Room health details and the health message reference to identify the reported issue.
  • The stream is unstable despite suitable settings: Check that the computer and encoder can sustain the selected output and that the upload connection can carry it continuously. Test the actual file and destination before depending on a long-running broadcast.

Or let it run in the cloud

If you want prerecorded video to keep a YouTube channel live without leaving your own computer running, StreamNeo is a cloud service from Yorker Media. 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 is for YouTube streams of uploaded video, not camera broadcasts.

  • Nothing needs to stay on at home; the stream runs from the cloud.
  • Any quality up to 4K 60fps streams as uploaded, with no re-encode, at one flat price per slot.
  • Automatic recovery is included if YouTube drops the stream.
  • The first day is free with no card, one free day per account.

Monthly service is $9.99 per month. See StreamNeo for details, then start your free day.

Copyright and YouTube channel considerations

Only stream recordings and playlist material you have the rights or permission to use. A video being prerecorded, looped, or sent through FFmpeg does not establish that you can broadcast it. YouTube may also apply its channel and monetization policies independently of whether the stream technically works. Review the rules that apply to your channel and content before scheduling a long-running broadcast.

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.

Free tools Windows power users keep installed

One-click scans. No signup required.

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

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

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.