Python script to simplify concatenating media of the same format using FFmpeg.
FFmpeg is an incredible piece of software, able to perform almost any action on any form of visual or audio media. However, that flexibility comes at the cost of having an extremely complex and inscrutible command syntax.
This Python script aims to provide an ergonomic command-line interface for one common operation: joining multiple parts of media into a single file, e.g. tracks from a digital audiobook, songs from an album, or videos from a playlist.
Specifically, this script automates the creation of the input script for FFmpeg's "virtual concatenation script demuxer", then calls FFmpeg with the appropriate arguments to perform a lossless concatenation and output a file.
It should work on all platforms that can run Python and FFmpeg.
ffmpeg_concat.py on GitHub
- Python 3.6 or newer
- FFmpeg (featuring the
- A set of files with matching formats/codecs you want to join.
To display the full set of options:
python ffmpeg_concat.py -h
Join the MP3 files in the
./album directory into a single MP3 file at
python ffmpeg_concat.py -o ./album.mp3 ./album/*.mp3
python ffmpeg_concat.py -o ./album.mp3 (Get-ChildItem ./album/*.mp3)