Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Covers not loading for m4b audiobooks #3697

Open
sandreas opened this issue Dec 8, 2024 · 0 comments
Open

[Bug]: Covers not loading for m4b audiobooks #3697

sandreas opened this issue Dec 8, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@sandreas
Copy link
Contributor

sandreas commented Dec 8, 2024

What happened?

I have a library of many m4b's and after upgrading audiobookshelf to a newer version, the covers of newly added m4b files don't show up, although I ensured that the files contain a valid cover.

What did you expect to happen?

I would have expected the covers to show up as normal.

Steps to reproduce the issue

Add the attached file to your audio book folder and wait for it to be scanned.
input.zip

This problem might be related to #1063 and #2885 - but is very specific to m4b files with embedded cover. I found out that the problem is possibly a wrong ffmpeg extraction command in:

/** @type {import('../libs/fluentFfmpeg/index').FfmpegCommand} */

    var ffmpeg = Ffmpeg(filepath)
    ffmpeg.addOption(['-map 0:v:0', '-frames:v 1'])
    ffmpeg.output(outputpath)

which results in

ffmpeg -i input.m4b -map 0:v:0 -frames:v 1 cover.jpg

This command extracts a FULLY BLACK cover for m4b files.

Possible solution
The corrected command that works and extracts the cover as expected would be:

ffmpeg -i input.m4b -map 0:v -map -0:V -c copy -frames:v 1 cover.jpg

or in code

    var ffmpeg = Ffmpeg(filepath)
    ffmpeg.addOption(['-map 0:v', '-map 0:V', '-c copy', '-frames:v 1'])
    ffmpeg.output(outputpath)

but I'm not sure, that this is the place the problem occurs.

Audiobookshelf version

2.17.4

How are you running audiobookshelf?

Docker

What OS is your Audiobookshelf server hosted from?

Linux

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

Chrome

Logs

No errors in log files

Additional Notes

Suggested solution should fix the problem.

@sandreas sandreas added the bug Something isn't working label Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant