To create an mp3 file with some ID3 metadata. This example is to create files corresponding to chapters of an audiobook. Shell script:
#!/bin/sh# Convert to mp3 with metadata. Use some defaults, pass some parameters.
# Parameters: 1: input file name, 2: chapter/track, 3: start time
ffmpeg -ss $3 -i "$1" -metadata artist="Some artist" -metadata album="An album name" -metadata genre="Books & Spoken" -metadata title=$2 -metadata track=$2 "Chapter $2.mp3"
Note that the first parameter is expected to be passed in in quotes if it has spaces.