mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-02 22:46:55 -05:00
Issue playing some .m4b files #87
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-advplyr#87
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 @BLuR457 on GitHub (Nov 7, 2021).
Im having issues playing some .m4b files. Some work fine and others seem to have an ffmpeg error (see below). All mp3 files work fine. The files that don't work with audiobookshelf work fine with iTunes and Windows Media Player. All files were converted from .aax with OpenAudible. Any idea how to fix this? I can convert the files to .mp3 but id rather use .m4b.
`2021-11-08 04:01:30
INFO
[STREAM] START STREAM - Num Segments: 6004
2021-11-08 04:01:30
INFO
Stream Opened for client BLuR for audiobook Halo Divine Wind with streamId kvq50t4o
2021-11-08 04:01:30
INFO
[INFO] FFMPEG transcoding started with command: ffmpeg -seek_timestamp 1 -f concat -safe 0 -i /metadata/streams/kvq50t4o/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/kvq50t4o/output-%d.ts /metadata/streams/kvq50t4o/final-output.m3u8
2021-11-08 04:01:30
INFO
2021-11-08 04:01:30
DEBUG
[DB] Updated user 1
2021-11-08 04:01:30
INFO
[adts @ 0x7f1a5bcb43c0] Scalable configurations are not allowed in ADTS
2021-11-08 04:01:30
INFO
Could not write header for output file #0 (incorrect codec parameters ?): Invalid data found when processing input
2021-11-08 04:01:30
INFO
Error initializing output stream 0:0 --
2021-11-08 04:01:30
INFO
2021-11-08 04:01:30
INFO
2021-11-08 04:01:30
ERROR
Ffmpeg Err ffmpeg exited with code 1: Could not write header for output file #0 (incorrect codec parameters ?): Invalid data found when processing input Error initializing output stream 0:0 --`
@advplyr commented on GitHub (Nov 8, 2021):
I'm still learning as I go when it comes to audio transcoding and streaming, so I need to be able to reproduce this on my end.
Are you able to get me an audio file to test with?
@BLuR457 commented on GitHub (Nov 8, 2021):
Sure. Here is a link. It might be a size thing with .m4b files. I've converted about 6 books to .mb4 and the ones that work are all under 500MB. I'll convert some more and get back with you.
@BLuR457 commented on GitHub (Nov 8, 2021):
I converted all of my audiobooks to .m4b and books under 500MB work and books over don't. One book is 502 and doesn't work.
@advplyr commented on GitHub (Nov 13, 2021):
I have been investigating this issue and found someone who had the same issue: https://rentry.co/n4ost
They are "de-DRMed Audible AAX files" and you can see in FFMPEG where they added the error message that is getting thrown:
"Scalable configurations are not allowed in ADTS"
gitea.bjx.cloud/public/ffmpeg@496dcbbc86In my tests I was able to generate the stream by forcing an encode to AAC, and according to that person who kindly outlined the error, Plex has found a way to catch this ahead of time and force the encode.
The lazy solution would be to catch this error, then fallback to forcing the encode.
The optimal solution would be to detect this before starting the stream.
@advplyr commented on GitHub (Nov 13, 2021):
I implemented the lazy solution and released in
v1.6.17.Basically if the transcode fails with that error message and is AAC encodable, then it will fallback to encoding. This worked with the sample audiobook you sent me, but be warned it is a lot slower to get started.
Hopefully this workaround will suffice until a better solution comes along.
@BLuR457 commented on GitHub (Nov 15, 2021):
Thanks. I'll update later today.
@openaudible commented on GitHub (May 18, 2022):
OpenAudible here. I just saw this and saw someone posted a write up of the problem and a possible fix (that requires changing a bit in the file..)
https://rentry.co/n4ost
Might try to find some sample files and see if I can reproduce or fix. Would be nice if the bad bit doesn't get propagated.
@advplyr commented on GitHub (May 18, 2022):
I came across that writeup too https://github.com/advplyr/audiobookshelf/issues/172#issuecomment-968064121
Very useful
@wchargin commented on GitHub (Jan 5, 2025):
I found this thread while troubleshooting a similar issue. An audiobook made of many small m4b files worked fine, but an audiobook with one large, chapterized m4b file (of similar total size) could not be scanned.
In my
journalctl -u audiobookshelflogs, I saw a reference to a scan log, which included the message:I checked that the m4b file was actually playable in VLC, and it was. So I tried running
ffprobeon it, using the binary at/usr/share/audiobookshelf/ffprobe. This quickly printedKilled: it was being killed by the Linux OOM killer. This makes some sense, since my Audiobookshelf instance was running on a small DigitalOcean droplet with 512 MB of RAM.(Additionally, sometimes pressing "Scan" would crash the Audiobookshelf service itself, and it would be restarted by systemd.)
I upgraded my droplet to 2 GB of RAM, and scanned again. This time, it picked up the file and added the library item, and I can play it without problems.
Thank you for Audiobookshelf! I am happy with it so far.