mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-30 23:40:40 +02:00
[Bug]: stream failed: undefined when playing from the web app #1803
Closed
opened 2026-04-24 23:58:35 +02:00 by adam
·
24 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
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1
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#1803
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 @eudes on GitHub (Mar 7, 2024).
Describe the issue
In the web app, when playing a lot of my new library items (but no all) I get a pillbox alert saying "stream failed: undefined".
Playing the same item from the Android app works fine.
Attached console and HAR logs.
This is the server log:
console-export-2024-3-7_22-28-26.txt
audiobookshelf.media.lo_Archive [24-03-07 22-28-41].zip
Steps to reproduce the issue
Audiobookshelf version
2.8.0
How are you running audiobookshelf?
Docker
@datenzar commented on GitHub (Mar 11, 2024):
Same issue here. I observe it in particular with m4b audiobooks that I converted from Audible. Some relevant codec details (hope that helps):
@advplyr commented on GitHub (Mar 11, 2024):
The error message here needs to be fixed but I think I'll need a sample audio file to test with if you can send one
@datenzar commented on GitHub (Mar 12, 2024):
Hi @advplyr,
thanks for your response! I provided you with a sample to your mail address. Let me know if you need anything else.
@eudes commented on GitHub (Mar 12, 2024):
I've also provided a sample via email.
@Poizunlol commented on GitHub (Mar 12, 2024):
Not sure if this is helpful, I also listen to m4b audiobooks that I converted from Audible.
I exclusive run into this issue when I use Firefox. If I use a Chromium based browser I don't have any issues.
@datenzar commented on GitHub (Mar 12, 2024):
Hi @Poizunlol,
thanks a lot, your tip was indeed helpful! Switching to another browser solved the issue.
Though it makes me wonder why Firefox cannot play the file...
@Poizunlol commented on GitHub (Mar 13, 2024):
@datenzar I don't know why, it worked previously I seem to remember that this happened after a recent update of Firefox.
@legohero commented on GitHub (Mar 13, 2024):
I had the same issue and it seems like it goes way back to 2021. The solution seems to be to reencode the problematic file. Examples in #1872 and #172 (comment). #1872 comment might be helpful. Tried it myself yesterday and can confirm it works.
@advplyr commented on GitHub (Mar 13, 2024):
Ah yeah this is the same issue that keeps coming up specifically with certain audible audiobooks. The transcoding should still work though so I'll look into that. I recommend re-encoding those anyway just so you can direct play the file everywhere you need.
@legohero commented on GitHub (Mar 14, 2024):
Indeed, my problem file is also from audible. I appreciate ya @advplyr
@advplyr commented on GitHub (Mar 15, 2024):
Thanks for the sample files. I found the issue with HLS.js that handles streaming and was able to play the bad files after a few second delay. Just to reiterate this is only an issue with firefox that I'm aware of. Chromium browsers can direct play those files still.
This is the series of events that happen:
That explains the additional delay you will see
@advplyr commented on GitHub (Mar 17, 2024):
Fixed in v2.8.1
@whoopn commented on GitHub (Mar 17, 2024):
This doesn't appear to be fixed in firefox still.
Unraid using Docker, on 2.8.1
`2024-03-16 19:39:11.279
INFO
[STREAM] START STREAM - Num Segments: 691
2024-03-16 19:39:11.296
INFO
[INFO] FFMPEG transcoding started with command: ffmpeg -seek_timestamp 1 -f concat -safe 0 -i /metadata/streams/e2915e19-af34-449f-bab3-2249a1848512/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/e2915e19-af34-449f-bab3-2249a1848512/output-%d.ts /metadata/streams/e2915e19-af34-449f-bab3-2249a1848512/final-output.m3u8
2024-03-16 19:39:11.297
INFO
2024-03-16 19:39:11.370
WARN
File path does not exist /metadata/streams/e2915e19-af34-449f-bab3-2249a1848512/output-0.ts
2024-03-16 19:39:11.463
INFO
[adts @ 0x1526055e0680] Scalable configurations are not allowed in ADTS
2024-03-16 19:39:11.465
INFO
[out#0/hls @ 0x152608b48c00] Could not write header (incorrect codec parameters ?): Invalid data found when processing input
2024-03-16 19:39:11.465
INFO
Error opening output file /metadata/streams/e2915e19-af34-449f-bab3-2249a1848512/final-output.m3u8.
2024-03-16 19:39:11.466
INFO
Error opening output files: Invalid data found when processing input
2024-03-16 19:39:11.481
INFO
2024-03-16 19:39:11.482
ERROR
Ffmpeg Err "ffmpeg exited with code 183: Error opening output file /metadata/streams/e2915e19-af34-449f-bab3-2249a1848512/final-output.m3u8. Error opening output files: Invalid data found when processing input "
2024-03-16 19:39:11.483
INFO
Closing Stream e2915e19-af34-449f-bab3-2249a1848512
2024-03-16 19:39:11.490
INFO
Deleted session data /metadata/streams/e2915e19-af34-449f-bab3-2249a1848512
2024-03-16 19:39:11.492
DEBUG
[PlaybackSessionManager] Stream closed for session "e2915e19-af34-449f-bab3-2249a1848512" (Device: Windows 10 / Firefox)
2024-03-16 19:39:12.613
ERROR
[HlsRouter] Stream "e2915e19-af34-449f-bab3-2249a1848512" does not exist
2024-03-16 19:39:14.676
ERROR
[HlsRouter] Stream "e2915e19-af34-449f-bab3-2249a1848512" does not exist
2024-03-16 19:39:19.489
ERROR
[HlsRouter] Stream "e2915e19-af34-449f-bab3-2249a1848512" does not exist
2024-03-16 19:39:27.607
ERROR
[HlsRouter] Stream "e2915e19-af34-449f-bab3-2249a1848512" does not exist
2024-03-16 19:39:35.696
ERROR
[HlsRouter] Stream "e2915e19-af34-449f-bab3-2249a1848512" does not exist
2024-03-16 19:39:43.801
ERROR
[HlsRouter] Stream "e2915e19-af34-449f-bab3-2249a1848512" does not exist
2024-03-16 19:39:51.874
ERROR
[HlsRouter] Stream "e2915e19-af34-449f-bab3-2249a1848512" does not exist
2024-03-16 19:40:00.012
ERROR
[HlsRouter] Stream "e2915e19-af34-449f-bab3-2249a1848512" does not exist`
@yaakovfeldman commented on GitHub (Mar 17, 2024):
I am also still getting this error on Firefox with v2.8.1.
Here are the docker logs:
@yaakovfeldman commented on GitHub (Mar 17, 2024):
Thanks that worked. I was slightly surprised the file size changed (from 1,177,747,344 bytes to 1,177,746,721) if it is just flipping a bit but it worked perfectly. For anyone else finding this https://superuser.com/a/1670248 helped install the bento tools.
@whoopn commented on GitHub (Mar 17, 2024):
While that is a good workaround it’s still a bug no?
Chromium based browsers have zero issues with any file. And WebKit based browsers (iOS) have zero issues. So the question I have is if it’s Firefox and not Audiobookshelf.
@advplyr commented on GitHub (Mar 18, 2024):
I'm not able to reproduce the issue anymore but from your logs I can see why it is still not working for you.
You are getting a different ffmpeg error then we typically get from that issue.
In the code snippet below we are specifically checking for an ffmpeg error "ffmpeg exited with code 1:" and some other criteria before we switch to forcing an AAC encode.
https://github.com/advplyr/audiobookshelf/blob/8e5b7504aead8972d26755a4ee9f4b6420527576/server/objects/Stream.js#L335-L355
You can see this is a hacky solution to try to workaround these (what I believe to be) poorly encoded audio files. As far as I know there is no way to detect beforehand if an m4b audio file has that issue so we have to let it fail first.
We can continue putting in hacky workarounds since this is a common issue. Hopefully someone can come up with a better way to handle this.
I believe this post from 4 years ago identifies the problem. https://rentry.co/n4ost
However, Android can direct play these files now. I think it's only Firefox that doesn't play them.
@whoopn commented on GitHub (Mar 18, 2024):
That is interesting and I can appreciate the not great situation that puts you in. I’ll be honest I’m not re-encoding anything. Here is why: it works on iOS, chrome, edge, safari (on Mac) but only breaks on Firefox.
IMO Firefox needs to be able to handle the situation as all the other browsers do. I think a Mozilla bug is necessary. I realize ffmpeg is involved but I don’t see it as the culprit.
@advplyr commented on GitHub (Mar 18, 2024):
When you press play in Abs the very first thing it tries to do is play the audio file directly with the browser audio player. If that fails for any reason the next thing we do is try to transcode it with ffmpeg. So ffmpeg is only involved if playing the file directly fails.
If you open up a bug report with Mozilla please share it here so we can follow it.
To re-encode the audio file you don't need to follow that method linked above or download anything at all. It is one line in ffmpeg that you could enter in the command line. Ffmpeg is already installed in the docker container.
It doesn't involve anything complicated to re-encode the files, I just wanted to clarify that for anyone else following along.
@whoopn commented on GitHub (Mar 18, 2024):
Understood.
I am a mere user and not sure I could furnish the information Mozilla needs to properly troubleshoot the issue.
I do want to say Audiobookshelf is amazing and I’m really really impressed with its capabilities. For me, the easiest thing to do is not use Firefox.
@fayeinmay commented on GitHub (Apr 2, 2024):
Just adding my 2 cents here by saying that I've been using ABS and Firefox for months now and I could play my converted m4b audiobooks just fine, but it has indeed stopped working on the same files recently. I cannot say if it is due to a Firefox or ABS update though.
@advplyr commented on GitHub (Apr 15, 2024):
It seems like ffmpeg changed their error code to 183 for those files and the fallback was only catching error code 1. This will be updated in the next release.
@fayeinmay commented on GitHub (Apr 22, 2024):
Works fine again with the 2.9.0 release! (Obviously, it does take a while to load because it needs to re-encode first I think, but that's intended.)
@advplyr commented on GitHub (Apr 22, 2024):
Updated in v2.9.0