[Bug]: ffmpeg error with MB4 audiobook #1205

Closed
opened 2026-04-24 23:35:48 +02:00 by adam · 1 comment
Owner

Originally created by @rubbo898 on GitHub (Jun 20, 2023).

Describe the issue

Hello,

after months of smooth sessions I have the first error while playing an audiobook with MB4 format.
It seems a codec issue but I'm a noob:

2023-06-20 16:43:24
INFO
[Server] Socket Connected aDcILjKBZ9OHlDYTAAAB
2023-06-20 16:43:24
DEBUG
[Server] User Online xxxxxxxxxx
2023-06-20 16:43:24
DEBUG
[DB] Updated user: 1
2023-06-20 16:43:33
DEBUG
[PlaybackSessionManager] startSessionRequest for device Windows 10 / Chrome
2023-06-20 16:43:33
DEBUG
[PlaybackSessionManager] "2023-06-20 16:43:24
INFO
[Server] Socket Connected aDcILjKBZ9OHlDYTAAAB
2023-06-20 16:43:24
DEBUG
[Server] User Online xxxxxxxxxx
2023-06-20 16:43:24
DEBUG
[DB] Updated user: 1
2023-06-20 16:43:33
DEBUG
[PlaybackSessionManager] startSessionRequest for device Windows 10 / Chrome
2023-06-20 16:43:33
DEBUG
[PlaybackSessionManager] "xxxxxxxxxx" starting direct play session for item "li_xk4yrds5lkuny3bn6h" with id play_m8e68uquc8yl8xyoui (Device: Windows 10 / Chrome)
2023-06-20 16:43:33
DEBUG
[PlaybackSessionManager] startSessionRequest for device Windows 10 / Chrome
2023-06-20 16:43:33
INFO
[PlaybackSessionManager] startSession: Closing open session "L'ultima sentinella" for user "xxxxxxxxxx" (Device: Windows 10 / Chrome)
2023-06-20 16:43:33
DEBUG
[PlaybackSessionManager] closeSession "play_m8e68uquc8yl8xyoui"
2023-06-20 16:43:33
DEBUG
[PlaybackSessionManager] Removed session "play_m8e68uquc8yl8xyoui"
2023-06-20 16:43:33
DEBUG
[PlaybackSessionManager] "xxxxxxxxxx" starting stream session for item "li_xk4yrds5lkuny3bn6h" (Device: Windows 10 / Chrome)
2023-06-20 16:43:33
INFO
[STREAM] START STREAM - Num Segments: 6782
2023-06-20 16:43:33
WARN
File path does not exist /metadata/streams/play_040j647vaob4nn7iyl/output-0.ts
2023-06-20 16:43:33
INFO
[INFO] FFMPEG transcoding started with command: ffmpeg -seek_timestamp 1 -f concat -safe 0 -i /metadata/streams/play_040j647vaob4nn7iyl/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_040j647vaob4nn7iyl/output-%d.ts /metadata/streams/play_040j647vaob4nn7iyl/final-output.m3u8
2023-06-20 16:43:33
INFO
2023-06-20 16:43:34
INFO
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x150dfce5e100] stream 0, missing mandatory atoms, broken header
2023-06-20 16:43:34
INFO
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x150dfce5e100] Referenced QT chapter track not found
2023-06-20 16:43:34
INFO
[adts @ 0x5629f2963640] Scalable configurations are not allowed in ADTS
2023-06-20 16:43:34
INFO
[out#0/hls @ 0x150dfd229a40] Could not write header (incorrect codec parameters ?): Invalid data found when processing input
2023-06-20 16:43:34
INFO
[aost#0:0/copy @ 0x150df8eefac0] Error initializing output stream:
2023-06-20 16:43:34
INFO
2023-06-20 16:43:34
INFO
2023-06-20 16:43:34
ERROR
Ffmpeg Err "ffmpeg exited with code 1: "
2023-06-20 16:43:34
INFO
Closing Stream play_040j647vaob4nn7iyl
2023-06-20 16:43:34
INFO
Deleted session data /metadata/streams/play_040j647vaob4nn7iyl
2023-06-20 16:43:34
DEBUG
[PlaybackSessionManager] Stream closed for session "play_040j647vaob4nn7iyl" (Device: Windows 10 / Chrome)
2023-06-20 16:43:35
WARN
File path does not exist /metadata/streams/play_040j647vaob4nn7iyl/output-0.ts
2023-06-20 16:43:35
ERROR
[HlsRouter] Stream play_040j647vaob4nn7iyl does not exist
2023-06-20 16:43:37
WARN
File path does not exist /metadata/streams/play_040j647vaob4nn7iyl/output-0.ts
2023-06-20 16:43:37
ERROR
[HlsRouter] Stream play_040j647vaob4nn7iyl does not exist
2023-06-20 16:43:41
WARN
File path does not exist /metadata/streams/play_040j647vaob4nn7iyl/output-0.ts
2023-06-20 16:43:41
ERROR
[HlsRouter] Stream play_040j647vaob4nn7iyl does not exist
2023-06-20 16:43:49
WARN
File path does not exist /metadata/streams/play_040j647vaob4nn7iyl/output-0.ts
2023-06-20 16:43:49
ERROR
[HlsRouter] Stream play_040j647vaob4nn7iyl does not exist
2023-06-20 16:44:05
WARN
File path does not exist /metadata/streams/play_040j647vaob4nn7iyl/output-0.ts
2023-06-20 16:44:05
ERROR
[HlsRouter] Stream play_040j647vaob4nn7iyl does not exist" starting direct play session for item "li_xk4yrds5lkuny3bn6h" with id play_m8e68uquc8yl8xyoui (Device: Windows 10 / Chrome)
2023-06-20 16:43:33
DEBUG
[PlaybackSessionManager] startSessionRequest for device Windows 10 / Chrome
2023-06-20 16:43:33
INFO
[PlaybackSessionManager] startSession: Closing open session "L'ultima sentinella" for user "xxxxxxxxxx" (Device: Windows 10 / Chrome)
2023-06-20 16:43:33
DEBUG
[PlaybackSessionManager] closeSession "play_m8e68uquc8yl8xyoui"
2023-06-20 16:43:33
DEBUG
[PlaybackSessionManager] Removed session "play_m8e68uquc8yl8xyoui"
2023-06-20 16:43:33
DEBUG
[PlaybackSessionManager] "xxxxxxxxxx" starting stream session for item "li_xk4yrds5lkuny3bn6h" (Device: Windows 10 / Chrome)
2023-06-20 16:43:33
INFO
[STREAM] START STREAM - Num Segments: 6782
2023-06-20 16:43:33
WARN
File path does not exist /metadata/streams/play_040j647vaob4nn7iyl/output-0.ts
2023-06-20 16:43:33
INFO
[INFO] FFMPEG transcoding started with command: ffmpeg -seek_timestamp 1 -f concat -safe 0 -i /metadata/streams/play_040j647vaob4nn7iyl/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_040j647vaob4nn7iyl/output-%d.ts /metadata/streams/play_040j647vaob4nn7iyl/final-output.m3u8
2023-06-20 16:43:33
INFO
2023-06-20 16:43:34
INFO
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x150dfce5e100] stream 0, missing mandatory atoms, broken header
2023-06-20 16:43:34
INFO
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x150dfce5e100] Referenced QT chapter track not found
2023-06-20 16:43:34
INFO
[adts @ 0x5629f2963640] Scalable configurations are not allowed in ADTS
2023-06-20 16:43:34
INFO
[out#0/hls @ 0x150dfd229a40] Could not write header (incorrect codec parameters ?): Invalid data found when processing input
2023-06-20 16:43:34
INFO
[aost#0:0/copy @ 0x150df8eefac0] Error initializing output stream:
2023-06-20 16:43:34
INFO
2023-06-20 16:43:34
INFO
2023-06-20 16:43:34
ERROR
Ffmpeg Err "ffmpeg exited with code 1: "
2023-06-20 16:43:34
INFO
Closing Stream play_040j647vaob4nn7iyl
2023-06-20 16:43:34
INFO
Deleted session data /metadata/streams/play_040j647vaob4nn7iyl
2023-06-20 16:43:34
DEBUG
[PlaybackSessionManager] Stream closed for session "play_040j647vaob4nn7iyl" (Device: Windows 10 / Chrome)
2023-06-20 16:43:35
WARN
File path does not exist /metadata/streams/play_040j647vaob4nn7iyl/output-0.ts
2023-06-20 16:43:35
ERROR
[HlsRouter] Stream play_040j647vaob4nn7iyl does not exist
2023-06-20 16:43:37
WARN
File path does not exist /metadata/streams/play_040j647vaob4nn7iyl/output-0.ts
2023-06-20 16:43:37
ERROR
[HlsRouter] Stream play_040j647vaob4nn7iyl does not exist
2023-06-20 16:43:41
WARN
File path does not exist /metadata/streams/play_040j647vaob4nn7iyl/output-0.ts
2023-06-20 16:43:41
ERROR
[HlsRouter] Stream play_040j647vaob4nn7iyl does not exist
2023-06-20 16:43:49
WARN
File path does not exist /metadata/streams/play_040j647vaob4nn7iyl/output-0.ts
2023-06-20 16:43:49
ERROR
[HlsRouter] Stream play_040j647vaob4nn7iyl does not exist
2023-06-20 16:44:05
WARN
File path does not exist /metadata/streams/play_040j647vaob4nn7iyl/output-0.ts
2023-06-20 16:44:05
ERROR
[HlsRouter] Stream play_040j647vaob4nn7iyl does not exist

This is a local session via web console but the outcome is the same both via public (traefik proxy) and application.
I've tried to stream the file locally with VLC and it works.

Do you need the files to troubleshoot the issue? If so, how can I share it?

Thank you for the great work!

Steps to reproduce the issue

  1. Just start playing the audiobook

Audiobookshelf version

v2.2.23

How are you running audiobookshelf?

Docker

Originally created by @rubbo898 on GitHub (Jun 20, 2023). ### Describe the issue Hello, after months of smooth sessions I have the first error while playing an audiobook with MB4 format. It seems a codec issue but I'm a noob: ``` 2023-06-20 16:43:24 INFO [Server] Socket Connected aDcILjKBZ9OHlDYTAAAB 2023-06-20 16:43:24 DEBUG [Server] User Online xxxxxxxxxx 2023-06-20 16:43:24 DEBUG [DB] Updated user: 1 2023-06-20 16:43:33 DEBUG [PlaybackSessionManager] startSessionRequest for device Windows 10 / Chrome 2023-06-20 16:43:33 DEBUG [PlaybackSessionManager] "2023-06-20 16:43:24 INFO [Server] Socket Connected aDcILjKBZ9OHlDYTAAAB 2023-06-20 16:43:24 DEBUG [Server] User Online xxxxxxxxxx 2023-06-20 16:43:24 DEBUG [DB] Updated user: 1 2023-06-20 16:43:33 DEBUG [PlaybackSessionManager] startSessionRequest for device Windows 10 / Chrome 2023-06-20 16:43:33 DEBUG [PlaybackSessionManager] "xxxxxxxxxx" starting direct play session for item "li_xk4yrds5lkuny3bn6h" with id play_m8e68uquc8yl8xyoui (Device: Windows 10 / Chrome) 2023-06-20 16:43:33 DEBUG [PlaybackSessionManager] startSessionRequest for device Windows 10 / Chrome 2023-06-20 16:43:33 INFO [PlaybackSessionManager] startSession: Closing open session "L'ultima sentinella" for user "xxxxxxxxxx" (Device: Windows 10 / Chrome) 2023-06-20 16:43:33 DEBUG [PlaybackSessionManager] closeSession "play_m8e68uquc8yl8xyoui" 2023-06-20 16:43:33 DEBUG [PlaybackSessionManager] Removed session "play_m8e68uquc8yl8xyoui" 2023-06-20 16:43:33 DEBUG [PlaybackSessionManager] "xxxxxxxxxx" starting stream session for item "li_xk4yrds5lkuny3bn6h" (Device: Windows 10 / Chrome) 2023-06-20 16:43:33 INFO [STREAM] START STREAM - Num Segments: 6782 2023-06-20 16:43:33 WARN File path does not exist /metadata/streams/play_040j647vaob4nn7iyl/output-0.ts 2023-06-20 16:43:33 INFO [INFO] FFMPEG transcoding started with command: ffmpeg -seek_timestamp 1 -f concat -safe 0 -i /metadata/streams/play_040j647vaob4nn7iyl/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_040j647vaob4nn7iyl/output-%d.ts /metadata/streams/play_040j647vaob4nn7iyl/final-output.m3u8 2023-06-20 16:43:33 INFO 2023-06-20 16:43:34 INFO [mov,mp4,m4a,3gp,3g2,mj2 @ 0x150dfce5e100] stream 0, missing mandatory atoms, broken header 2023-06-20 16:43:34 INFO [mov,mp4,m4a,3gp,3g2,mj2 @ 0x150dfce5e100] Referenced QT chapter track not found 2023-06-20 16:43:34 INFO [adts @ 0x5629f2963640] Scalable configurations are not allowed in ADTS 2023-06-20 16:43:34 INFO [out#0/hls @ 0x150dfd229a40] Could not write header (incorrect codec parameters ?): Invalid data found when processing input 2023-06-20 16:43:34 INFO [aost#0:0/copy @ 0x150df8eefac0] Error initializing output stream: 2023-06-20 16:43:34 INFO 2023-06-20 16:43:34 INFO 2023-06-20 16:43:34 ERROR Ffmpeg Err "ffmpeg exited with code 1: " 2023-06-20 16:43:34 INFO Closing Stream play_040j647vaob4nn7iyl 2023-06-20 16:43:34 INFO Deleted session data /metadata/streams/play_040j647vaob4nn7iyl 2023-06-20 16:43:34 DEBUG [PlaybackSessionManager] Stream closed for session "play_040j647vaob4nn7iyl" (Device: Windows 10 / Chrome) 2023-06-20 16:43:35 WARN File path does not exist /metadata/streams/play_040j647vaob4nn7iyl/output-0.ts 2023-06-20 16:43:35 ERROR [HlsRouter] Stream play_040j647vaob4nn7iyl does not exist 2023-06-20 16:43:37 WARN File path does not exist /metadata/streams/play_040j647vaob4nn7iyl/output-0.ts 2023-06-20 16:43:37 ERROR [HlsRouter] Stream play_040j647vaob4nn7iyl does not exist 2023-06-20 16:43:41 WARN File path does not exist /metadata/streams/play_040j647vaob4nn7iyl/output-0.ts 2023-06-20 16:43:41 ERROR [HlsRouter] Stream play_040j647vaob4nn7iyl does not exist 2023-06-20 16:43:49 WARN File path does not exist /metadata/streams/play_040j647vaob4nn7iyl/output-0.ts 2023-06-20 16:43:49 ERROR [HlsRouter] Stream play_040j647vaob4nn7iyl does not exist 2023-06-20 16:44:05 WARN File path does not exist /metadata/streams/play_040j647vaob4nn7iyl/output-0.ts 2023-06-20 16:44:05 ERROR [HlsRouter] Stream play_040j647vaob4nn7iyl does not exist" starting direct play session for item "li_xk4yrds5lkuny3bn6h" with id play_m8e68uquc8yl8xyoui (Device: Windows 10 / Chrome) 2023-06-20 16:43:33 DEBUG [PlaybackSessionManager] startSessionRequest for device Windows 10 / Chrome 2023-06-20 16:43:33 INFO [PlaybackSessionManager] startSession: Closing open session "L'ultima sentinella" for user "xxxxxxxxxx" (Device: Windows 10 / Chrome) 2023-06-20 16:43:33 DEBUG [PlaybackSessionManager] closeSession "play_m8e68uquc8yl8xyoui" 2023-06-20 16:43:33 DEBUG [PlaybackSessionManager] Removed session "play_m8e68uquc8yl8xyoui" 2023-06-20 16:43:33 DEBUG [PlaybackSessionManager] "xxxxxxxxxx" starting stream session for item "li_xk4yrds5lkuny3bn6h" (Device: Windows 10 / Chrome) 2023-06-20 16:43:33 INFO [STREAM] START STREAM - Num Segments: 6782 2023-06-20 16:43:33 WARN File path does not exist /metadata/streams/play_040j647vaob4nn7iyl/output-0.ts 2023-06-20 16:43:33 INFO [INFO] FFMPEG transcoding started with command: ffmpeg -seek_timestamp 1 -f concat -safe 0 -i /metadata/streams/play_040j647vaob4nn7iyl/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_040j647vaob4nn7iyl/output-%d.ts /metadata/streams/play_040j647vaob4nn7iyl/final-output.m3u8 2023-06-20 16:43:33 INFO 2023-06-20 16:43:34 INFO [mov,mp4,m4a,3gp,3g2,mj2 @ 0x150dfce5e100] stream 0, missing mandatory atoms, broken header 2023-06-20 16:43:34 INFO [mov,mp4,m4a,3gp,3g2,mj2 @ 0x150dfce5e100] Referenced QT chapter track not found 2023-06-20 16:43:34 INFO [adts @ 0x5629f2963640] Scalable configurations are not allowed in ADTS 2023-06-20 16:43:34 INFO [out#0/hls @ 0x150dfd229a40] Could not write header (incorrect codec parameters ?): Invalid data found when processing input 2023-06-20 16:43:34 INFO [aost#0:0/copy @ 0x150df8eefac0] Error initializing output stream: 2023-06-20 16:43:34 INFO 2023-06-20 16:43:34 INFO 2023-06-20 16:43:34 ERROR Ffmpeg Err "ffmpeg exited with code 1: " 2023-06-20 16:43:34 INFO Closing Stream play_040j647vaob4nn7iyl 2023-06-20 16:43:34 INFO Deleted session data /metadata/streams/play_040j647vaob4nn7iyl 2023-06-20 16:43:34 DEBUG [PlaybackSessionManager] Stream closed for session "play_040j647vaob4nn7iyl" (Device: Windows 10 / Chrome) 2023-06-20 16:43:35 WARN File path does not exist /metadata/streams/play_040j647vaob4nn7iyl/output-0.ts 2023-06-20 16:43:35 ERROR [HlsRouter] Stream play_040j647vaob4nn7iyl does not exist 2023-06-20 16:43:37 WARN File path does not exist /metadata/streams/play_040j647vaob4nn7iyl/output-0.ts 2023-06-20 16:43:37 ERROR [HlsRouter] Stream play_040j647vaob4nn7iyl does not exist 2023-06-20 16:43:41 WARN File path does not exist /metadata/streams/play_040j647vaob4nn7iyl/output-0.ts 2023-06-20 16:43:41 ERROR [HlsRouter] Stream play_040j647vaob4nn7iyl does not exist 2023-06-20 16:43:49 WARN File path does not exist /metadata/streams/play_040j647vaob4nn7iyl/output-0.ts 2023-06-20 16:43:49 ERROR [HlsRouter] Stream play_040j647vaob4nn7iyl does not exist 2023-06-20 16:44:05 WARN File path does not exist /metadata/streams/play_040j647vaob4nn7iyl/output-0.ts 2023-06-20 16:44:05 ERROR [HlsRouter] Stream play_040j647vaob4nn7iyl does not exist ``` This is a local session via web console but the outcome is the same both via public (traefik proxy) and application. I've tried to stream the file locally with VLC and it works. Do you need the files to troubleshoot the issue? If so, how can I share it? Thank you for the great work! ### Steps to reproduce the issue 1. Just start playing the audiobook ### Audiobookshelf version v2.2.23 ### How are you running audiobookshelf? Docker
adam added the bug label 2026-04-24 23:35:48 +02:00
adam closed this issue 2026-04-24 23:35:48 +02:00
Author
Owner

@advplyr commented on GitHub (Jun 20, 2023):

VLC is not a great way to test bad encodings because they do some magic under the hood to fix issues on the fly that would be out of the scope of this project. Sometimes there are audio files with bad encodings that need to be re-encoded. If it is failing to play in the browser then the audio file cannot be played in a regular HTML5 audio element.

You can try doing a simple command like ffmpeg -i /path/to/audiofile.m4b -c copy output.m4b to see if that output file is fixed.

You can do an ffprobe to see the codec and other info ffprobe -i /path/to/audiofile.m4b -show_streams -show_format -print_format json

If we can identify that this is a bug and not a bad encoding then we can re-open this one.

@advplyr commented on GitHub (Jun 20, 2023): VLC is not a great way to test bad encodings because they do some magic under the hood to fix issues on the fly that would be out of the scope of this project. Sometimes there are audio files with bad encodings that need to be re-encoded. If it is failing to play in the browser then the audio file cannot be played in a regular HTML5 audio element. You can try doing a simple command like `ffmpeg -i /path/to/audiofile.m4b -c copy output.m4b` to see if that output file is fixed. You can do an ffprobe to see the codec and other info `ffprobe -i /path/to/audiofile.m4b -show_streams -show_format -print_format json` If we can identify that this is a bug and not a bad encoding then we can re-open this one.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#1205