I have m4a, m4b, and mp4 versions of an audiobook (the video mp4 version just has the book's cover for the entire duration). I'm trying to add chapter metadata to the audiobook using ffmpeg. I've tried the following, but Apple Books fails to recognise the chapters with all of these methods:
ffmpeg -i input.m4a -i chapters.txt -map_metadata 1 -codec copy output.m4a where chapters.txt resembles this:
[CHAPTER]
TIMEBASE=1/1000
START=1
END=448000
title=Chapter 1
[CHAPTER]
TIMEBASE=1/1000
START=448001
END= 3883999
title=Chapter 2
[CHAPTER]
TIMEBASE=1/1000
START=3884000
END=4418000
title= Chapter 3
I've also tried splitting it into many m4a files and then combining them into a single m4b file, still to no avail using ffmpeg -f concat -safe 0 -i mylist.txt -c copy output.m4b where mylist.txt contains all of the split files.
I want the final output to be an M4B file. How do I add chapter information, while outputting the final file in M4B format?