advplyr / audiobookshelf

Self-hosted audiobook and podcast server
https://audiobookshelf.org
GNU General Public License v3.0
5.75k stars 395 forks source link

[Enhancement]: Individual chapter timing adjustment #1533

Open Demian98 opened 1 year ago

Demian98 commented 1 year ago

Describe the feature/enhancement

I really love how Audiobookshelf handles chapters and that you can adjust the timing intending from the files. grafik

Sometimes I have a difference from ~2 seconds between my audiobook length and the chapters found online. The Problem is, that this difference is not at the start or end, it is somewhere in-between. So I have to remove this +2 seconds manually from all affected chapters - very annoying. grafik

It would be great if this timing difference could not be adjusted for all chapter, maybe just for chapter 0 to 30. Something adjustable. This option could get added here, or somewhere near this: grafik

Feels like an easy change to me, as it is just a small UI improvement, but it brings so much benefit :)

advplyr commented 1 year ago

This is easy to code but difficult to make a good UI for. If you have an example UI that could be used for this that would be helpful.

Demian98 commented 1 year ago

Here is a small painting of my UI idea, maybe not pretty but enough to get the idea :)

  1. The rows of the chapters can be selected. Multiple rows with shift and multiple individuals with control, like it is working in Windows explorer or any other list application.
  2. Replace the button to add a time difference with a + and - button to add or remove the time. This currently also possible by typing +0.4 or -0.4 in the box. This would save some time as you don't need to switch between positive and negative numbers all the time.
  3. Move the whole control box to the side of the list and make it sticky. Then it is always visible when you are scrolling through the list. I think of some books with 200+ chapters, it would be horrible if you need to scroll up and down all the time, to use the controls. Optionally, the controls can also stay at the top and get sticky to be visible while scrolling, but I would prefer the side, as there is enough space left. You could also save some space in the width if the "show seconds" checkbox would be moved to other controls, for example under the buttons.
  4. Move to button to create the chapters from the files also into the box with all controls. Usually, it is easier for the user to keep the overview when all possible actions are at the same place.

grafik

I hope you like my ideas and it helps you :)

Demian98 commented 1 year ago

Hi @advplyr, I thought a little bit more about this and had another idea to improve this process.

In front of every chapter, additionally to the time, ABS could display and audio wave for a small part around the chapter start. Maybe something like 10 seconds in both directions, so in total 20 seconds. The chapter start could be displayed in there as a red line which can be moved by drag and drop. This would make it very easy to find the correct chapter start very fast, as it is a visual gap in the audio wave. Usualy every book as smal pauses inbetween chapters, here is in example of such a wave and how easy it should be to see the end of the chapter.

Please let me know what you think about this.

grafik

advplyr commented 1 year ago

I played around with this a bit in a branch

Clicking the button creates a waveform -10 seconds and +10 seconds of the chapter start. It doesn't do anything more then that, I just wanted to see how difficult it would be to generate these.

image

The difficulty will actually be designing a UI/UX that makes this useful. In my case the audiobooks that had misaligned chapters were off by much more then 10 seconds. Generating waveforms for too long of a duration would make it difficult to see the pauses. The other issue is what to do with multi-file audiobooks. In order to generate a waveform between 2 audio files they would have to be concatenated.

advplyr commented 1 year ago

Putting timestamps and allowing to seek around the waveform image then select where the chapter start is using a cursor is the obvious part. For my use-case -10/+10 seconds wouldn't have been useful since chapters are typically off way more then that. Or if you are just wanting to find the chapters on your own without using the audible lookup.

Demian98 commented 1 year ago

Hi @advplyr, OK, I see the issue there. We have two different use cases here:

  1. Finding the chapters which are way off or not available.
  2. Fin tune chapters which are slightly of, like +-10 to 20 seconds.

In my case, I have use case 2 for a lot of my books. Here is an example: grafik

My book is 7 seconds shorter than the proposed chapters. The first couple of chapters are matching, but with each chapter there is more deviation. So I was sitting there, listening to each start of a chapter over and over, and tried to find its correct start. The book in this example has ~180 audio files for 32 chapters. My guess is that the deviation comes from having that many audio files. With 7 seconds in 180 files, the difference is just 38ms per files. Maybe this is an issue in the duration calculation of ABS, maybe it is an issue in the files itself. But every 5-7 file is the start of a new chapter. So I guess the files are spliced well, as each chapter is starting on the begging of a file and not in-between.

Conclusion I think the wave solution could be useful for use case two, especially as it provides more details in the visual way. For use case one, it is much harder. One way could be to orientate on the files, as they could give information of a chapter start (like in the example above, every 5-7 file is a start). Another way could be also the wave solution, but with a much more compressed wave and some kind of highlighting for gaps larger than x milliseconds. Then you can jump into this highlighted sections.

But if we just fix use case two, it would already be a very big win and much less effort than use case 1. Later there would still be space for improvement to look at use case 1.

calebj commented 7 months ago

In the meantime, I wrote this Python script to tackle multi-part Audible releases. Hopefully it helps someone. chaptershift.txt