Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › concat demuxer

How to Build an FFmpeg Playlist from Videos in a Directory for YouTube

By Freedom251 Team · · 5 min read

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

To combine videos in a folder in a specific order, make a text playlist with one file entry per clip, then pass it to FFmpeg’s concat demuxer. Use -c copy only when the files have matching streams and compatible properties; otherwise, normalize them or use the concat filter and re-encode. For a YouTube upload, MP4 with H.264 video and AAC-LC audio is a practical target.

1. Put the clips in the order you want

The playlist determines playback order; do not rely on how your file manager or shell happens to list the directory. Rename files with zero-padded numbers if useful, such as 01_intro.mp4, 02_demo.mp4, and 03_end.mp4. Check the sequence before encoding.

As an Amazon Associate I earn from qualifying purchases.

2. Create the FFmpeg concat playlist

In the directory containing the clips, create a plain-text file named playlist.txt. Use one relative filename on each line:

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.
file '01_intro.mp4'
file '02_demo.mp4'
file '03_end.mp4'

You can also include the optional header shown below:

#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
ffconcat version 1.0
file 'clip_001.mp4'
file 'clip_002.mp4'
file 'clip_003.mp4'

Save the file as plain text, not as a document with formatting. The file entries are processed sequentially. FFmpeg’s concat demuxer adjusts timestamps between files, but inaccurate duration metadata can cause artifacts. See the FFmpeg concat demuxer documentation.

3. Join compatible files without re-encoding

Open a terminal or command prompt in the folder containing both the playlist and clips, then run:

ffmpeg -f concat -safe 0 -i playlist.txt -c copy combined.mp4

This copies the audio and video streams into a new container rather than encoding them again. It is the quick, quality-preserving option when inputs are compatible. FFmpeg’s requirement is explicit: “All files must have the same streams (same codecs, same time base, etc.).” Stream copying does not convert mismatched files into compatible ones.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
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

The -safe 0 option permits paths that the concat demuxer’s safe-path default may reject. For a playlist containing only simple, safe relative filenames, try -safe 1, the default, or omit the option. Use -safe 0 only with a playlist you control; do not casually run a list containing untrusted or unexpected paths.

4. Choose the right method for your files

Method Use it when Trade-off
Concat demuxer with -c copy The input files have matching streams and compatible properties, and you want to avoid re-encoding. It cannot fix differences in codecs, time bases, resolutions, frame rates, or audio layouts. Duration metadata problems can cause join artifacts.
Concat filter with re-encoding The files need to be brought to consistent properties, or re-encoding is acceptable. Requires an encode and appropriate filter settings; filtered output cannot use -c copy.
File-level concat protocol Only when the specific format supports joining at the file level. It is not a general substitute for the concat demuxer on arbitrary video files.

FFmpeg’s FAQ recommends the concat filter when re-encoding is needed. The filter graph must map the inputs and make their relevant properties compatible. Consult the FFmpeg concatenation FAQ and concat filter documentation for filter syntax. A single filter command cannot safely be prescribed for every folder: the correct scaling, frame-rate, pixel-format, and audio settings depend on the source clips and intended output.

5. Re-encode for a YouTube-oriented output when needed

If the source streams are already aligned but you need to encode rather than copy, this is an illustrative starting point:

Rank #3
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.
ffmpeg -f concat -safe 0 -i playlist.txt 
  -c:v libx264 -pix_fmt yuv420p -crf 18 -preset medium 
  -c:a aac -b:a 192k -movflags +faststart combined.mp4

This example produces an MP4 using H.264 video and AAC audio. It is not a universal preset: -crf 18 is a quality-oriented example, not a guaranteed bitrate or file size. It also does not normalize differing resolutions, frame rates, time bases, or audio channel layouts. For mixed inputs, explicitly normalize each input in a filter graph or preprocess clips to matching properties before concatenating.

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

YouTube’s upload encoding recommendations specify MP4 and H.264, progressive scan, and recommend matching the frame rate used during recording. AAC-LC is among the listed audio choices, and YouTube recommends 48 kHz audio. It recommends SDR BT.709. Treat its bitrate figures as platform recommendations, not mandatory minimums:

SDR resolution Standard frame-rate recommendation High-frame-rate recommendation
1080p 8 Mbps 12 Mbps
720p 5 Mbps 7.5 Mbps

YouTube lists common frame rates including 24, 25, 30, 48, 50, and 60 fps, while also accepting other rates. Its video format guidance recommends retaining the native frame rate and aspect ratio. The player adapts to the uploaded aspect ratio, so do not stretch footage simply to force it into 16:9.

Rank #4
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³

6. Check the combined file before uploading

  • Play the start, every join, and the end; listen for gaps and check that audio stays in sync.
  • Confirm the output’s dimensions, duration, frame rate, and audio playback.
  • If you changed encoding settings, verify that the resulting format is appropriate for your intended YouTube upload.

These checks can catch problems before upload; they do not guarantee how quickly YouTube will finish processing every quality level.

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

7. Troubleshoot common concat problems

FFmpeg rejects a filename as unsafe

Use simple relative filenames in the playlist and run FFmpeg from their directory. If the list needs paths that safe mode rejects, -safe 0 relaxes path checks; use it only with a playlist you trust.

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

The output has glitches, black frames, audio gaps, or FFmpeg fails

Compare the files’ codecs, stream count and layout, time bases, and duration metadata. The concat demuxer requires matching streams, and inaccurate duration information can introduce artifacts. Normalize the clips to consistent properties or use the concat filter and re-encode.

Best Value
Sale
SANDISK 1TB Extreme Portable SSD, Up to 2000MB/s Transfer Speeds-New Model | External Solid State Drive, IP65 Water & Dust Resistant, Up to 3M Drop Protection, 256-bit AES Encryption, USB-C 3.2 Gen 2
  • NEARLY 2X FASTER THAN OUR PREVIOUS GENERATION(8) – move 1,000 high-res photos in under 60 seconds(6) with up to 2000MB/s transfer speeds(2).
  • IP65 RATING AND UP TO 3M DROP PROTECTION(3) – protects against spills and drops.
  • POCKET-SIZED – fits easily in pockets and small bags.
  • SPACE TO OWN YOUR AI CONTENT – speed and capacity to download your high-res clips and photo edits.
  • 256-BIT AES ENCRYPTION(4) – helps keep private files secure with password protection.

The clips play in the wrong order

Edit playlist.txt so each file line appears in the intended sequence. Do not assume directory enumeration or wildcard expansion produces the order you want.

The job takes longer or produces a larger file than expected

Stream copying avoids another encode only when the inputs are compatible. Re-encoding adds processing and can change both quality and file size; the result depends on source material and settings.

YouTube does not show all quality options immediately

Higher-quality versions can take longer to process after upload. Avoid treating the initial playback options as a final indication of the uploaded file’s available quality.

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

Or let it run in the cloud

If your goal is to keep a YouTube channel live with pre-recorded videos, StreamNeo is a separate option from building and uploading a combined file: upload a recording or build a playlist, add your YouTube stream key once, and go live. StreamNeo loops the uploaded videos from the cloud, so nothing has to stay on at home. It streams what you upload at up to 4K 60fps at one flat price per slot, with no re-encode or quality tiers, and automatically recovers if YouTube drops the stream. The first day is free with no card. Monthly pricing is $9.99 per month. StreamNeo is for YouTube streams from uploaded videos, not live camera feeds. 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.

concat demuxerFFmpegvideo editingvideo encodingYouTube

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.