-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Hi there, I've been using mp4ameta to set up metadata on audiobooks I create with TTS from epubs. For the most part it's been great, but the final hurdle I've been struggling with has been getting chapters to show up in AVFoundation. I use an app that uses it to retrieve chapter data, and for whatever reason, it just cannot see the chapter metadata.
Output files work fine on VLC, and after staring at and improving mp4 hex patterns, they seem all good from that angle. If I run a file through ffmpeg like so ffmpeg -i input.m4b -c copy fixed.m4b, AVFoundation can read the chapters. I've tried comparing hex dumps and I just can't seem to figure out which changes ffmpeg is doing in it's output that fixes thing, although my assumption is the chapter tracks, as the list seems to be perfect. Unfortunately I've not gotten around to improving the hex pattern looking at the big track data portions, so it's not as easily comparable for me.
I tried modifying mp4ameta to write version 1 (instead of 0) chapter lists, just to see if that changed things, but no dice. It didn't break things, but also didn't improve them.
I have a little test program here that can be used to see if the lists get recognized, but obviously it won't help if you don't have a Mac: https://gist.github.com/playmer/5481e5ee46f70d97ae6d8faadeea0011
Here's a book I generated from a public domain epub that exhibits the issue.
And the code used to add the tags is here: https://github.com/playmer/epub_to_audiobook_rs/blob/58a9ddd0127ff6db225f18174e762136e57c06bf/src/main.rs#L112-L165
Sorry for having to come here and bug you, I've been trying things on and off for the last month or so, so I figured I'd see if you have any ideas. Doubly sorry if this is something I've missed in the docs/issues 😅
Regardless, thanks for the library, it's been great to work with!