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
Mountain View desk6 min

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

Learn how to loop a compatible playlist indefinitely with FFmpeg and send it to YouTube Live, with encoding guidance, preflight checks, and fixes for common failures.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To loop a playlist indefinitely with FFmpeg, use -stream_loop -1 before the input it applies to. For a concat-demuxer list, the command shape is ffmpeg -re -stream_loop -1 -f concat -safe 0 -i playlist.txt .... An arbitrary file ending in .m3u is not necessarily compatible with that input format: first identify the playlist dialect and confirm FFmpeg can open its entries.

Choose the right kind of playlist input

A local playlist and YouTube’s HLS ingestion playlist serve different purposes. A local playlist tells FFmpeg which media files or URLs to read. HLS ingestion is a separate YouTube protocol involving streamed segments and a rolling playlist; naming a local file .m3u does not make it an HLS stream or prove FFmpeg can read it as a concat list.

As an Amazon Associate I earn from qualifying purchases.

The command below uses FFmpeg’s concat demuxer, which expects its own text file-list format. Use it only if your input is actually written in that format. Check the installed FFmpeg build and the playlist syntax before relying on it for a continuous broadcast. FFmpeg’s rolling documentation describes input options and stream looping.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Example concat-demuxer list

A concat list typically contains one file directive per media file, for example:

#1 Best Overall
Focusrite Scarlett Solo 3rd Gen USB-C Audio Interface
  • Pro performance with great pre-amps - Achieve a brighter recording thanks to the high performing mic pre-amps of the Scarlett 3rd Gen. A switchable Air mode will add extra clarity to your acoustic instruments when recording with your Solo 3rd Gen
  • Get the perfect guitar and vocal take with - With two high-headroom instrument inputs to plug in your guitar or bass so that they shine through. Capture your voice and instruments without any unwanted clipping or distortion thanks to our Gain Halos
  • Studio quality recording for your music & podcasts - Achieve pro sounding recordings with Scarlett 3rd Gen’s high-performance converters enabling you to record and mix at up to 24-bit/192kHz. Your recordings will retain all of their sonic qualities
  • Low-noise for crystal clear listening - 2 low-noise balanced outputs provide clean audio playback with 3rd Gen. Hear all the nuances of your tracks or music from Spotify, Apple & Amazon Music. Plug-in headphones for private listening in high-fidelity
  • Everything in the box: Includes Pro Tools Intro+, Ableton Live Lite, Cubase LE, and Hitmaker Expansion: a suite of essential effects, powerful software instruments, and easy-to-use mastering tools
file '/media/track-01.mp4'
file '/media/track-02.mp4'

These are illustrative paths, not a guarantee that any M3U file can be used this way. Follow the concat demuxer’s syntax for your installed build, quote paths appropriately, and ensure the FFmpeg process has permission to read every entry. If your M3U contains URLs or uses a different playlist dialect, determine how that format should be supplied rather than simply changing the filename extension.

Run the loop with FFmpeg

For a concat-format list, this is a starting command shape, not a tested, ready-to-run configuration:

Rank #2
Focusrite Scarlett Solo 4th Gen USB-C Audio Interface
  • The new generation of the songwriter's interface: Plug in your mic and guitar and let Scarlett Solo 4th Gen bring big studio sound to wherever you make music
  • Studio-quality sound: With a huge 120dB dynamic range, the newest generation of Scarlett uses the same converters as Focusrite’s flagship interfaces, found in the world's biggest studios
  • Find your signature sound: Scarlett 4th Gen's improved Air mode lifts vocals and guitars to the front of the mix, adding musical presence and rich harmonic drive to your recordings
  • All you need to record, mix and master your music: Includes industry-leading recording software and a full collection of record-making plugins
  • Everything in the box: Includes Pro Tools Intro+, Ableton Live Lite, Cubase LE, and Hitmaker Expansion: a suite of essential effects, powerful software instruments, and easy-to-use mastering tools
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. Replace the destination. In YouTube Live Control Room, use the RTMPS ingest address and stream key for your broadcast. Substitute them for the example destination; do not publish the key in a public script, screenshot, or log.
  2. Keep the loop option before its input. -stream_loop is an input option. The value -1 requests infinite looping; 0 means no loop. Put it before the -i for the input to repeat. FFmpeg documents this behavior in its command-line reference.
  3. Use real-time pacing for file input. -re reads file input at a real-time rate instead of sending it as fast as possible. FFmpeg’s protocol documentation includes an RTMP example using real-time input, H.264 video, AAC audio, and FLV output.
  4. Check that the media has the streams you intend to send. The example encodes video with libx264 and audio with aac. If the source is audio-only but your setup needs video, add a suitable video input, such as a static image, and explicitly map the intended audio and video streams. Do not assume a particular YouTube account or workflow accepts audio-only ingest; confirm it in your current setup.
  5. Check transitions between files. Entries may differ in codecs, timestamps, duration, or stream layout. Test that FFmpeg advances across each boundary cleanly; one playlist that opens successfully does not establish that every transition will work.

