[Enhancement]: Different picture per chapter support #2084

Open
opened 2026-04-25 00:03:18 +02:00 by adam · 8 comments
Owner

Originally created by @motumotumotu on GitHub (Jul 7, 2024).

Type of Enhancement

None

Describe the Feature/Enhancement

Some of my books have different cover art for each chapter, but in audiobookshelf it only shows the first picture for all chapters. Maybe something to add down the line? (: (My iPod Nano 7th gen support this, the same goes for apples own Books app on iPhone and Mac)

Why would this be helpful?

Should be selv explanatory.

Future Implementation (Screenshot)

1
2
3

Audiobookshelf Server Version

v2.10.1

Current Implementation (Screenshot)

No response

Originally created by @motumotumotu on GitHub (Jul 7, 2024). ### Type of Enhancement None ### Describe the Feature/Enhancement Some of my books have different cover art for each chapter, but in audiobookshelf it only shows the first picture for all chapters. Maybe something to add down the line? (: (My iPod Nano 7th gen support this, the same goes for apples own Books app on iPhone and Mac) ### Why would this be helpful? Should be selv explanatory. ### Future Implementation (Screenshot) ![1](https://github.com/advplyr/audiobookshelf/assets/39010666/56528847-6513-4e57-a470-fa64265d0707) ![2](https://github.com/advplyr/audiobookshelf/assets/39010666/f0571117-de29-44bd-b342-1b79d4f66f27) ![3](https://github.com/advplyr/audiobookshelf/assets/39010666/5ae9c2fa-861a-4211-868f-ae25eb5967dd) ### Audiobookshelf Server Version v2.10.1 ### Current Implementation (Screenshot) _No response_
adam added the enhancementbacklog labels 2026-04-25 00:03:18 +02:00
Author
Owner

@nichwall commented on GitHub (Jul 7, 2024):

Is each chapter its own file, or how is each image stored?

Related to https://github.com/advplyr/audiobookshelf/issues/1573 and https://github.com/advplyr/audiobookshelf/issues/785

@nichwall commented on GitHub (Jul 7, 2024): Is each chapter its own file, or how is each image stored? Related to https://github.com/advplyr/audiobookshelf/issues/1573 and https://github.com/advplyr/audiobookshelf/issues/785
Author
Owner

@motumotumotu commented on GitHub (Jul 7, 2024):

I have tried both to have separate files with separate album cover art, and a merged m4b with separate cover art per chapter. None of the two work with audiobookshelf, and only show the cover art of the first chapter.

To merge into a single .m4b that works as it should on iPod/books app, I have used “Audiobook Builder 2”, and just drop in all the chapters and export to a new m4b, and end up with a book that changes cover with each chapter.

edit: to clarify. I tried putting all the chapters in a folder so it imports as a single book in audiobookshelf and also tried importing the merged m4b from “audiobook builder 2”.

edit 2: The artwork is stored as metadata, inside the mp3/m4b files mentioned.

@motumotumotu commented on GitHub (Jul 7, 2024): I have tried both to have separate files with separate album cover art, and a merged m4b with separate cover art per chapter. None of the two work with audiobookshelf, and only show the cover art of the first chapter. To merge into a single .m4b that works as it should on iPod/books app, I have used “Audiobook Builder 2”, and just drop in all the chapters and export to a new m4b, and end up with a book that changes cover with each chapter. edit: to clarify. I tried putting all the chapters in a folder so it imports as a single book in audiobookshelf and also tried importing the merged m4b from “audiobook builder 2”. edit 2: The artwork is stored as metadata, inside the mp3/m4b files mentioned.
Author
Owner

@obskyr commented on GitHub (Feb 18, 2025):

I’d imagine this feature request (as well as #3129 and #2660) applies to anthology-style audiobook box sets, where each disc has its own cover – see, for example, Big Finish’s series of Doctor Who audiobooks (as in the original issue post), which may have a cover for the whole box set, which should be displayed in your library, but also separate covers for each individual disc/episode in that box set, which should be displayed while listening.

I would suggest supporting two approaches for this for separate files:

  • Load the cover image for the book from the folder (e.g. cover.jpeg), and use the cover images for individual files as chapter covers.
  • Load the cover image for the book from the Front Cover image of the first file, and the chapter cover from the Other image if present (which is a fairly widespread tag to use for this purpose for both podcasts and audio dramas – in fact, I believe it’s the setup used in the OP), or failing that the Media image.

And one, which overrides the above, for chapter cover art embedded into chapter markers, which some formats support – to answer @nichwall’s question, I currently have both of these types in my library (though far more where the chapter images are per-file).

@obskyr commented on GitHub (Feb 18, 2025): I’d imagine this feature request (as well as #3129 and #2660) applies to anthology-style audiobook box sets, where each disc has its own cover – see, for example, Big Finish’s series of Doctor Who audiobooks (as in the original issue post), which may have [a cover for the whole box set,](https://tardis.guide/collectable/doctor-who-ravenous-1/) which should be displayed in your library, but also [separate covers for each individual disc/episode in that box set,](https://tardis.guide/story/their-finest-hour/) which should be displayed while listening. I would suggest supporting two approaches for this for separate files: * Load the cover image for the book from the folder (e.g. `cover.jpeg`), and use the cover images for individual files as chapter covers. * Load the cover image for the book from the `Front Cover` image of the first file, and the chapter cover from the `Other` image if present (which is a fairly widespread tag to use for this purpose for both podcasts and audio dramas – in fact, I believe it’s the setup used in the OP), or failing that the `Media` image. And one, which overrides the above, for [chapter cover art embedded into chapter markers,](https://chaptersapp.com/faq/) which some formats support – to answer @nichwall’s question, I currently have both of these types in my library (though far more where the chapter images are per-file).
Author
Owner

@obskyr commented on GitHub (Feb 19, 2025):

An added niggle: MP4 cover art pictures don’t have a “picture type”. That is to say, unlike ID3’s APIC, which defines a picture as Front Cover or Back Cover or Other or what have you, MP4’s covr is only a list of images, with nothing else defined. Thus, I suggest the following algorithms:

For MP4 (.m4b, .m4a…) files

This approach has the benefit of working with practically any setup: It works if you have a cover.jpeg in the folder, it works if your book cover is cover #1 and your chapter cover is cover #2, it works if your chapter cover is cover #1 and your book cover is cover #2…

For the book cover

  1. Is there a cover image in the folder? Then use that for the book.
  2. Otherwise, do all files have a covr with the same hash? Then use that for the book.
  3. Otherwise, use the first cover of the first audio file as the book cover.

For each chapter

  1. Eliminate any covers that (judging by hash) match the book cover.
  2. If the book consists of multiple files, eliminate any covers that (judging by hash) exist in all the book’s audio files.
  3. If there are any covers left now, use the first one as the chapter cover.
  4. Otherwise, if there were covers left after step 1, use the first one as the chapter cover.
  5. Otherwise, use the book cover as the chapter cover.

(As an addendum, should Audiobookshelf ever support Matroska metadata, the algorithm would be nearly identical.)


For posterity, allow me to describe the algorithm for MP3 and Ogg files as well:

For MP3 and Ogg files

For the book cover

  1. Is there a cover image in the folder? Then use that for the book.
  2. Otherwise, do all files have a Front Cover with the same hash? Then use that for the book.
  3. Otherwise, use the first Front Cover of the first audio file as the book cover.

For each chapter

  1. Eliminate any pictures that don’t have the picture type Front Cover, Other, or Media.
  2. Eliminate any pictures that (judging by hash) match the book cover.
  3. If the book consists of multiple files, eliminate any Front Cover pictures that (judging by hash) exist in all the book’s audio files.
  4. If there are any Front Covers left now, use the first one as the chapter cover.
  5. Otherwise, if there are any Other pictures left now, use the first one as the chapter cover.
  6. Otherwise, if there are any Media pictures left now, use the first one as the chapter cover.
  7. Otherwise, use the book cover as the chapter cover.
@obskyr commented on GitHub (Feb 19, 2025): An added niggle: **MP4 cover art pictures don’t have a “picture type”.** That is to say, unlike ID3’s `APIC`, which defines a picture as `Front Cover` or `Back Cover` or `Other` or what have you, MP4’s `covr` is only a list of images, with nothing else defined. Thus, I suggest the following algorithms: ## For MP4 (`.m4b`, `.m4a`…) files This approach has the benefit of working with practically *any* setup: It works if you have a `cover.jpeg` in the folder, it works if your book cover is cover #1 and your chapter cover is cover #2, it works if your chapter cover is cover #1 and your book cover is cover #2… ### For the book cover 1. Is there a cover image in the folder? Then use that for the book. 2. Otherwise, do all files have a `covr` with the same hash? Then use that for the book. 3. Otherwise, use the first cover of the first audio file as the book cover. ### For each chapter 1. Eliminate any covers that (judging by hash) match the book cover. 2. If the book consists of multiple files, eliminate any covers that (judging by hash) exist in all the book’s audio files. 3. If there are any covers left now, use the first one as the chapter cover. 3. Otherwise, if there were covers left after step 1, use the first one as the chapter cover. 4. Otherwise, use the book cover as the chapter cover. (As an addendum, should Audiobookshelf ever support Matroska metadata, the algorithm would be nearly identical.) --- For posterity, allow me to describe the algorithm for MP3 and Ogg files as well: ## For MP3 and Ogg files ### For the book cover 1. Is there a cover image in the folder? Then use that for the book. 2. Otherwise, do all files have a `Front Cover` with the same hash? Then use that for the book. 3. Otherwise, use the first `Front Cover` of the first audio file as the book cover. ### For each chapter 1. Eliminate any pictures that don’t have the picture type `Front Cover`, `Other`, or `Media`. 2. Eliminate any pictures that (judging by hash) match the book cover. 3. If the book consists of multiple files, eliminate any `Front Cover` pictures that (judging by hash) exist in all the book’s audio files. 4. If there are any `Front Cover`s left now, use the first one as the chapter cover. 5. Otherwise, if there are any `Other` pictures left now, use the first one as the chapter cover. 6. Otherwise, if there are any `Media` pictures left now, use the first one as the chapter cover. 7. Otherwise, use the book cover as the chapter cover.
Author
Owner

@craigS89 commented on GitHub (Mar 19, 2025):

As somone who listens to a lot of big finish boxsets, this would be a great addition.

a possible idea is to link the image file to chapter by name. so if chapter 2 had the name "the second item" the program would pick up any image file named "the second item.jpg" and display it as the artwork.

@craigS89 commented on GitHub (Mar 19, 2025): As somone who listens to a lot of big finish boxsets, this would be a great addition. a possible idea is to link the image file to chapter by name. so if chapter 2 had the name "the second item" the program would pick up any image file named "the second item.jpg" and display it as the artwork.
Author
Owner

@obskyr commented on GitHub (Mar 20, 2025):

I'm quite deeply familiar with audio metadata formats. Would a pull request with this feature be welcome? If I recall correctly, Audiobookshelf uses FFmpeg to get metadata – is this correct? If so, we'd be a wee bit limited in what we can do (as FFmpeg’s support for metadata isn’t the greatest), but it’s still possible to make a reasonably acceptable effort.

@obskyr commented on GitHub (Mar 20, 2025): I'm quite deeply familiar with audio metadata formats. Would a pull request with this feature be welcome? If I recall correctly, Audiobookshelf uses FFmpeg to get metadata – is this correct? If so, we'd be a wee bit limited in what we can do (as FFmpeg’s support for metadata isn’t the greatest), but it’s still possible to make a reasonably acceptable effort.
Author
Owner

@nichwall commented on GitHub (Mar 20, 2025):

There are several sections that would need to be updated, not just changing to extract multiple covers. Off the top of my head there is:

  • data model to store multiple covers (covers can be stored either alongside media or in the /metadata directory)
  • API/players
  • scanner
  • chapter editor
  • metadata editor
@nichwall commented on GitHub (Mar 20, 2025): There are several sections that would need to be updated, not just changing to extract multiple covers. Off the top of my head there is: - data model to store multiple covers (covers can be stored either alongside media or in the `/metadata` directory) - API/players - scanner - chapter editor - metadata editor
Author
Owner

@craigS89 commented on GitHub (Jul 4, 2025):

Whilst implementing this feature with automated image extraction would be nice, would it not be better to start of more simply. especially as @nichwall pointed out this would require a lot of changes across many sections.

You could focus on users manually adding chapter artwork in the chapter editor first, then work out automated extraction later.

@craigS89 commented on GitHub (Jul 4, 2025): Whilst implementing this feature with automated image extraction would be nice, would it not be better to start of more simply. especially as @nichwall pointed out this would require a lot of changes across many sections. You could focus on users manually adding chapter artwork in the chapter editor first, then work out automated extraction later.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2084