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]: webp covers (either in folder structure or embedded in files) make the metadata embedder and the m4b conversion tool fail #3379

Closed
kuldan5853 opened this issue Sep 4, 2024 · 5 comments · Fixed by #3394
Labels
bug Something isn't working

Comments

@kuldan5853
Copy link

What happened?

When you use a .webp image as a cover, it will show correctly on the ABS GUI - however, the metadata manager cannot embed or modify it in files (which also means that m4b conversions fail due to the embed being a step in the process)

What did you expect to happen?

.webp working the same as .png or .jpg files - or at least failing gracefully with a clear error message (auto conversion would be perfect of course)

Steps to reproduce the issue

  1. Try to convert a book to m4b that uses an .webp file as the cover
  2. You can also try to simply embed the metadata to the file instead

Audiobookshelf version

v2.12.3

How are you running audiobookshelf?

Windows Tray App

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

Input #2, webp_pipe, from 'C:/Audiobookshelf/Data/metadata/items/f9dc2bd8-7993-4559-a60a-144588da9dee/cover.webp':
  Duration: N/A, bitrate: N/A
  Stream #2:0: Video: webp, yuva420p(tv, bt470bg/unknown/unknown), 1000x992, 25 fps, 25 tbr, 25 tbn
[mp4 @ 000001ea22069dc0] Could not find tag for codec webp in stream #1, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:1 -- 
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #2:0 -> #0:1 (copy)
    Last message repeated 1 times
 (    at FfmpegCommand.<anonymous> (C:\snapshot\audiobookshelf\server\utils\ffmpegHelpers.js))
[2024-09-04 14:03:44.934] ERROR: [AbMergeManager] Failed to write metadata to file "C:\Audiobookshelf\Data\metadata\cache\items\f9dc2bd8-7993-4559-a60a-144588da9dee\087 - Der boese Geist vom Waisenhaus.m4b" (    at AbMergeManager.runAudiobookMerge (C:\snapshot\audiobookshelf\server\managers\AbMergeManager.js))
[2024-09-04 14:03:44.934] WARN: [AbMergeManager] Killing ffmpeg process for task f75b80e9-3a95-42e0-9f9c-0babfd59400a (    at AbMergeManager.removeTask (C:\snapshot\audiobookshelf\server\managers\AbMergeManager.js))
[2024-09-04 14:03:45.462] INFO: [AbMergeManager] Deleted target file C:\Audiobookshelf\Data\metadata\cache\items\f9dc2bd8-7993-4559-a60a-144588da9dee\087 - Der boese Geist vom Waisenhaus.m4b
[2024-09-04 14:03:45.469] INFO: [AbMergeManager] Deleted ffmetadata file C:\Audiobookshelf\Data\metadata\cache\items\f9dc2bd8-7993-4559-a60a-144588da9dee\ffmetadata.txt

Additional Notes

No response

@kuldan5853 kuldan5853 added the bug Something isn't working label Sep 4, 2024
@kuldan5853
Copy link
Author

My suggestion would be to detect the usage of .webp covers and simply skipping the embed step for them as a quick bypass solution.

Longer term, maybe change the ABS interface so that .webp covers are not accepted to be set in the first place (and a notice is given to the user that they should please use a png or jpg file instead)

@mikiher
Copy link
Contributor

mikiher commented Sep 4, 2024

I'll take a look. I'm pretty sure it's easily fixable.

@mikiher
Copy link
Contributor

mikiher commented Sep 9, 2024

I didn't dig too deeply into this, but it looks like webp isn't supported in a mp4 container.

What I can do is to convert the input webp into jpeg or png on-the-fly and embed that into the file. Is that an acceptable solution?

@kuldan5853
Copy link
Author

What I can do is to convert the input webp into jpeg or png on-the-fly and embed that into the file. Is that an acceptable solution?

If that's possible I think that would be the best possible solution as it achieves the desired result (an embedded cover) and does what the user expects (embedding a cover that worked in ABS without a warning message)

@advplyr advplyr added the awaiting release Issue is resolved and will be in the next release label Sep 9, 2024
Copy link

github-actions bot commented Sep 9, 2024

Fixed in v2.13.4.

@github-actions github-actions bot removed the awaiting release Issue is resolved and will be in the next release label Sep 9, 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

Successfully merging a pull request may close this issue.

3 participants