DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober 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 Now×
Skip to content
DocumentaryTube
FFmpeg

How to Use FFmpeg stream_loop with a YouTube Live Playlist

Loop a local file indefinitely with FFmpeg by placing -stream_loop -1 before its -i input. Learn how -re, YouTube ingest modes, and HLS requirements affect the workflow.

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

To loop a local video indefinitely with FFmpeg, put -stream_loop -1 before that file’s -i input option. For file-based live output, add -re before the same input so FFmpeg reads it at its native frame rate. Then send the output to the ingest URL and protocol selected for your YouTube Live event.

“Playlist” can mean either a program assembled from media files or an HLS .m3u8 manifest. The command below loops one input file; it does not by itself turn a changing HLS playlist into a repeatable program. Treat the command as an illustrative shape, not a tested, universal configuration.

Loop a local file for YouTube Live

For a single local file and an RTMP-style ingest, the general command shape is:

ffmpeg -re -stream_loop -1 -i input.mp4 
  -c:v libx264 -c:a aac 
  -f flv "YOUR_YOUTUBE_INGEST_URL/YOUR_STREAM_KEY"

Replace the input path and output destination with your own. Select the event’s ingest details in YouTube Live Control Room and use the matching output protocol and settings. The example assumes an RTMP-style FLV output. It is not suitable for an HLS event simply by changing the file extension.

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

What each option does

  • -re reads a file at its native frame rate, pacing it for live-style output. FFmpeg documents it as equivalent to -readrate 1. It is intended for file-style inputs; do not add it automatically to a live capture or network stream.
  • -stream_loop -1 repeats the selected input indefinitely. It is an input option, so place it before the corresponding -i. A value of 0 means no looping.
  • -i input.mp4 identifies the input being read. If you have a sequence of clips, make sure the input actually represents that sequence before applying the loop.
  • -c:v, -c:a, -f, and the output URL define encoding, muxing, and delivery. The example’s H.264, AAC, and FLV choices are not guaranteed to suit every source or ingest event.

FFmpeg’s documentation explains input looping and read pacing in its advanced options. YouTube’s Live Streaming API describes the event’s ingestion address and backup address; use the current values for the event rather than copying an example destination. See the YouTube Live Streams API documentation.

Decide what “playlist” means

A program made from several files

If you mean a sequence of documentaries, clips, or other media, -stream_loop repeats the input you give FFmpeg; it does not create a multi-file program list on its own. First use an input representation that contains the desired sequence, then confirm that it behaves as expected at the end of the sequence and when it repeats. Do not assume the transition will be seamless without checking your source and workflow.

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.

An HLS manifest

If you mean an HLS .m3u8 playlist, distinguish a fixed program from a playlist that changes as a live source advances. The FFmpeg input-loop documentation defines how to repeat an input, but it does not establish that an evolving live HLS manifest can be replayed as a finite program. Do not promise that -stream_loop -1 will make every live manifest repeatable.

Match FFmpeg output to YouTube’s ingest mode

The output muxer and destination must match the protocol selected for the YouTube Live event. Check the event’s current Live Control Room settings before starting. A continuous RTMP-style FLV output and HLS ingestion use different delivery workflows.

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.
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.
Decision RTMP-style file output YouTube HLS ingest
Output shape A continuous stream, as in the illustrative FLV/RTMP command A media playlist and separate media segments sent to YouTube
Latency Use the latency options available for the selected event and ingest mode YouTube describes HLS ingestion as higher latency; ultra-low latency is unavailable when HLS is selected
Playlist handling FFmpeg’s input loop and YouTube’s output protocol are separate concerns YouTube requires rolling media playlists and ignores master playlists
Media requirements Follow current YouTube settings for the event’s chosen ingest mode Meet the HLS playlist, segment, container, codec, and HTTPS requirements
When it fits A straightforward local-file loop into a typical live ingest An HLS-specific workflow that justifies its additional constraints

HLS requirements to check

YouTube’s current HLS ingestion help specifies segments of 1–4 seconds, TS segment format, a rolling playlist with no more than five outstanding segments, HTTPS POST or PUT, and no encryption other than HTTPS. The help page says the HLS URL starts with HTTPS.

YouTube’s HLS developer guide describes muxed audio and video in M2TS, names H.264 and HEVC as supported video codecs, supports frame rates up to 60 fps, requires a closed GOP, and lists AAC as a supported audio codec. It also says to send Media Playlists; Master Playlists are ignored. The help page’s audio-codec list differs from the developer guide, so check the current instructions for your specific HLS workflow rather than assuming the lists are interchangeable.

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

HLS is not the ordinary command with a different output filename. It requires segment creation and delivery that meet YouTube’s HLS workflow. The official documentation describes it as a higher-latency option intended for premium streams requiring high quality and resolution.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Set encoding and protect your stream key

The loop options do not set your bitrate, resolution, keyframe spacing, audio configuration, or accepted transport. Choose those against the source media and the current settings for your YouTube event. The example’s libx264 and aac are illustrative codec choices, not a universal recommendation; the available evidence does not establish one bitrate or complete encoding command for every source and event.

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.
  • Confirm the selected ingest protocol and event settings in Live Control Room before configuring FFmpeg.
  • Make the output container, codecs, frame rate, and other encoding options compatible with that ingest mode.
  • Use the event’s current ingestion address and stream key. Do not publish a key in scripts, screenshots, logs, or support posts.
  • If you use HLS, follow its segment, playlist, container, codec, and HTTPS requirements rather than assuming the RTMP example applies.

Check YouTube’s live and content rules

Looping a file does not grant rights to stream its contents. Before broadcasting a documentary or playlist, make sure you have the necessary rights to its video, music, narration, and other included material. YouTube’s copyright and live-stream policies still apply to prerecorded content. Also consider whether a repetitive or minimally transformed broadcast complies with YouTube’s monetization policies; a live connection alone does not establish that content is eligible for monetization. Review the policies that apply to your channel and material before going live.

Troubleshoot common failures

  • The video plays once and stops: Check that -stream_loop -1 appears before the relevant -i. It applies to that input, not automatically to every input in a multi-file workflow.
  • The output runs too quickly or behaves unlike a live stream: For a file input, add -re before its -i so FFmpeg reads at native frame rate. Do not apply it blindly to a live capture or network input.
  • YouTube does not accept the connection: Verify the event’s selected ingest protocol, current ingestion URL, stream key, output muxer, and event settings. An RTMP-style FLV output does not satisfy an HLS event’s segmented HTTPS workflow.
  • HLS segments or playlists are rejected: Check the segment duration and TS format, the rolling media-playlist behavior and outstanding-segment limit, the required HTTPS method, and the media/container constraints in YouTube’s current HLS documentation.
  • A changing HLS playlist does not repeat as expected: Do not assume the loop option converts a live-updating manifest into a finite program. Use a source representation that contains the sequence you intend to replay and verify its behavior.
  • The stream key appears in a log or screenshot: Treat it as exposed and replace or reset it through the relevant YouTube stream settings. Keep the replacement private.

Or let it run in the cloud

If you want a YouTube channel to keep playing uploaded video without leaving a computer on at home, StreamNeo is a cloud option: upload a recording or build a playlist, add your YouTube stream key once, and go live. It loops uploaded videos; it does not stream from a camera. Your computer and home connection do not have to stay on, and StreamNeo automatically recovers if YouTube drops the stream. The same flat price per slot covers any uploaded quality up to 4K 60fps, without re-encoding or quality tiers. The first day is free with no card. Monthly billing is $9.99 per month.

See StreamNeo or start the 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.

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
Crashes, No Sound, or Screen Glitches?Free driver scan
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.