[Bug]: Timing in web player is way off #2279

Closed
opened 2026-04-25 00:05:43 +02:00 by adam · 5 comments
Owner

Originally created by @Fieldmouse88 on GitHub (Sep 28, 2024).

What happened?

When I switched from my iphone app to the web player, it continued at the same time code, but the audio was not at the same place in time.
Further investigation and looking at a single chapter, the text says both are the same length, but if i go to say 15m on phone app, windows media player and the audibooks web player, the phone and windows media player will be synced, but the web player will be waay off.
Instead, these to 2 timecodes play the same audio.
3395d83b-d7de-46ff-b70c-321f215fb90c

Im only using windows media player here for trouble shooting.

What did you expect to happen?

I would expect the same time code on all 3 players to play the same audio.
But they dont.
c82ad641-0bc9-4c32-8a26-a5b682c72353

Steps to reproduce the issue

  1. Not really sure if this is limited to only some files, but I could of course get you a sample of this current book if required.
    Simply try playing it at some random time code on the web player and then on the iphone or probably any other player. The audio will not be synced what so ever.

Audiobookshelf version

v2.13.4

How are you running audiobookshelf?

Debian/PPA

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

Chrome

Logs

No response

Additional Notes

No response

Originally created by @Fieldmouse88 on GitHub (Sep 28, 2024). ### What happened? When I switched from my iphone app to the web player, it continued at the same time code, but the audio was not at the same place in time. Further investigation and looking at a single chapter, the text says both are the same length, but if i go to say 15m on phone app, windows media player and the audibooks web player, the phone and windows media player will be synced, but the web player will be waay off. Instead, these to 2 timecodes play the same audio. ![3395d83b-d7de-46ff-b70c-321f215fb90c](https://github.com/user-attachments/assets/faa6f419-eb97-46c6-b70c-a5b48012f6fd) Im only using windows media player here for trouble shooting. ### What did you expect to happen? I would expect the same time code on all 3 players to play the same audio. But they dont. ![c82ad641-0bc9-4c32-8a26-a5b682c72353](https://github.com/user-attachments/assets/b1e112cc-a5ee-4e2e-9299-fc69af58db52) ### Steps to reproduce the issue 1. Not really sure if this is limited to only some files, but I could of course get you a sample of this current book if required. Simply try playing it at some random time code on the web player and then on the iphone or probably any other player. The audio will not be synced what so ever. ### Audiobookshelf version v2.13.4 ### How are you running audiobookshelf? Debian/PPA ### What OS is your Audiobookshelf server hosted from? Linux ### If the issue is being seen in the UI, what browsers are you seeing the problem on? Chrome ### Logs _No response_ ### Additional Notes _No response_
adam added the bug label 2026-04-25 00:05:43 +02:00
adam closed this issue 2026-04-25 00:05:43 +02:00
Author
Owner

@advplyr commented on GitHub (Sep 28, 2024):

Is this an m4b or an mp3 file?
You'll have to provide the file, there is not enough info to make any guesses.

@advplyr commented on GitHub (Sep 28, 2024): Is this an m4b or an mp3 file? You'll have to provide the file, there is not enough info to make any guesses.
Author
Owner

@Fieldmouse88 commented on GitHub (Sep 28, 2024):

Its an MP3, heres the file, not the entire book but the chapter I happened to be on an experimented with.
https://www.dropbox.com/scl/fi/gcskatwxxre351yh9nwqd/19-Prey.mp3?rlkey=3ceg7layy0ofsr3vzbp8hnbx5&st=7z396cl2&dl=0
Let me know if there is anything else I can provide that would be helpful!

@Fieldmouse88 commented on GitHub (Sep 28, 2024): Its an MP3, heres the file, not the entire book but the chapter I happened to be on an experimented with. https://www.dropbox.com/scl/fi/gcskatwxxre351yh9nwqd/19-Prey.mp3?rlkey=3ceg7layy0ofsr3vzbp8hnbx5&st=7z396cl2&dl=0 Let me know if there is anything else I can provide that would be helpful!
Author
Owner

