mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-02 22:46:56 -05:00
[Enhancement]: Fix _Slightly_ misplaced chapters via silence detection #470
Labels
No labels
authentication
awaiting release
backlog
bug
chapter editor
config-issue
ebooks
encoding/embedding
enhancement
help wanted
listening sessions & progress
planned
possible plugin
progress sync
sorting/filtering/searching
unable to reproduce
upload
users & permissions
waiting
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/audiobookshelf#470
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @samosbor on GitHub (Jun 17, 2022).
Fix Slightly misplaced chapters via silence detection
I find that often, the chapter matching feature gets very close to the correct timestamps for chapter marks. However, usually there is a slight offset by a few seconds. Sometimes the offset is consistent, sometimes it is not (maybe due to encoding at slightly different speed).
M4B-tool has a feature to adjust chapters via silence detection. With the current chapter fix features getting us most of the way there, I think the silence detection would work very well.
@advplyr commented on GitHub (Jun 17, 2022):
That silence detection for chapters is a good idea. I can see how to detect the silence using ffmpeg and grab those timestamps, but I think the difficult part here will be the UI/UX.
Do you have a UI in mind for how this would be done?
There are a lot of edge cases I can think of, like you may not find matching chapters from audible but you still want to detect the chapter timestamps using silence. The number of silences might not match up with the chapters from audible.
Like how it was done in m4b-tool, we will probably want to add some way for the user to adjust the length of the silence.
On a similar note, the chapter editor was planned to have the ability to shift all chapter times X seconds. That would be separate from silence detection but seems relevant to mention here.
@SpeakingOfBrad commented on GitHub (Nov 30, 2024):
I know this is an older request, so I hope it's okay to add my thoughts here.
For the UI aspect I imagine a simple "Adjust via silence detection" button near the top of the chapter edit page that will do its best to adjust the chapter timestamps to the end of the nearest silence of at least 1.5 seconds (or whatever you decide the default should be).
That would probably be enough for most use cases where the chapters are just slightly off.
@ZLoth commented on GitHub (Mar 13, 2025):
This is one of serveral improvements that need to be made to the Chapter Editor.
@andrew-hill commented on GitHub (Dec 23, 2025):
I think 2 actions are warranted here:
For fine-tuning chapter marks, an alternate UX could be to display the waveform around the chapter mark, so the user can see/pick the silence.
For books with very short silences, you'll be forced to use a small value of N from method 1 above. But it's easier to delete chapter markers than tune them manually.
For books where lookup is close but not quite right, method 2 will be useful. I had some books where the audible release was seemingly remastered from the same source (a fairly old narration), but with a very slightly differnet pace (~0.5% faster). Incrementally shifting, tuning 1 chapter, locking it, then re-shifting remaining, etc was pretty slow. I think either suggestion above would have done a pretty good job in this case as they had ~3 second silence between chapters.
An option to scale chapters proportionally to the local audiobook's duration could be useful too (as part of the lookup dialogue if you get the mistmatched duration error). Though I'm not sure how common my issue really is.