question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tagging m4b is changing the timebase

See original GitHub issue

The milliseconds of chapter times are changing when tagging m4b files. I’m not sure if it is isolated to m4b because I haven’t tested mp3 yet. This was reported here https://github.com/advplyr/audiobookshelf/issues/1060

When trying to track down why this is happening I noticed that m4b audiobooks I have that are using a 1/1000 timebase are being converted to 1/44100

I added a sample file named TimebaseSample.m4b here: https://github.com/advplyr/node-tone/tree/master/samples

Before tagging:

{
    "id": 1,
    "time_base": "1/1000",
    "start": 14043,
    "start_time": "14.043000",
    "end": 393113,
    "end_time": "393.113000",
    "tags": {
        "title": "Chapter 1"
    }
}

After tagging:

{
    "id": 1,
    "time_base": "1/44100",
    "start": 619296,
    "start_time": "14.042993",
    "end": 17336283,
    "end_time": "393.112993",
    "tags": {
        "title": "Chapter 1"
    }
}

The time base doesn’t really matter in the end but I think it may be related to the milliseconds getting changed.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sandreascommented, Oct 25, 2022

Ok, atldotnet released a fix for this today. I try to integrate this in the next days…

1reaction
sandreascommented, Oct 15, 2022

I don’t think it has to do with ffmpeg since I’m only using ffprobe to read the data.

No this is definitely a tone issue. Thank you for your patience.

Here is how to reproduce with the sample file

Great thanks, I’ll have a look asap.

I don’t know enough about audio encoding to say if it matters to use 1/1000. The timebase is usually based on the sample rate so this may allow for more accuracy?

Neither do I. I have to do some research, what the problem is here but this is indeed an interesting problem, since I found NO hint that tone does something to change the timebase of the chapters. The 44100 just came to my mind because I also got a sample file for my tests to ensure, that values different from 1/1000 also do work as expected.

Now that I can reproduce the issue (hopefully), I’m sure I find out pretty quick, what the problem is.

One issue with changing the timebase seems to be it is changing the chapter start/end times.

That should never happen… it is definitely a problem, even if it is only a rounding issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[F] Problem changing tags in m4b file - Fixed Bugs
With certain m4b files, I can't seem to change tags in the files. It saves the file but the changes disappear and when...
Read more >
Add chapter metadata to audiobook using ffmpeg
I'm trying to add chapter metadata to the audiobook using ffmpeg. ... 2 [CHAPTER] TIMEBASE=1/1000 START=3884000 END=4418000 title= Chapter 3.
Read more >
Audiobook metadata chapterization · Issue #3725
Audiobooks commonly use the m4b acc encoded format. Such files often include chapterization information in the metadata comment.
Read more >
Sirin Audiobook Player - need YOUR Feedback / Idea ...
I am developer of Sirin Audiobook Player and I want to reach out to audiobook ... There is Groupping tag for M4B but...
Read more >
Merge audiobook parts into one file. Are chapters created?
When using Merge audiobook parts into one file , are chapters created based on the individual files? · What does Write audio tags...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found