aedocw / epub2tts

Turn an epub or text file into an audiobook
Apache License 2.0
528 stars 50 forks source link

chapter marks aren't inserted after part 255 #203

Closed danielw97 closed 6 months ago

danielw97 commented 8 months ago

Hi, Just me again with another issue I'm afraid, although this one is probably uncommon for most people to run into. I'm in the process of converting an epub with many small chapters, and have run into the issue where anything after chapter 250 is just one long chapter (there are no chapter marks inserted after this point). I'm not sure if this is an ffmpeg limitation in which case there's not a lot we can do about it, or if there's any way to try to debug this? Chapters are detected correctly on a scan so think it's later down the line. Thanks. Edit: My bad, it's actually chapter 255 and it seems as though ffmpeg detects things properly so may be an m4b limitation.

aedocw commented 8 months ago

I don't see anything obvious that would lead to a limit of 255 chapters/parts. I just made a book with 299 chapters and it ran through no problem. The final m4b file had 299 chapters.

Have you tried exporting that epub to txt, and checking the text file to see what it looks like?

longbook.txt

danielw97 commented 8 months ago

Hi, Thanks for the reply on this. I'm struggling to find a reason as well, although everything in the output as well as ffmpeg looks good. It may be due to the length, although think a solution will be difficult to find without me being able to see an issue.

aedocw commented 8 months ago

Happy to leave this open until we can get a more definitive take and reliably reproduce.

How many hours into the book (roughly) was it when this happened? The next/other thing to check would be to run with --debug and take a look at the contents of FFMETADATAFILE. If the chapter breaks are missing from there, then the problem is somehow happening inside epub2tts.py. If they are there, but they're not appearing in the final m4b file then it's a problem with ffmpeg. I'm betting you are right and it's something with ffmpeg and the length of the final output.

aedocw commented 6 months ago

Closing this, but if you're able to reproduce, please feel free to comment and we can re-open.