http://jonhall.info/create_id3_tags_using_ffmpeg/ discusses using an external FFMETADATA file to write out the tags to an mp3.
Code: Select all
;FFMETADATA1
title=Blondie, Steve Jobs, Jimmy Iovine & Jimmy Destri
encoded_by=auphonic.com
artist=AppleInsider Podcast
date=2019
encoder=Lavf58.27.103
[CHAPTER]
TIMEBASE=1/1000
START=6894
END=63195
title=Opener
[CHAPTER]
TIMEBASE=1/1000
START=63195
END=642776
title=Introduction: Jimmy Destri
[CHAPTER]
TIMEBASE=1/1000
START=642776
END=725725
title=I know music, and I know addiction
[CHAPTER]
TIMEBASE=1/1000
START=725725
END=839739
title=Analog synths to digital and laptops
[CHAPTER]
TIMEBASE=1/1000
START=839739
END=896416
title=Garageband
[CHAPTER]
TIMEBASE=1/1000
START=896416
END=963578
title=Today, anybody can make a record
[CHAPTER]
TIMEBASE=1/1000
START=963578
END=1057941
title=iTunes really covered our asses
[CHAPTER]
TIMEBASE=1/1000
START=1057941
END=1128428
title=Spotify
[CHAPTER]
TIMEBASE=1/1000
START=1128428
END=1149937
title=You trust Apple...
[CHAPTER]
TIMEBASE=1/1000
START=1149937
END=1333239
title=What is Facebook's responsibility to their users
[CHAPTER]
TIMEBASE=1/1000
START=1333239
END=1498748
title=Apple News
[CHAPTER]
TIMEBASE=1/1000
START=1498748
END=1700825
title=Who's going to be Apple's competitor in the future?
[CHAPTER]
TIMEBASE=1/1000
START=1700825
END=1744158
title=Steve Jobs parked anywhere he wants
[CHAPTER]
TIMEBASE=1/1000
START=1744158
END=1946689
title=Jimmy Iovine told me some Steve Jobs stories
Is what FFMPEG sees as the metadata when I read from the file created with Auphonic, which matches the format on the page linked above. It seems possible to write .mp3 with chapters using FFmpeg if that page is accurate.
Testing this, I saved the metadata above as metadata.txt. Then in my terminal, I issued the command:
./ffmpeg -i /Users/vmarks/Downloads/ai\ pod/ai\ pod\ destri.mp3 -i /Users/vmarks/Downloads/ai\ pod/metadata.txt -map_metadata 1 -c:a copy -id3v2_version 3 -write_id3v1 1 /Users/vmarks/Downloads/ai\ pod/out.mp3
which took a file that had no chapters (ai pod destri.mp3) and read in the metadata.txt file, creating the out.mp3 with chapters. It had one error in the process, "[mp3 @ 0x7fb0e1803800] Audio packet of size 523 (starting with 00FFFBA0...) is invalid, writing it anyway."
FFmpeg saved a new file (out.mp3) with tags that look like mp3 id3 chapters. If I use FFmpeg -I on that out.mp3 file, it reports the chapters are there, with exactly what was in the metadata.txt for it. I don't know how to address that error, and something's not perfect: when I open it in an application that supports chapters, they aren't present. Also, I can see that the times have shifted slightly for start and stop from my file that has chapters created properly. I need to figure out why that is, and figure out why it looks like they're present, but not in applications that do support them.
But this seems promising. Things I could improve on: I don't really understand FFmpeg. I'm just using syntax that was mentioned on the link at the top of this post, without knowing exactly what to expect. The metadata.txt? I used FFworks, a gui frontend to FFmpeg, to read the chapters from the previously created known-working mp3 file, and clicked on "edit metadata" and copied and pasted that into a text editor. I admit I'm stumbling a bit here, but it feels... close.