Skip to content

Instantly share code, notes, and snippets.

@jeffchannell
jeffchannell / ffmerge.sh
Last active November 3, 2021 03:33
Merge multiple files with chapters using ffmpeg
#!/usr/bin/env bash
# Usage: FFMETADATA=/path/to/metadata FFOUTPUT="My Output File.mp4" ./ffmerge.sh /path/to/*.wav
set -eo pipefail
# arguments required
if [ $# -eq 0 ]
then
>&2 echo "one or more files required"
exit 1
fi
filelist=$(mktemp)
@jeffchannell
jeffchannell / chapters.sh
Last active January 17, 2025 11:56
Create FFMETADATA for ffmpeg from multiple files.
#!/usr/bin/env bash
# FFMETADATA Chapter generator
# Pass multiple media files to this script to generate a generic FFMETADATA file
# Usage: ARTIST="My Artist" ALBUM="My Album" ./chapters.sh /path/to/*.wav > my.metadata
set -eo pipefail
ARTIST="${ARTIST:-ARTIST}"
ALBUM="${ALBUM:-ALBUM}"
end_stamp=0
begin_stamp=0
i=1