Noelle.dev

ffmpeg_concat

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.

Download

ffmpeg_concat.py on GitHub

Requirements

Get help

To display the full set of options:

python ffmpeg_concat.py -h

Usage

Join the MP3 files in the ./album directory into a single MP3 file at ./album.mp3.

Bash

python ffmpeg_concat.py -o ./album.mp3 ./album/*.mp3

Powershell

python ffmpeg_concat.py -o ./album.mp3 (Get-ChildItem ./album/*.mp3)

References