[Bug]: Chapter count >255 don't show in external player due to Embed Metadata command #2902

Open
opened 2026-04-25 00:11:43 +02:00 by adam · 0 comments
Owner

Originally created by @anakinsleftleg on GitHub (Jul 17, 2025).

What happened?

Actual Behavior
Audiobookshelf’s FFmpeg command embeds both Nero and QT chapters. Nero’s 255-chapter limit takes precedence in players, hiding excess chapters, even though QT chapters contain the full count (e.g., 1025).

Description
When generating an .m4b file (e.g., "Mark Twain Collections.m4b" with 1025 chapters), Audiobookshelf embeds both Nero (chpl) and QuickTime (QT) chapters. Players like VLC prioritize Nero chapters, which are limited to 255, causing chapters beyond this limit to be invisible, even though QT chapters (supporting all 1025) exist. Disabling Nero chapters (e.g., via -movflags disable_chpl in FFmpeg) makes all QT chapters visible.

Reference #4488

What did you expect to happen?

Audiobookshelf should generate .m4b files with only QT chapters (no Nero chapters) when chapter counts exceed 255, ensuring all chapters are visible in players like VLC, matching the behavior of files with only QT chapters

Steps to reproduce the issue

  1. Create an .m4b file with >255 chapters (e.g., 1025) using Audiobookshelf’s metadata embedding feature.
  2. Use FFmpeg command from Audiobookshelf logs:
    ffmpeg -i input.m4b -i ffmetadata.txt -i cover.jpg -y -map 0:a -map_metadata 1 -map_metadata 0 -map_chapters 1 -c copy -metadata track=1 -f mp4 -map 2:v -disposition:v:0 attached_pic -metadata:s:v title=Cover -metadata:s:v comment=Cover output.m4b
  3. Check chapter visibility in VLC (Playback > Chapter) or MediaInfo (Menu 1 for QT, Menu 2 for Nero).
  4. Observe only 255 chapters (Nero limit) displayed, despite ffprobe showing 1025 chapters.
  5. Reprocess with -movflags disable_chpl and confirm all 1025 chapters are visible.

Audiobookshelf version

v2.25.1

How are you running audiobookshelf?

Docker

What OS is your Audiobookshelf server hosted from?

Windows

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

None

Logs


Additional Notes

  • MediaInfo shows Menu 1 (QT) with up to 512 chapters (tool display limit) and Menu 2 (Nero) at 255.
  • ffprobe -i output.m4b -show_chapters confirms 1025 chapters.
  • File with 1025 chapters, QT only, displays all in VLC, indicating Nero presence causes the issue.
  • Suggest modifying FFmpeg command to include -movflags disable_chpl when chapters >255.
Originally created by @anakinsleftleg on GitHub (Jul 17, 2025). ### What happened? **Actual Behavior** Audiobookshelf’s FFmpeg command embeds both Nero and QT chapters. Nero’s 255-chapter limit takes precedence in players, hiding excess chapters, even though QT chapters contain the full count (e.g., 1025). **Description** When generating an .m4b file (e.g., "Mark Twain Collections.m4b" with 1025 chapters), Audiobookshelf embeds both Nero (chpl) and QuickTime (QT) chapters. Players like VLC prioritize Nero chapters, which are limited to 255, causing chapters beyond this limit to be invisible, even though QT chapters (supporting all 1025) exist. Disabling Nero chapters (e.g., via `-movflags disable_chpl` in FFmpeg) makes all QT chapters visible. Reference #4488 ### What did you expect to happen? Audiobookshelf should generate .m4b files with only QT chapters (no Nero chapters) when chapter counts exceed 255, ensuring all chapters are visible in players like VLC, matching the behavior of files with only QT chapters ### Steps to reproduce the issue 1. Create an .m4b file with >255 chapters (e.g., 1025) using Audiobookshelf’s metadata embedding feature. 2. Use FFmpeg command from Audiobookshelf logs: `ffmpeg -i input.m4b -i ffmetadata.txt -i cover.jpg -y -map 0:a -map_metadata 1 -map_metadata 0 -map_chapters 1 -c copy -metadata track=1 -f mp4 -map 2:v -disposition:v:0 attached_pic -metadata:s:v title=Cover -metadata:s:v comment=Cover output.m4b` 3. Check chapter visibility in VLC (Playback > Chapter) or MediaInfo (Menu 1 for QT, Menu 2 for Nero). 4. Observe only 255 chapters (Nero limit) displayed, despite ffprobe showing 1025 chapters. 5. Reprocess with `-movflags disable_chpl` and confirm all 1025 chapters are visible. ### Audiobookshelf version v2.25.1 ### How are you running audiobookshelf? Docker ### What OS is your Audiobookshelf server hosted from? Windows ### If the issue is being seen in the UI, what browsers are you seeing the problem on? None ### Logs ```shell ``` ### Additional Notes * MediaInfo shows Menu 1 (QT) with up to 512 chapters (tool display limit) and Menu 2 (Nero) at 255. * `ffprobe -i output.m4b -show_chapters` confirms 1025 chapters. * File with 1025 chapters, QT only, displays all in VLC, indicating Nero presence causes the issue. * Suggest modifying FFmpeg command to include `-movflags disable_chpl` when chapters >255.
adam added the bug label 2026-04-25 00:11:43 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2902