DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon 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×
FREEDOM251

Freedom251 › Blog › concat demuxer

How to Loop MP4 Files to YouTube Live with FFmpeg’s Concat Demuxer

By Freedom251 Team · · 5 min read

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.

To loop a sequence of local MP4 files into a YouTube Live broadcast, put the files in an FFmpeg concat playlist, then use FFmpeg to read the playlist in real time and send it to YouTube’s current RTMPS ingest address. Stream copy works only when the files have matching streams, codecs and time bases; otherwise, normalize or re-encode them. Test the complete setup before broadcasting.

What you need before starting

  • FFmpeg installed on a computer that can remain on and connected throughout the broadcast.
  • The MP4 files in the intended playback order.
  • A YouTube Live stream with its current RTMPS ingestion address and stream name or key from Live Control Room.
  • A stable upload connection capable of sustaining your chosen output bitrate.

The concat demuxer joins files by adjusting timestamps; it does not convert incompatible media into a common format. The command below is an illustrative starting point, not a tested command. Check the options against your installed FFmpeg version and test with your own files before going live.

As an Amazon Associate I earn from qualifying purchases.

1. Create the concat playlist

In a text editor, create a file named playlist.ffconcat in the directory containing the MP4 files. The header must be the exact first line for FFmpeg to recognize the file automatically. List each video in playback order:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
ffconcat version 1.0
file 'clip-01.mp4'
file 'clip-02.mp4'
file 'clip-03.mp4'

Use paths relative to the playlist where practical. Quote paths containing spaces or special characters and check that the names and capitalization match the files. The -safe 0 option used later permits paths outside the concat demuxer’s safe subset; avoid it when safe relative paths are sufficient.

#1 Best Overall
Sandisk 2TB Extreme Portable SSD, Up to 1050MB/s, USB-C, USB 3.2 Gen 2, IP65 Water and Dust Resistance, Updated Firmware, External Solid State Drive, SDSSDE61-2T00-G25
  • Get NVMe solid state performance with up to 1050MB/s read and 1000MB/s write speeds in a portable, high-capacity drive(1) (Based on internal testing; performance may be lower depending on host device & other factors. 1MB=1,000,000 bytes.)
  • Up to 3-meter drop protection and IP65 water and dust resistance mean this tough drive can take a beating(3) (Previously rated for 2-meter drop protection and IP55 rating. Now qualified for the higher, stated specs.)
  • Use the handy carabiner loop to secure it to your belt loop or backpack for extra peace of mind.
  • Help keep private content private with the included password protection featuring 256‐bit AES hardware encryption.(3)
  • Easily manage files and automatically free up space with the SanDisk Memory Zone app.(5). Non-Operating Temperature -20°C to 85°C

2. Get the current YouTube ingest details

  1. Open YouTube Live Control Room and create or select the stream you intend to use.
  2. Copy the current RTMPS ingestion address and stream name/key shown for that stream.
  3. Keep the stream key private. Treat it like a password: do not put it in a public script, screenshot, chat or post.

YouTube’s API documentation distinguishes the ingestion address from the stream name. The command below combines them as STREAM_URL/STREAM_NAME; use the exact values YouTube provides, not a guessed or stale endpoint.

3. Check whether stream copy is suitable

With -c copy, FFmpeg passes the media streams through without re-encoding. That is faster and avoids another lossy encode, but it is appropriate only when the playlist’s files have matching streams, codecs and time bases and the resulting streams are accepted by the output. Different resolutions, frame rates, audio layouts or other stream differences can cause concat errors, glitches or an unusable output.

Rank #2
Sandisk 1TB Portable SSD, Up to 800MB/s Read Speeds, Black (Old Model) | External Solid State Drive, Compatible with Laptops & Tablets, Up to 2M Drop Protection, USB 3.2 Gen 2, USB-C to USB-A Cable
  • Solid state performance with up to 800MB/s read speeds in a portable drive. (Based on internal testing; performance may be lower depending on host device, interface, usage conditions and other factors. 1MB=1,000,000 bytes.)
  • Back up your content and memories on a storage solution that fits seamlessly into your mobile lifestyle.
  • Take it with you on your adventures—up to two-meter drop protection means this durable drive can take a beating. (Based on internal testing.)
  • Secure it to your belt loop or backpack for extra peace of mind thanks to the tough rubber hook.
  • From Sandisk, a brand professional photographers trust to take on assignments.

Inspect the files before the broadcast and compare their video and audio streams. Also watch for inaccurate duration metadata: the demuxer uses durations to place later files on the timeline, so incorrect values can cause gaps or artifacts at transitions. The concat demuxer supports a duration directive to override inaccurate duration metadata when you know the correct duration.

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.

4. Start FFmpeg and send the playlist to YouTube

For compatible files, substitute the exact RTMPS endpoint and stream name/key from Live Control Room for the placeholder below:

Rank #3
SSK Portable SSD 500GB External Solid State Hard Drive USB C Up to 1050MB/s
  • Capacity Display Variance: 500GB external ssd often appears as around 465GB on Windows. MacOS can show full 500 GB capacity. This is binary calculation difference and doesn’t affect SSD hard drive actual physical storage
  • 1050 MB/s Speed: Instantly access to your files with blazing-fast 10Gbps external SSD read up to 1050MB/s and write up to 1000MB/s. LED Light indicates USB SSD instant activity
  • Data Security: Solid state drives S.M.A.R.T. health diagnostics​ and adaptive TRIM optimizing data block management ensures consistent write speeds and extends the longevity of the portable SSD
  • USB-C & USB-A Cable: Both cables featuring rapid USB 3.2 Gen2, this USB SSD effortlessly bridges devices, enabling seamless cross-platform file transfers and backup between computers, smartphones, tablets and iPhone
  • Always Fast: No slowdowns for large file transfers. With SLC caching (25% of current available capacity allocated as high-speed cache), this external SSD delivers steady 10Gbps for transfers within the cache capacity