Set YouTube-compatible encoding and pacing

YouTube’s current RTMP/RTMPS encoder guidance recommends RTMPS and lists H.264 video, AAC or MP3 audio, constant bitrate (CBR), and a two-second keyframe interval (not exceeding four seconds). Its advanced audio guidance specifies stereo at 44.1 kHz and 128 kbps. These are YouTube recommendations, not guarantees that a particular bitrate or resolution suits your connection. Choose video resolution and bitrate based on the source and your sustained upload capacity, and configure CBR and keyframes in the encoder settings when needed. See YouTube’s live encoder settings.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

YouTube transcodes live input into viewer formats. Before a long broadcast, test representative audio and video and monitor YouTube’s stream health. A successful FFmpeg connection alone does not prove that playback is healthy for viewers.

Rank #3
Focusrite Scarlett 2i2 4th Gen USB-C Audio Interface
  • The new generation of the artist's interface: Connect your mic to Scarlett's 4th Gen mic pres. Plug in your guitar. Fire up the included software. Start making your first big hit
  • Studio-quality sound: With a huge 120dB dynamic range, the newest generation of Scarlett uses the same converters as Focusrite’s flagship interfaces, found in the world's biggest studios
  • Never lose a great take: Scarlett 4th Gen's Auto Gain sets the perfect level for your mic or guitar, and Clip Safe prevents clipping, so you can focus on the music
  • Find your signature sound: Air mode lifts vocals and guitars to the front of the mix, adding musical presence and rich harmonic drive to your recordings
  • With Scarlett 4th Gen, you have all you need to record, mix and master your music: Includes industry-leading recording software and a full collection of record-making plugins

Do not use the local-loop command for YouTube HLS ingestion

YouTube’s HLS option is intended for an HLS-capable encoder and has different delivery requirements from a local media playlist. YouTube’s current instructions call for 1–4 second segments in TS format, a rolling playlist with no more than five outstanding segments, HTTPS POST/PUT requests, and no byte ranges. YouTube also notes that HLS has higher latency because it sends segments rather than a continuous stream. These rules apply to the HLS ingestion workflow, not to a local concat list passed to FFmpeg. See YouTube’s HLS ingest instructions.

Preflight the broadcast

  • Confirm that the list uses the input format you selected and that each entry is accessible to the FFmpeg process.
  • Check spaces and special characters in paths against the syntax of that playlist format; quote or escape them as required.
  • Verify that -stream_loop -1 appears before the relevant -i.
  • Use the ingest endpoint and key shown in YouTube Live Control Room, and protect the key.
  • Run a short private or unlisted test. Confirm that media advances across an entry boundary, audio continues, video appears when required by your setup, and YouTube reports healthy ingest. YouTube recommends testing before going live in its encoder guidance.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common failures

FFmpeg rejects the playlist

Likely cause: the file is an M3U dialect or another format rather than a concat-demuxer list. Fix: verify the playlist’s actual syntax and choose a compatible input method for the installed FFmpeg build. The .m3u extension alone does not establish compatibility.

Rank #4
M-AUDIO M-Track Duo USB Audio Interface
  • Podcast, Record, Live Stream, This Portable Audio Interface Covers it All - USB sound card for Mac or PC delivers 48kHz audio resolution for pristine recording every time
  • Be ready for anything with this versatile M-AUDIO interface - Record guitar, vocals or line input signals with two combo XLR / Line / Instrument Inputs with phantom power
  • Everything you Demand from an Audio Interface for Fuss-Free Monitoring - 1/4" headphone output and stereo 1/4" outputs for total monitoring flexibility; USB/Direct switch for zero latency monitoring
  • Get the best out of your Microphones - M-Track Duo’s transparent Crystal Preamps guarantee optimal sound from all your microphones including condenser mics
  • The MPC Production Experience - Includes MPC Beats Software complete with the essential production tools from Akai Professional

