Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion Issues - M4B Specific #31

Closed
Chirishman opened this issue Aug 28, 2020 · 9 comments
Closed

Conversion Issues - M4B Specific #31

Chirishman opened this issue Aug 28, 2020 · 9 comments

Comments

@Chirishman
Copy link

Problem/Scope

I've been backing up/converting my entire collection of of 1528 books.

Of that I've had some conversion errors on some 215 audiobooks which rendered 182 of them unplayable in some players but usable in others and the remaining 33 of them are completely unplayable.

Troubleshooting Attempted

  • Redownloaded source AAX files - no change

  • All files individually tested so far have worked properly when converted directly to MP3 instead.

    Suggests to me that this is almost certainly entirely a problem with corrupted metadata

  • Attempted to strip metadata using ffmpeg manually in order to manually add chapters later.

    ffmpeg threw errors and was unable to process the m4b files

Details

For the files which will play in some players and not others I've observed them to have a second chapter menu listing which is full of garbage timecode values, with chapter names being substrings of the proper chapter names for titles and in some cases erroneous garbage characters.

image

For the totally unplayable ones what I see in mediainfo is different, it doesn't seem to see any audio stream at all.

image

@audiamus
Copy link
Owner

Can you upload a log file for each of the two cases: unplayable, playable on some? If it is related to meta data then log level 3 should suffice.

AAX Audio Converter uses up to three different methods to add meta data, depending on the current parameters and on the book. The log file will list all parameters, the chapter meta data and which methods it applies.

@audiamus
Copy link
Owner

audiamus commented Sep 8, 2020

The problem may be caused by the way the chapter meta data is added to the file. For MPEG4 (m4a/m4b) this is currently handled by FFmpeg.

MPEG4 chapters come in two flavors, nicknamed after their origin: "Nero" and "Quicktime". Some players can only interpret one of the two. iTunes, for instance, can read Quicktime, but not Nero, VLC on Android only Nero. For maximum compatibility, FFmpeg attempts to write both. Which will explain why tools like MediaInfo report two chapter lists ("menus").

However, it appears that the FFmpeg chapter encoding may corrupt one of the two chapter encodings and possibly the entire file. I can reproduce the problem for the chapter list, where I only get correct output for one.

As it is unlikely to get this resolved with FFmpeg, my approach was to find a different method for adding the chapter data. And I discovered another library which supports MPEG4 chapters: https://github.com/Zeugma440/atldotnet. It looks very promising, for both Nero and Quicktime, particularly as its developer is very helpful. So I will replace FFmpeg with ATL.net for the MPEG4 chapter adding task.

(I can only award a single GitHub star to him, but he deserves many more.)

@Chirishman
Copy link
Author

Sorry about not getting back to you promptly with the logs, just started a new job and I've been busy getting up to speed/unscrewing their documentation.

Super glad that you've been able to repro the issue. I'll still get you some logs tomorrow though for both types of result I'm seeing.

The two players I've been testing this with are Plex Media Server (which uses ffmpeg) and Media Player Classic Home Cinema (x64)/Combined Community Codec Pack

@audiamus
Copy link
Owner

audiamus commented Sep 9, 2020

I'll still get you some logs tomorrow though for both types of result I'm seeing.

Yes, please. Can you make them log level 4? The FFmpeg output might provide additional clues.

@Chirishman
Copy link
Author

AaxAudioConverter_2020-09-09_001.log
Here you go. This shows generation of two files with the corrupted-looking second menu in mediainfo and which will not play back in Plex.

I'm having trouble reproing the completely unplayable behavior even with all of the same files. Maybe it was something weird/transitory in memory that was cleared by a reboot or maybe it was something that only happens when you try to process a very large number of files at once. Unsure.

@audiamus
Copy link
Owner

Thanks a lot. I have looked into it. No, there isn't the slightest hint that FFmpeg has any problems. So, this just confirms my decision to go for a totally different method and switch over to ATL.net.

or maybe it was something that only happens when you try to process a very large number of files at once.

Even then this shouldn't happen. If you encounter it again, please save the log file. Log level 3 should do. (If you remember to clear the log directory from time to time, you can leave logging on. It won't slow down the conversion much, definitely not at level 3.)

@Chirishman
Copy link
Author

Hey, the files that are being output still won't play in certain players (Plex) so I don't think this is really resolved.

Are there currently any startup flags/options that I could use to make it try only one of the three metadata writing options at a time or just skip the metadata so I can try manually adding it later? The only way that I can think of to do that at the moment is to go to MP3 and then back to m4v and I'd rather not do that as I'd get some quality loss due to the repeated transcoding between lossy formats.

@audiamus
Copy link
Owner

The modified chapter meta creation will come with the next version 1.15.

Until then one option is to convert to MP3. Disadvantage is that this is quite slow. With MP3, chapters are encoded as ID3v2 and that does not seem to cause problems - except that very few players are able to read ID3v2 chapter data.

The other and probably better option is to split the book into chapters, either MP3 or M4A/M4B. In that case no chapter data will be written.

@mcrommert
Copy link

Excellent to hear this as this is my only current issue - converted a library of around sixty titles and 5-7 were broken this way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants