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
VGSources
FFmpeg

How to Make FFmpeg Loop a Playlist for a YouTube Radio Stream

A practical guide to looping a concat-demuxer playlist indefinitely with FFmpeg and sending it to YouTube Live, with encoding guidance and troubleshooting.

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

To loop a local playlist indefinitely in FFmpeg, use -stream_loop -1 before the input it applies to. The command below uses FFmpeg’s concat demuxer with a text file list; it is not a universal command for every file named .m3u. A local music playlist is also different from YouTube’s HLS ingestion format.

Build a playlist FFmpeg can read

First identify the playlist format. The example below expects a concat-demuxer file list, typically a text file such as playlist.txt, with entries in the format the concat demuxer accepts. Do not assume an arbitrary M3U file can be passed to -f concat: the extension alone does not establish which playlist dialect it uses.

For example, a concat list commonly has one file line per media file:

file '/path/to/track 1.mp3'
file '/path/to/track 2.mp3'

Check the concat-demuxer documentation for the syntax supported by your installed FFmpeg build, especially if paths contain quotes or other special characters. Confirm that FFmpeg can open every referenced file and that the files’ codecs and timestamps can transition cleanly. If your source is an M3U, determine its dialect and entry types first; the guidance here does not establish compatibility with every M3U.

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.

Start the loop and send it to YouTube

Use this as a command shape, not a tested, copy-and-run command. Replace the ingest destination with the RTMPS URL and stream key shown in YouTube Live Control Room. Keep the key private, including in scripts, terminal history, and logs.

ffmpeg -re -stream_loop -1 -f concat -safe 0 -i playlist.txt 
  -c:v libx264 -c:a aac -f flv "rtmps://YOUR_YOUTUBE_INGEST/YOUR_STREAM_KEY"
  1. Check the input. The command assumes playlist.txt uses concat-demuxer syntax and that its paths resolve from the FFmpeg process’s working environment. Quote paths according to that list format.
  2. Keep the loop option before its input. -stream_loop is an input option. The value -1 requests infinite looping; 0 means no looping. Put it before the relevant -i, as shown. See the FFmpeg documentation.
  3. Read file input in real time. -re paces file input rather than sending it as fast as possible. FFmpeg’s RTMP example likewise uses real-time pacing, H.264 video, AAC audio, and FLV output. Check that your installed build supports the selected encoders and muxer in the FFmpeg documentation.
  4. Provide video if your setup needs it. This command presumes a video stream is available. For a radio-style stream without video, add a suitable video input, such as a static image, and explicitly map the audio and video streams. Do not assume audio-only input will be accepted in your particular YouTube workflow; verify it there.
  5. Use YouTube’s current ingest details. Copy the RTMPS ingest endpoint and stream key from Live Control Room rather than using the example text. YouTube recommends RTMPS for the ordinary RTMP-family ingest path.

Set encoding to match YouTube’s guidance

YouTube’s encoder guidance, checked October 3, 2026, lists H.264 video and AAC or MP3 audio for its RTMP/RTMPS workflow. It recommends constant bitrate (CBR) and a two-second keyframe interval, with keyframes no more than four seconds apart. Its advanced audio guidance specifies stereo, 44.1 kHz, 128 kbps. These are platform recommendations and guidance, not a guarantee that any particular source file or connection will work.

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.

The example selects H.264 and AAC but does not set a bitrate, resolution, frame rate, keyframe interval, or audio rate. Choose those values for the intended stream and available upload connection, then check YouTube’s current encoder guidance for the appropriate resolution and bitrate. YouTube transcodes live input for viewer formats; test with representative audio and video and watch stream health in Live Control Room.

Do not confuse a local M3U with YouTube HLS ingestion

A local playlist tells FFmpeg what media to read. YouTube’s HLS option is a separate ingestion protocol for HLS-capable encoders; an .m3u filename by itself does not make a local playlist an HLS media playlist.

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.

YouTube’s HLS instructions, checked October 3, 2026, specify 1–4 second segments, TS segment format, a rolling playlist with no more than five outstanding segments, HTTPS POST/PUT, and no byte ranges. YouTube notes that HLS has higher latency because it sends segments rather than a continuous stream. These requirements apply when implementing HLS ingestion, not to a local music playlist passed to FFmpeg. See YouTube’s HLS ingestion instructions.

Test before relying on a 24/7 stream

  1. Run a short private or unlisted test using representative media.
  2. Check that playback advances across a playlist-entry boundary and that audio continues without an unintended gap or failure.
  3. Confirm YouTube receives video if your chosen setup requires it, and check the stream-health indicators in Live Control Room.
  4. Verify that every file is readable by the FFmpeg process and that the playlist paths still work in the environment where the command will run.
  5. Confirm the loop repeats by observing more than one pass through the list. A successful first track does not verify the transition or loop.

YouTube recommends testing before going live. A looping command does not itself establish that you have rights to stream every track, that a particular channel is eligible for every live feature, or that a connection will remain uninterrupted. Check the rights and current account requirements that apply to your use.

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
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common failures

Symptom Likely cause What to check
The playlist is rejected or files are not found. The file is not in concat-demuxer format, an entry path is wrong, or the FFmpeg process cannot access it. Verify the list syntax, working directory, path quoting, and permissions. Confirm the installed FFmpeg build and demuxer support.
The list plays once and stops. -stream_loop -1 is missing, has the wrong value, or is positioned after the input it should affect. Place -stream_loop -1 before the relevant -i.
Playback fails or glitches at a track boundary. Successive files may have incompatible codecs, timestamps, or other properties for a clean transition. Test transitions individually and use media with compatible properties or prepare the files consistently before streaming.
YouTube does not receive the stream. The endpoint or stream key may be incorrect, the key may have been exposed or changed, or the encoder settings may not fit the ingest workflow. Copy the current RTMPS destination and key from Live Control Room, protect the key, and check YouTube’s encoder guidance and stream-health status.
There is audio but no picture, or the ingest is rejected. The input may not contain video, or the chosen account/workflow may not accept the audio-only arrangement. Add and map a suitable video input if needed; verify behavior in a private or unlisted test rather than assuming audio-only acceptance.
The stream stops during a temporary network failure. The connection dropped and the process did not recover successfully. FFmpeg documents FIFO options that attempt recovery after temporary network failure. Configure and test recovery for your environment, then monitor whether reconnection actually succeeds; it cannot guarantee uninterrupted service.
An M3U works locally but not as YouTube HLS input. A local media list is being treated as the separate HLS ingestion protocol. For HLS ingestion, implement YouTube’s segment, rolling-playlist, transport, and HTTPS requirements; the file extension alone is not enough.

For FFmpeg’s input and protocol options, consult its documentation. YouTube’s current RTMP/RTMPS encoder recommendations are in YouTube Help.

Or let it run in the cloud

If the goal is a YouTube channel that keeps looping uploaded recordings without leaving a computer running, StreamNeo is a cloud alternative. Upload your video, add your YouTube stream key once, and go live; StreamNeo loops the uploaded video from the cloud. It streams to YouTube only and does not broadcast from a camera.

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.
  • Nothing has to stay powered on at home; the stream runs in the cloud.
  • Every slot is one flat price for any quality up to 4K 60fps, streaming the upload as made without re-encoding or quality tiers.
  • Automatic recovery attempts to resume if YouTube drops the stream.
  • The first day is free with no card (one free day per account). Monthly billing is $9.99 per month.

See StreamNeo or its plans. Start your free first day with StreamNeo.

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 Patch Notes

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver 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.