The playlist plays once instead of repeating

Likely cause: -stream_loop -1 is missing, has a different value, or is placed after the input it should affect. Fix: put it before that input’s -i and check the command line’s input order.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Playback stops or breaks at a file boundary

Likely cause: an entry cannot be opened, or successive files have incompatible streams or timestamps. Fix: test entries and transitions individually, verify paths and permissions, and inspect the FFmpeg output for the file where the failure begins.

Best Value
USB C Audio Interface for Recording Music, Streaming, Podcasting, Silver
  • ✔️[High-fidelity sound quality, accurate sampling] The Synido 2x2 audio interface uses a high-quality independent audio chip to reduce recording latency, support 24-bit depth and 48kHz sampling rate, and ensure every detail is restored. Whether it is recording or live broadcasting, it can provide a clear and natural sound quality experience
  • ✔️[Three monitoring modes, easy to switch] The audio interface provides three monitoring modes to meet different needs. In Stereo mode, independent left and right channels present the original input (such as a microphone or instrument), which is suitable for accurate recording. Mix mode can mix input audio and computer audio in real-time, which is suitable for live broadcast or recording, and is easy to adjust instantly. USB mode only monitors computer audio, which is suitable for post-editing or audio processing. Whether it is recording, live broadcast, or post-production, the three modes can be easily switched to make audio creation more efficient and professional
  • ✔️[User-friendly design] The audio interface is intuitively designed, and equipped with three independent control areas, and the XLR interface supports 6.35mm and XLR microphones, which are compatible with various devices. The green, orange, and red LED lights display the volume level, helping you to grasp the volume status at any time and avoid distortion. Supports easy switching between Line In and instrument input, adapts to different devices, reduces interference and distortion, and does not need to adjust gain frequently, improving efficiency
  • ✔️[Professional 48V phantom power] Synido audio interface is equipped with 48V phantom power switch and supports 48V dynamic microphone with excellent noise reduction performance, provides a highly sensitive recording experience, accurately picks up sound, and effectively reduces noise interference, ensuring clear and stable sound quality output
  • ✔️[Lightweight and portable, plug and play, create at any time] The USB audio interface weighs only 300g and measures 14 x 11.5x 4.5 cm. It is compact and portable and can be taken anywhere anytime. Equipped with a 3.5mm to 6.35mm adapter and a USB-C to USB-A data cable, you can easily use it by directly connecting to your mobile phone or computer

YouTube does not show a healthy stream

Likely cause: the destination/key is wrong, the connection is unstable, or the outgoing media does not match the intended ingest configuration. Fix: check the current Live Control Room settings, confirm the selected codecs and stream health, and repeat a short test before the broadcast.

A temporary network interruption ends the broadcast

FFmpeg documents FIFO options for attempting recovery after temporary network failures in its protocol documentation. They are an attempt at recovery, not a promise of uninterrupted service. Configure and test recovery in the actual environment, then monitor whether the connection resumes successfully.

Rights and 24/7 operation

Looping media technically does not grant permission to broadcast it. Before streaming music or other recordings, confirm that you have the necessary rights for both the content and the intended use. A playlist that runs successfully can still raise copyright or YouTube monetization issues; technical setup is separate from platform policy and licensing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A local FFmpeg process also depends on the machine and network running it. If the computer or connection stops, the process cannot continue from that location. A VPS is one possible way to host a process away from home, but compare storage, bandwidth, region, and cost for your own workload; no particular provider or uninterrupted-availability claim is established here.

Or let it run in the cloud

For a YouTube stream built from uploaded videos rather than a camera feed, StreamNeo is a cloud alternative: upload a recording or build a playlist, add your YouTube stream key, and go live. Nothing has to stay on at home; it streams the uploaded quality up to 4K 60fps at one flat price per slot, with automatic recovery if YouTube drops the stream. The first day is free with no card. Monthly pricing is $9.99 per month. Start your free 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 the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
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.