;FFMETADATA1
title="Title"
artist=Artist
album_artist=Artist
album=Album
copyright=Copyright 2019
track=01
genre=(186)
date=2019
encoder=Lavf58.29.100
[CHAPTER]
TIMEBASE=1/1
START=0
END=330
title=chapter \#1
[CHAPTER]
TIMEBASE=1/1
START=330
END=1530
title=chapter \#2
echo "0:25:30" | awk -F: '{ print ($1 * 3600) + ($2 * 60) + $3 }'
ffmpeg -i in.mp3 -i id3tags.txt -map_metadata 1 -c:a copy -id3v2_version 3 -write_id3v1 1 out.mp3
Put chapter data in a file (in the example below file is named chapters):
0:0:14 0:2:15 глава едно
0:2:16 0:4:10 глава две
0:4:11 0:6:40 глава три
Format is:
start_time end_time chapter_title
Values are tab delimited. Run script as below:
./chptr title="my podcast" artist="the artist formerly known as Prince" \
pubdate="2019" copyright="cc-by" \
track="02" mp3=myfile.mp3 meta=chapters
Arguments:
title - episode tile
artist - podcast name
copyright - copyright notice
track - episode number
pubdate - publication date
mp3 - audio file to be chaptered
meta - name of the file containing chapter data
Order of the arguments does not matter. Look for output file with_chapters.mp3