m4b-tool icon indicating copy to clipboard operation
m4b-tool copied to clipboard

Folder of mp3s not generating chapters.txt

Open djdembeck opened this issue 4 years ago • 4 comments
trafficstars

Hello sandreas,

I tried nailing down this issue myself, but can't seem to find what is going awry. Here are the details of what I'm doing, followed by the log from -v

  • Have an input folder of 33 mp3 files
  • Without metadata arguments, here's what I'm using:
--force --no-chapter-reindexing --no-cleanup --jobs=64 -v

Unlike all other mp3 folders I've processed, this one does not generate a populated chapters.txt file

Mediainfo of first mp3:

General
Complete name                            : Lara Prescott - The Secrets We Kept/The Secrets We Kept - 001 - The Secrets We Kept.mp3
Format                                   : MPEG Audio
File size                                : 199 KiB
Duration                                 : 20 s 88 ms
Overall bit rate mode                    : Constant
Overall bit rate                         : 64.0 kb/s
Album                                    : The Secrets We Kept - A Novel
Track name                               : The Secrets We Kept - 001 - The Secrets We Kept
Track_More                               : A Novel
Track name/Position                      : 1
Performer                                : Lara Prescott
Encoded by                               : OverDrive, Inc.
Publisher                                : Books on Tape
Genre                                    : Fiction/Historical Fiction/Literature/Thriller
Writing library                          : Lavf57.21.100
Copyright                                : Penguin Random House Audio Publishing Group
Cover                                    : Yes
Cover type                               : Cover (front)
Cover MIME                               : image/jpeg
OverDrive MediaMarkers                   : <Markers><Marker><Name>The Secrets We Kept</Name><Time>0:00.000</Time></Marker><Marker><Name>Epigraph</Name><Time>0:21.000</Time></Marker><Marker><Name>Prologue</Name><Time>0:31.000</Time></Marker><Marker><Name>East 1949-1950 Chapter 1</Name><Time>14:01.000</Time></Marker></Markers>

Audio
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 3
Format settings                          : Joint stereo / MS Stereo
Duration                                 : 20 s 88 ms
Bit rate mode                            : Constant
Bit rate                                 : 64.0 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 44.1 kHz
Frame rate                               : 38.281 FPS (1152 SPF)
Compression mode                         : Lossy
Stream size                              : 157 KiB (79%)
Language                                 : English

Log:

merging 33 files into /output/Lara Prescott/The Secrets We Kept/The Secrets We Kept - A Novel-tmpfiles/tmp_The Secrets We Kept - A Novel.m4b, this can take a while
tagged file tmp_The Secrets We Kept - A Novel.m4b (artist: Carlotta Brentan, Cynthia Farrell, Mozhan Marnò, Saskia Maarleveld, Jonathan Davis, David Pittu, James Fouhey, name: The Secrets We Kept - A Novel, chapters: 127)
moved temporary tmp_The Secrets We Kept - A Novel.m4b to /output/Lara Prescott/The Secrets We Kept/The Secrets We Kept - A Novel.m4b
successfully merged 33 files to /output/Lara Prescott/The Secrets We Kept/The Secrets We Kept - A Novel.m4b

djdembeck avatar Jun 28 '21 16:06 djdembeck

I think this may be an issue with ChaptersFromOverdrive, as running with -vv shows some more info:

==> trying improver ChaptersFromOverdrive
chapter count changed from 0 to 127


==> trying improver ChaptersFromFileTracks
chapters are already present, chapters from file tracks are not required - tags not improved

djdembeck avatar Jun 28 '21 16:06 djdembeck

Ah I see, ChaptersFromOverdrive is an XML-Format that may be embeded within the mp3s, but there is no possibility to disable a specific improver. The result is m4b-tool "preferring" the MP3-Tags from Overdrive over the filenames / title tags.

I'm not quite sure, what would be the best option here, because in most cases, users would prefer Overdrive-Chapters over filenames / tag titles. Basically there are two ways:

  1. Blacklist: Disable specific improvers (--disable-improvers=ChaptersFromOverdrive,ChaptersTxt)
  2. Whitelist: Enable specific improvers and regard their order (--improvers=ChaptersFromFileTracks,ChaptersTxt)

I'd prefer the whitelist approach... Although this could be configured in the TagImproverComposite (https://github.com/sandreas/m4b-tool/blob/d5696aa27e01894dbb3cdca11df9a3002e421082/src/library/Audio/Tag/TagImproverComposite.php#L50), this might take a while, because it needs restructuring...

I'll take a look. In the meantime, you could remove the custom tag OverDrive MediaMarkers from your mp3 files to fix this. See https://github.com/sandreas/m4b-tool/issues/114#issuecomment-753579222 for details...

sandreas avatar Jun 28 '21 17:06 sandreas

Excellent, thank you for the response! Maybe I'll change the tags, I'm in no rush to process that book though.

I agree, people will probably find the whitelist more useful (less writing if they don't want any options). Sounds like a lot of documentation writing for you though :sweat_smile:

djdembeck avatar Jun 28 '21 17:06 djdembeck

This might also resolve the "disable silence detection" enhancement...

sandreas avatar Jul 18 '21 15:07 sandreas

Today I added --enable-improvers and --disable-improvers. With these parameters you can activate / deactivate specific improvers like this:

--disable-improvers=ChaptersFromOverdrive,ChaptersTxt

or whitelisting to ONLY apply the selected improvers

--enable-improvers=ChaptersFromOverdrive

Hope this solves your problem, feel free to reopen, if it does not.

sandreas avatar Nov 02 '23 12:11 sandreas