mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-30 23:40:40 +02:00
[Bug]: Some audiobooks refuse to play. #1217
Closed
opened 2026-04-24 23:36:00 +02:00 by adam
·
19 comments
No Branch/Tag Specified
master
book_tags_genres_dedupe
episode_download_fallback
Issue-4540-SortBy-StartedDate-and-FinishedDate
episode_meta_tagging
fix_authorize_race_condition
redirect_transcode_requests
progress_updated_sort
fix_ereader_socket_event
fix_change_empty_root_password
fix_podcast_session_track_index
fix_set_token
session_modal_user
localize_durations
fix_oidc_create_user
jwt_auth_refactor
fix_scanner_deleting_single_file_books
fix_mediaprogress_updatedat_2
experimental_next_client
podcast_episode_duration
episode-timestamps-clickable
book_author_secondary_sort_title
podcast_useragents
pathexists_user_access
fix_pathexists_join
book_author_secondary_sort
clean_duplicate_mediaprogress
sanitize_html_description
trix_prevent_attachments
check_path_api_fix
fix_mediaprogress_updatedat
increase_express_json_limit
fix_dockerfile_nunicode
search_episodes
audiobook_tools_update
episode_secondary_sorts
hls_stream_url_update
new_session_track_endpoint
audiobook_tools_enhancements
watcher_rescans_update
player_track_tooltip
fix_exclude_prefixes_crash
socket_item_events
fix_podcast_episode_scanner_promise
new_stats_controller
count_cache_for_userpermissions
parsing-opf-v3
validate_migration_files
fix-quick-match-all-crash
fix-chapter-end-sleep-timer
stringify_sequelize_query
remove-col-ambiguity
fix_next_prev_edit_description
details_trim_whitespace
fix_content_url_basepath
fix_logger_fatal
progress_bar_visibility
batch-edit-populate-map-details
feed_generator_updates
bookmark-modal-updates
migrate-library-item-in-scanner
migrate-new-library-items
migrate-podcasts-new-library-item-2
migrate-podcasts-new-library-item
fix-remove-episode-from-playlist
playback-session-use-new-library-item
refactor-library-item
fix-heatmap-caption
feed-episodes-upsert
share-media-player-media-session-api
remove-old-playlist
remove_old_collection_object
plugin-implementation-demo
feed_migration
refactor-feeds-from-item
fix_remove_authors_no_books
v2.17.3-fk-constraints-migration
migrations-first-upgrade
sqlite_2
feature/nuxt-target-server
waveform
sq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v1.3.4
v1.3.3
v1.3.1
v1.2.8
v1.2.6
v1.2.5
v1.2.4
v1.2.1
v1.1.15
v1.1.14
v1.1.13
v1.1.12
v1.1.11
v1.1.10
v1.1.9
v1.1.8
v1.0.0
0.9.61-beta.0
0.9.61-beta
Labels
Clear labels
authentication
backlog
bug
chapter editor
config-issue
ebooks
encoding/embedding
enhancement
help wanted
listening sessions & progress
planned
possible plugin
progress sync
pull-request
sorting/filtering/searching
unable to reproduce
upload
users & permissions
waiting
Mirrored from GitHub Pull Request
No Label
bug
Milestone
No items
No Milestone
Projects
Clear projects
No project
Assignees
adam (Adam Melkus)
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/audiobookshelf#1217
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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 @Bitwolfies on GitHub (Jun 27, 2023).
Describe the issue
I wish I could offer more, but some audiobooks ripped from openaudible refuse to play, I thought it was due to my tag editing, but even untouched ones fail, and the ffmpeg logs are of no help.
Files play fine in VLC, Elisa, even the Synology DSM audioplayer.
If there is any way for me to send info on the file I will, as I get the legal grey area of actually sending you affected files.
2023-06-27 01:33:56
INFO
[STREAM] START STREAM - Num Segments: 4972
2023-06-27 01:33:56
INFO
[INFO] FFMPEG transcoding started with command: ffmpeg -seek_timestamp 1 -f concat -safe 0 -i /metadata/streams/play_5rlpoecr8u1draa3rl/files.txt -y -loglevel error -map 0:a -c:a copy -f hls -copyts -avoid_negative_ts make_non_negative -max_delay 5000000 -max_muxing_queue_size 2048 -hls_time 6 -hls_segment_type mpegts -start_number 0 -hls_playlist_type vod -hls_list_size 0 -hls_allow_cache 0 -hls_segment_filename /metadata/streams/play_5rlpoecr8u1draa3rl/output-%d.ts /metadata/streams/play_5rlpoecr8u1draa3rl/final-output.m3u8
2023-06-27 01:33:56
INFO
2023-06-27 01:33:56
INFO
[adts @ 0x7fef1376f2c0] Scalable configurations are not allowed in ADTS
2023-06-27 01:33:56
INFO
[out#0/hls @ 0x7fef1383bcc0] Could not write header (incorrect codec parameters ?): Invalid data found when processing input
2023-06-27 01:33:56
INFO
[aost#0:0/copy @ 0x7fef128c4900] Error initializing output stream:
2023-06-27 01:33:56
INFO
2023-06-27 01:33:56
INFO
2023-06-27 01:33:56
ERROR
Ffmpeg Err "ffmpeg exited with code 1: "
Audiobookshelf version
v2.2.23
How are you running audiobookshelf?
Docker
@GlozingNeuter commented on GitHub (Jun 28, 2023):
Same issue on v2.2.23 through Docker with a .m4b file (457MB) at a 44.1kHz sample rate. Could it be related to #172 ?
@advplyr commented on GitHub (Jun 28, 2023):
Possibly related to #172. I would need a sample audio file to reproduce this
@Bitwolfies commented on GitHub (Jun 29, 2023):
I have no issue providing a sample file if you have a method.
@advplyr commented on GitHub (Jun 29, 2023):
Have you used OpenAudible to convert your audiobooks?
@Bitwolfies commented on GitHub (Jun 29, 2023):
Yes, may very well be an issue with open audible, but as said even the most obscure players play them fine.
@gianmarcotoso commented on GitHub (Jul 9, 2023):
@advplyr I have an easy reproduction for this, at least it seems to be consistent as far as I can tell. Downloading books from Audible you get AAX files that have filenames that end with either
ep6orep7, I'm not sure what it means but I'd guess it's a quality format thing. Using AAX Audio Converter to convert these books to m4b yields files that are playable without issues via Chrome or via the Android App, but with Firefox (that doesn't probably support the codec) transcoding is required. Allep6files play without issues, while allep7files fail to play. I can, however, transcode them manually with ffmpeg with no problems using this command:Incurring in a quality loss, of course.
To recap:
ep7All three acts of The Sandman are in ep7 format, so if you purchased those you can test with them, otherwise most new books should also be in this format.
EDIT: AAX Audio Converter requires activation bytes, you can get those from here using any book downloaded from Audible's website (it won't be uploaded, just parsed locally).
@advplyr commented on GitHub (Jul 9, 2023):
@gianmarcotoso Thanks for breaking this down. It may be a while before I dig into this. I'm trying to migrate the current file-based JSON database to a sqlite db.
On quick glance it looks like the solution to this will be to update the transcoder located in
Stream.jshttps://github.com/advplyr/audiobookshelf/blob/master/server/objects/Stream.js#L250I've been using
-c:a aacfor some codecs and mime types when creating the HLS stream@gianmarcotoso commented on GitHub (Jul 9, 2023):
Thank you and thanks for pointing out a starting point, if I get some time I'll attempt a PR myself!
@gianmarcotoso commented on GitHub (Jul 12, 2023):
@advplyr Upon further investigation, the fix is already in place and strangely enough it does work on a clean dev environment. On my production server, however, the error outputted by
ffmpegis slightly different, and therefore is not caught by the temporary workaround.The error in my dev container:
The error on my production server:
Changing the condition to force re-encoding from
err.message.startsWithtoerr.message.includesmight solve the issue but in order to test this I would have to build a docker image to run on my production server instead of the official one. Do you have any pointers on how to do that?That said, I'm going to investigate further to see if there is some way of detecting this problem earlier and force transcoding without failing first, as it would speed up the start of the playback session. The files I'm analyzing (one good, one bad) are both AAC encoded, so there must be some other property to check. Also, this only happens in Firefox, so saving the user-agent and forcing the workaround only for Firefox clients might help.
I'll keep you posted.
@advplyr commented on GitHub (Jul 12, 2023):
The error on your production server is not showing anything after the
:so it doesn't look like changing toincludeswould do anything.The only difference between the production and development server would be the log level. I'm not sure if this would make a difference but you could try changing
https://github.com/advplyr/audiobookshelf/blob/78fe6d47ba2c572b824f01f7d109463b006c2f0d/server/objects/Stream.js#L276
to
const logLevel = process.env.NODE_ENV === 'production' ? 'error' : 'errorThen you can see if that is the reason the production side is different. If that is the case then we can just set the loglevel to
warningon both dev & prod@JonesGreen commented on GitHub (Jul 16, 2023):
Hi, I had the same error and found this: https://rentry.co/n4ost
I changed my m4b file and it worked fine again. But I believe the file worked sometime in the past. But I don't know when it got broken.
@gianmarcotoso commented on GitHub (Jul 16, 2023):
Thanks for the tip, I've tried it and it does indeed work. The best solution, I think, would then be to detect broken files (maybe during library scan) and allow for a one-click fix from the UI, so that unnecessary transcoding is avoided. This might require a bit of work though, I'll try to investigate.
@patrickrobbins commented on GitHub (Aug 28, 2023):
I found a file with this issue as well today, I didn't notice for a while b/c it worked fine playing locally downloaded to an android device. It seemed like it was working and then broke mid file, but I think I had only listened on mobile at that point.
@gianmarcotoso commented on GitHub (Aug 28, 2023):
Since it's not a common occurrence, right now the easiest way to fix this is to fix the problematic files directly. I have added this script to my path:
It's the same one from the link mentioned above (it does not appear to be working right now though), modified to make it work using the
bento4AUR package on Arch.Then I did a simple:
In my library folder, deleted the old files and restarted audiobookshelf for good measure.
@jufy111 commented on GitHub (Sep 26, 2023):
I have been having similar issues, files don't play on Firefox but will play fine on Edge browser, so it could be an issue with Firefox.
Is anyone else able to test if using a different browser will allow for playback of problematic files?
I have just resorted to re-encoding the problematic files with FFMPEG.
@gianmarcotoso commented on GitHub (Sep 26, 2023):
I believe it's the same issue. Instead of re-encoding you could give a try to the method I've proposed in my previous comment, it takes a lot less to complete (a couple of seconds per file).
@advplyr commented on GitHub (Oct 3, 2023):
This is an issue with the audio file itself and not Abs but in the next release they should properly fallback to transcoding with #2171. Discussed also in #2157
@Bitwolfies commented on GitHub (Oct 19, 2023):
To update, the issue is that firefox seemingly cant play 44.1hz files, but it can play 22hz fine. 44hz plays fine in the android app with no transcoidng, so its good to see that trancoidng kicks in when needed.
@ghost commented on GitHub (Apr 9, 2024):
Hi could anyone explain how this works? I am running Windows 11, and I need to fix a few audiobooks with this glitch because they don't play properly in iTunes or on my iPad or iPhone.
How do I install Bento4 and what format do I save that script as? I do know how to add environmental variables to PATH. Do I save the script itself to the path, or the Bento4 package?