feat(output): add thumbnail format setting so embedded cover art is readable - #832
Open
Phr33d0m wants to merge 6 commits into
Open
feat(output): add thumbnail format setting so embedded cover art is readable#832Phr33d0m wants to merge 6 commits into
Phr33d0m wants to merge 6 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
I download YouTube videos as MKV with "Add cover image" enabled, but Dolphin (KDE Plasma) never showed the YouTube thumbnail as the file preview, just a random frame from the video.
The cover is embedded fine. It is embedded as
cover.webp, and FFmpeg only treats an attachment as cover art when its mime type is jpeg/png/gif/tiff. I embedded the same image as webp, jpeg and png into otherwise identical files: only jpeg and png produced a thumbnail.Nothing in the app could change this, since we let yt-dlp attach whatever the site served.
What this adds
A Thumbnail format setting (JPEG / PNG / Keep original) that passes
--convert-thumbnailsto yt-dlp.It also changes the extension of files saved by "Save thumbnail file", because yt-dlp converts every thumbnail on disk, not just the embedded one. The hint text mentions this.
MP4 benefits too. yt-dlp converts webp to PNG there, which is much larger than JPEG and unreliable in Windows Explorer.
Default
Defaults to JPEG, so MKV covers start working and saved thumbnails become
.jpginstead of.webp."Add cover image" is already on by default and currently produces a cover most software cannot read, so I treated this as a fix rather than a new preference. It is still a behaviour change though, so if you would rather default to "Keep original", say so and I will flip it.
Testing
cargo test128 passed,npm run test:unit131 passed, build/clippy/eslint clean.Real download vs a control on current behaviour:
Adds 7 backend and 4 frontend tests, updates 7 existing argument tests for the new default. English locale only, per CONTRIBUTING.
Screenshots
Disclosure
This PR and code have been AI generated.