@advplyr commented on GitHub (Sep 28, 2024):

The issue is that the audio file is encoded with Variable Bit Rate (VBR). It is recommended to use Constant Bit Rate (CBR).

Seeking isn't going to work properly with VBR mp3s. Some audio players like VLC media player will do a better job at it but the built-in browser audio player isn't going to do well.

On the android app a setting was added to enable index seeking but I don't think it works well either and it slows down playback. It is explained here https://developer.android.com/media/media3/exoplayer/troubleshooting#why-is-seeking-inaccurate-in-some-mp3-files
https://github.com/advplyr/audiobookshelf-app/issues/638

I would suggest re-encoding any VBR mp3 files you have. I was able to fix that file you sent with this ffmpeg command.

ffmpeg -i '.\19 - Prey.mp3' fixed_audio.mp3
@advplyr commented on GitHub (Sep 28, 2024): The issue is that the audio file is encoded with Variable Bit Rate (VBR). It is recommended to use Constant Bit Rate (CBR). Seeking isn't going to work properly with VBR mp3s. Some audio players like VLC media player will do a better job at it but the built-in browser audio player isn't going to do well. On the android app a setting was added to enable index seeking but I don't think it works well either and it slows down playback. It is explained here https://developer.android.com/media/media3/exoplayer/troubleshooting#why-is-seeking-inaccurate-in-some-mp3-files https://github.com/advplyr/audiobookshelf-app/issues/638 I would suggest re-encoding any VBR mp3 files you have. I was able to fix that file you sent with this ffmpeg command. ``` ffmpeg -i '.\19 - Prey.mp3' fixed_audio.mp3 ```
Author
Owner

@Fieldmouse88 commented on GitHub (Oct 1, 2024):

Oh I see! Thank you for the quick response. While I know do understand the underlying issue with VBR, wouldnt it make for ALOT better solution if seeking was done with the same method on all platform players? I mean it doesnt really matter if the timing is off from the actual time stamp, all that matters is that its the same on all devices using audiobookshelf.
Re-encoding isnt really an option for me, and I imagine that applies to most users.
I would still call this a bug, even though there is a technical explanation for it, from a user perspective its not expected behaviour. And it seems to me like it would be resolved if seeking was done using the same method on all devices.

But hey, its still great, free and Im so glad it exists! Thankful to you advplyr, who I assume is the creator, and everyone else who has contributed in some way! =)

@Fieldmouse88 commented on GitHub (Oct 1, 2024): Oh I see! Thank you for the quick response. While I know do understand the underlying issue with VBR, wouldnt it make for ALOT better solution if seeking was done with the same method on all platform players? I mean it doesnt really matter if the timing is off from the actual time stamp, all that matters is that its the same on all devices using audiobookshelf. Re-encoding isnt really an option for me, and I imagine that applies to most users. I would still call this a bug, even though there is a technical explanation for it, from a user perspective its not expected behaviour. And it seems to me like it would be resolved if seeking was done using the same method on all devices. But hey, its still great, free and Im so glad it exists! Thankful to you advplyr, who I assume is the creator, and everyone else who has contributed in some way! =)
Author
Owner

@advplyr commented on GitHub (Oct 1, 2024):

What do you mean seeking is done the same? When playing audio in the browser you have to use the browsers audio player. That audio player isn't going to be able to seek with VBR audio files. There is not really a solution as far as I can tell unless you have some more thoughts.

I'm not sure where you are getting VBR mp3 files but it is only problematic with no benefit. I'm not sure why re-encoding wouldn't be an option. If for some reason you have many of these files you can write a few line script to loop through and fix them.

@advplyr commented on GitHub (Oct 1, 2024): What do you mean seeking is done the same? When playing audio in the browser you have to use the browsers audio player. That audio player isn't going to be able to seek with VBR audio files. There is not really a solution as far as I can tell unless you have some more thoughts. I'm not sure where you are getting VBR mp3 files but it is only problematic with no benefit. I'm not sure why re-encoding wouldn't be an option. If for some reason you have many of these files you can write a few line script to loop through and fix them.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2279