ffmpeg -re -stream_loop -1 -f concat -safe 0 -i playlist.ffconcat 
  -c copy -f flv "rtmps://INGESTION_URL/STREAM_NAME"
  • -re paces file input in real time rather than sending it as fast as the computer can read it.
  • -stream_loop -1 requests an infinite loop of the input.
  • -f concat selects the concat demuxer for the playlist.
  • -safe 0 allows paths outside the demuxer’s safe subset; prefer safe relative paths where possible.
  • -c copy avoids re-encoding and requires compatible inputs.
  • -f flv selects the output container used for this RTMP/RTMPS workflow.

Start the encoder and then start the broadcast in YouTube when the incoming stream is detected. Keep FFmpeg running for the duration of a do-it-yourself broadcast; stopping the process ends its contribution to the live stream.

5. Set and test stream quality

YouTube’s current guidance for RTMP/RTMPS lists H.264, H.265/HEVC and AV1 video codecs, frame rates up to 60 fps, CBR bitrate encoding, and AAC or MP3 audio. It recommends a two-second keyframe frequency and says not to exceed four seconds. These settings matter when encoding or configuring the output; with -c copy, FFmpeg is not changing the source’s encoding settings.

Rank #4
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400) | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
  • Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

For 1080p at 30 fps, YouTube Help’s guidance accessed in 2026 lists 5 Mbps as the H.264 minimum and 14 Mbps as the recommended bitrate. Choose a bitrate your actual upload connection can sustain reliably; a nominal speed-test result does not guarantee stable capacity throughout a broadcast. RTMPS is YouTube’s recommended secure form of RTMP.

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

YouTube Help advises: “Make sure to test before you start your live stream. Tests should include audio and movement in the video similar to what you’ll be doing in the stream.” Test representative files, transitions and sound, and check YouTube’s stream-health feedback before relying on the setup.

Best Value
Sale
Samsung T7 Portable SSD 1TB Titan Gray, USB 3.2 Gen 2, Up to 1,050MB/s | Reliable External Solid State Drive Storage for Gaming, Students, Professionals (MU-PC1T0T/AM)
  • MADE FOR THE MAKERS: Create; Explore; Store; The T7 Portable SSD delivers fast speeds and durable features to back up any endeavor; Build your video editing empire, file your photographs or back up your blogs all in an instant
  • SHARE IDEAS IN A FLASH: Don’t waste a second waiting and spend more time doing; The T7 is embedded with PCIe NVMe technology that brings fast read and write speeds up to 1,050/1,000 MB/s¹, making it almost twice as fast as the T5
  • ALWAYS MAKE THE SAVE: Compact design with massive capacity; With capacities up to 4TB, save exactly what you need to your drive – from large working files to game data and everything in between
  • ADAPTS TO EVERY NEED: Whether using a PC or mobile phone, count on the T7 for extensive compatibility²; It’s a true team player when it comes to heavy-duty application usage or file-saving
  • HI RESOLUTION VIDEO RECORDING: Record Ultra High Resolution (4K 60fs) videos directly onto the T7 Portable SSD with your favorite camera or mobile devices; Supports iPhone 15 Pro Res 4K at 60fps video and more³
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When to normalize or re-encode instead

If the MP4s differ in stream layout, codecs or time bases, do not assume that adding them to one concat playlist will make stream copy work. Prepare compatible files first or use FFmpeg’s concat filter and re-encode the result. The concat filter is the FFmpeg FAQ’s recommended route when re-encoding is needed. Choose consistent output resolution, frame rate, video and audio codecs, and audio layout, then test the resulting playlist and stream. Exact filter settings depend on the properties of your source files, so inspect them rather than applying a one-size-fits-all command.

Troubleshooting

  • Concat errors or glitches at transitions: Compare the files’ stream layouts, codecs and time bases. Check duration metadata, since inaccurate durations can shift later timestamps; use the demuxer’s duration directive to override a known incorrect duration.
  • Different resolutions, frame rates or audio formats: Stream copy may not work cleanly. Normalize the files or use the concat filter and re-encode.
  • YouTube shows no incoming stream or rejects the connection: Verify the current RTMPS address, stream name/key and protocol in Live Control Room. Check for mistyped or stale credentials and confirm that the endpoint and TLS connection are correct.
  • Dropped frames or poor stream health: Check actual upload capacity, lower the output bitrate or resolution if necessary, and test again while monitoring YouTube’s stream-health feedback.
  • No sound: Check that each MP4 has an audio stream and that the output mapping and audio codec are compatible. YouTube lists AAC and MP3 for RTMP/RTMPS ingestion.

Or let it run in the cloud

With StreamNeo, upload your recording or build a playlist, add your YouTube stream key once, and go live. It loops uploaded videos from the cloud, so your computer and home connection do not have to stay on. Each slot supports the uploaded quality up to 4K 60fps at one flat price per slot, with no re-encode or quality tiers, and automatic recovery if YouTube drops the stream. The first day is free with no card.

Monthly: $9.99 per month. See StreamNeo for details, or start your free first day.

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

Copyright and channel considerations

Looping a file successfully does not establish that you have the rights to broadcast its music, video or other included material. Use content you created or are authorized to stream, and check YouTube’s copyright rules before airing it. A technically continuous stream also does not guarantee monetization or channel eligibility: review YouTube’s current rules on reused content and monetization separately, especially if the playlist repeats material with little original contribution.

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.

concat demuxerFFmpeglive streamingMP4RTMPSYouTube Live

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.

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
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.