Use FFmpeg’s concat demuxer to describe the audio tracks in order, then pass that playlist to FFmpeg with -stream_loop -1 so it repeats indefinitely. A YouTube Live encoder stream also needs video, so the example below pairs the playlist with a looping still image. It is a command template: replace the file paths and YouTube RTMPS destination with your own, and check the output settings against the options shown in YouTube Live Control Room.
What you need before building the command
- FFmpeg installed with the input formats and encoders you plan to use, including
libx264for the example video output. - A local text playlist and audio files that FFmpeg can read.
- A visual source, such as the still image used below. An audio playlist alone does not provide the video stream in this example.
- The stream URL and stream key for your YouTube broadcast, available in YouTube Live Control Room. Keep the key private.
The sample uses RTMPS, H.264 video, and AAC audio. YouTube’s general encoder guidance lists H.264, H.265/HEVC, and AV1 for video, AAC or MP3 for audio, constant bitrate (CBR), frame rates up to 60 fps, and a recommended two-second keyframe interval that should not exceed four seconds. YouTube recommends RTMPS as a secure extension of RTMP. Use the protocol and settings available for your specific stream in Live Control Room; the command is not a universal preset. YouTube encoder settings
Create the audio playlist file
In the directory where you plan to run FFmpeg, create a plain-text file named audio.ffconcat. Put the format identifier on the first line, exactly as shown, followed by one file entry per track in playback order:
ffconcat version 1.0
file 'music/track-01.mp3'
file 'music/track-02.mp3'
Paths are relative to the working directory from which FFmpeg reads the playlist. Relative paths make the playlist easier to move alongside its media. FFmpeg’s concat script also supports quoted or escaped paths when names contain special characters. The concat demuxer presents inputs as if their packets were muxed one after another, adjusting timestamps between files. For reliable joining, the inputs should have the same streams, codecs, and time bases. Different durations or inaccurate duration metadata can create gaps or artifacts; where appropriate, a duration directive in the playlist can override duration metadata. FFmpeg concat demuxer documentation
Recommended Free Tools
#1 Best Overall
- 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
Run a looping playlist with a still image
Save a suitable image as cover.png, then adapt this template. Replace the RTMPS placeholder with the ingest URL and stream key supplied for your YouTube broadcast; do not publish or share the completed destination because it contains the key.
ffmpeg
-loop 1 -framerate 30 -i cover.png
-re -stream_loop -1 -f concat -safe 0 -i audio.ffconcat
-map 0:v:0 -map 1:a:0
-c:v libx264 -tune stillimage -pix_fmt yuv420p -r 30
-g 60 -b:v 2500k -maxrate 2500k -bufsize 5000k
-c:a aac -b:a 128k -ar 44100
-f flv "<YouTube RTMPS stream URL>"
This command is an encoder-output template; it does not create or schedule a YouTube broadcast in Live Control Room. The example’s 2500k video bitrate is illustrative, not a universal recommendation. For comparison, YouTube’s bitrate guide lists 12 Mbps for H.264 at 1080p and 60 fps; its recommended bitrate varies with codec, resolution, and frame rate. Choose an output appropriate to the intended stream and follow the current guide rather than copying one figure to every setup. YouTube encoder settings and bitrate recommendations
Rank #2
- 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
What the important options do
-loop 1 -framerate 30 -i cover.pngsupplies repeated still-image frames as the first input. Change the frame rate if your selected output requires another value.-rereads the playlist input at its native rate, which is useful when FFmpeg must pace file input for live output.-stream_loop -1requests infinite input looping. These input options appear before the playlist’s-i.-f concat -safe 0 -i audio.ffconcattells FFmpeg to read the text playlist.-safe 0permits paths the concat demuxer would otherwise reject as unsafe; use it only with a playlist you control.-map 0:v:0 -map 1:a:0explicitly selects video from the image input and audio from the playlist input.-g 60sets a 60-frame GOP. At 30 fps, that is a two-second keyframe interval. If you change frame rate, adjust the GOP so its duration matches the keyframe interval required by your YouTube settings.-c:a aac -b:a 128k -ar 44100selects AAC audio at 128 Kbps and 44.1 kHz. YouTube lists those values among its advanced stereo recommendations; set channel layout and other audio details to match your source and stream configuration. YouTube audio settings-f flvis the output container used for this RTMP(S) example.
Choose the right FFmpeg joining method
| Method | Use it when | Trade-off |
|---|---|---|
| Concat demuxer | Your files have matching streams, codecs, and time bases, and you want to join compatible inputs without re-encoding them first. | Differences in stream parameters or inaccurate duration metadata can cause problems at boundaries. |
| Concat filter | You need to re-encode, apply filters such as fades or normalization, or handle inputs that need processing before they can be joined. | It uses a filtering and re-encoding workflow rather than simply joining compatible input packets. |
FFmpeg’s FAQ recommends the concat filter when re-encoding is required. FFmpeg FAQ: concatenating media
Set the stream up in YouTube and verify it
- In YouTube Live Control Room, create or open the broadcast and select the encoder workflow and ingest settings available for it.
- Copy the displayed stream URL and stream key into the FFmpeg destination in the format YouTube specifies. Treat the key like a password.
- Start FFmpeg and check Live Control Room for an incoming signal and stream-health messages. Confirm that both the selected visual and the intended playlist audio are present.
- Test representative tracks and the intended visual before relying on the stream. During a broadcast, monitor stream health and any messages from YouTube. YouTube explicitly recommends testing beforehand and monitoring while live. YouTube live encoder setup guidance
This template does not establish that a particular FFmpeg build, playlist, or account has been tested. Validate the exact command and media on your own setup before using it for an event.
Rank #3
- PLUG IN AND HEAR SOUND IN SECONDS - USB Type-A connector with a 3.5mm stereo headphone output and a separate 3.5mm mono microphone input. No drivers, no software, no external power - the adapter is USB bus-powered and is recognized as a standard USB audio device.
- WORKS ON WINDOWS, MAC AND LINUX - Driverless on Windows 98SE/ME/2000/XP/Server 2003/Vista/7/8, Linux and Mac OSX, and compliant with the USB Audio Device Class 1.0 specification, so any system that supports class-compliant USB audio will see it. Select it as the sound output and input device after plugging it in.
- TWO JACKS, TWO JOBS - The green jack is stereo OUT for headphones or powered speakers; the pink jack is mono microphone IN for a 3.5mm mic. It does NOT support 4-pole headsets on a single combo plug, it does NOT power passive speakers, and it does NOT add surround sound - it is a stereo 2-channel adapter.
- FOR LAPTOPS AND DESKTOPS THAT NEED AN AUDIO PORT BACK - Adds a headphone and mic port to a laptop, desktop, or mini PC whose onboard jack has failed or was never there. Managed and work-issued computers can block new USB audio devices by policy - check with your IT department before ordering for a company machine.
- SABRENT SUPPORT AND WARRANTY - What is in the box: one USB audio sound adapter. Backed by a 1-year limited warranty, extended to 2 years when you register within 90 days on the manufacturer's website.
Check copyright and reused-content considerations
Having files locally or being able to loop them technically does not establish that you have the rights to stream them. Use audio and visuals you created, licensed for this use, or otherwise have permission to broadcast. YouTube’s copyright and monetization rules are separate from FFmpeg configuration; review the applicable YouTube policies for your channel and content before scheduling a long-running stream.
Troubleshoot common problems
The playlist fails to open
- Confirm
ffconcat version 1.0is the exact first line and the file is plain text. - Check each path relative to the directory where FFmpeg is running. Try an absolute path if you need to isolate a path-resolution problem.
- Check quoting or escaping for filenames with spaces or special characters. If using
-safe 0, ensure every playlist entry is trusted.
Playback breaks, gaps, or artifacts occur at track boundaries
- Check that files have compatible streams, codecs, and time bases, as expected by the concat demuxer.
- Inspect duration metadata; inaccurate durations can cause timestamp problems. Use a playlist
durationdirective where appropriate, or switch to a concat-filter workflow if files need processing or re-encoding.
Audio is missing or the wrong input is selected
- Confirm the playlist is input 1 and that
-map 1:a:0points to its first audio stream. - Check that the tracks contain an audio stream FFmpeg can decode and that the playlist entries point to the expected files.
YouTube does not receive a stream
- Check that the RTMPS destination and stream key match the values currently shown in Live Control Room; do not expose the key in logs or public posts.
- Confirm the broadcast is configured for the encoder workflow and protocol used by the command, and check FFmpeg’s output for connection or encoder errors.
The picture or sound does not match the intended output
- Verify both explicit maps and the input order. The still image is input 0; the audio playlist is input 1.
- Confirm the chosen video and audio codecs, resolution, frame rate, bitrate, sample rate, and keyframe interval are accepted for the configured stream.
Or let it run in the cloud
If the goal is an always-on YouTube stream without keeping an FFmpeg computer running 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 broadcast a live camera feed.
Quick Recap
Best Value
- 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
Rank #4
- 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
- Your computer and home connection do not have to stay on.
- Any uploaded quality up to 4K 60fps streams as made, at one flat price per slot, with no re-encode or quality tiers.
- It automatically recovers 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 start the free 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.

