MKV thumbnail not correctly embedded #8476

Open
opened 2026-02-21 04:23:29 -05:00 by deekerman · 8 comments
Owner

Originally created by @ghost on GitHub (Aug 16, 2016).

  • I've verified and I assure that I'm running youtube-dl 2016.08.13
  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

When using --embed-thumbnail, it seems that the thumbnail isn't added as an image resource (cover.jpg) to the mkv video file but instead added as a second video stream. Seemingly using the same code as is used for embedding cover art for a mp3. This results in the embedded thumbnail not being displayed and instead no thumbnail or a automatically generated one being shown.

Tested with this video:
https://www.youtube.com/watch?v=k_okcNVZqqI
youtube-dl https://www.youtube.com/watch?v=k_okcNVZqqI --embed-thumbnail
Using youtube-dl 2016.08.13 and ffmpeg-20160815-3282e31-win64-static

MediaInfo, thumbnail embedded with --embed-thumbnail:
INK DROPS 4K (ULTRA HD)-k_okcNVZqqI.mkv.MediaInfo.txt

MediaInfo, thumbnail embedded with mkvpropedit:
INK DROPS 4K (ULTRA HD)-k_okcNVZqqI-proper.mkv.MediaInfo.txt

Related to this the request for thumbnail embedding support for webm files when this is fixed. (#10360)

Originally created by @ghost on GitHub (Aug 16, 2016). - [x] I've **verified** and **I assure** that I'm running youtube-dl **2016.08.13** - [x] At least skimmed through [README](https://github.com/rg3/youtube-dl/blob/master/README.md) and **most notably** [FAQ](https://github.com/rg3/youtube-dl#faq) and [BUGS](https://github.com/rg3/youtube-dl#bugs) sections - [x] [Searched](https://github.com/rg3/youtube-dl/search?type=Issues) the bugtracker for similar issues including closed ones ### What is the purpose of your _issue_? - [x] Bug report (encountered problems with youtube-dl) - [ ] Site support request (request for adding support for a new site) - [ ] Feature request (request for a new functionality) - [ ] Question - [ ] Other --- When using --embed-thumbnail, it seems that the thumbnail isn't added as an image resource (cover.jpg) to the mkv video file but instead added as a second video stream. Seemingly using the same code as is used for embedding cover art for a mp3. This results in the embedded thumbnail not being displayed and instead no thumbnail or a automatically generated one being shown. Tested with this video: https://www.youtube.com/watch?v=k_okcNVZqqI youtube-dl https://www.youtube.com/watch?v=k_okcNVZqqI --embed-thumbnail Using youtube-dl 2016.08.13 and ffmpeg-20160815-3282e31-win64-static MediaInfo, thumbnail embedded with --embed-thumbnail: [INK DROPS 4K (ULTRA HD)-k_okcNVZqqI.mkv.MediaInfo.txt](https://github.com/rg3/youtube-dl/files/420888/INK.DROPS.4K.ULTRA.HD.-k_okcNVZqqI.mkv.MediaInfo.txt) MediaInfo, thumbnail embedded with mkvpropedit: [INK DROPS 4K (ULTRA HD)-k_okcNVZqqI-proper.mkv.MediaInfo.txt](https://github.com/rg3/youtube-dl/files/420889/INK.DROPS.4K.ULTRA.HD.-k_okcNVZqqI-proper.mkv.MediaInfo.txt) Related to this the request for thumbnail embedding support for webm files when this is fixed. (#10360)
Author
Owner

@yan12125 commented on GitHub (Aug 23, 2016):

This results in the embedded thumbnail not being displayed

Sorry for being late. Which player are you using?

@yan12125 commented on GitHub (Aug 23, 2016): > This results in the embedded thumbnail not being displayed Sorry for being late. Which player are you using?
Author
Owner

@ghost commented on GitHub (Aug 25, 2016):

I mainly use a software called Icaros which enables MKV files showing thumbnails in windows explorer using the thumbnail inside the file or, if there is no thumbnail inside it, using a generated one.

But I see the same thing with Windows Media Player and VLC media player.
The correct thumbnail from youtube is only correctly displayed for the file where I used --write-thumbnail to download the thumbnail and mkvpropedit to embed the thumbnail.
For the file where I used the --embed-thumbnail option to download and embed it directly, either no thumbnail is being displayed or one is generated from the video.

Screenshot

@ghost commented on GitHub (Aug 25, 2016): I mainly use a software called Icaros which enables MKV files showing thumbnails in windows explorer using the thumbnail inside the file or, if there is no thumbnail inside it, using a generated one. But I see the same thing with Windows Media Player and VLC media player. The correct thumbnail from youtube is only correctly displayed for the file where I used --write-thumbnail to download the thumbnail and mkvpropedit to embed the thumbnail. For the file where I used the --embed-thumbnail option to download and embed it directly, either no thumbnail is being displayed or one is generated from the video. ![Screenshot](https://cloud.githubusercontent.com/assets/21064133/17974159/3cfaafcc-6ae5-11e6-92ab-8f1a4b399a90.png)
Author
Owner

@u1735067 commented on GitHub (Nov 4, 2017):

Hi, you might be interested in merging https://github.com/Alex131089/youtube-dl/compare/Alex131089-mkv-thumbnail or https://github.com/Alex131089/youtube-dl/compare/Alex131089-mkv-thumbnail-filename, I was able to embed thumbnail without issue in VLC or MPC-HC with this.
The second branch tries to respect the filename convention (there's no orientation check nor dimensions enforcement/conversion), but using another/video's filename works too, at least in VLC.
I guess this would fix #6046 ?
Thanks for this utility :)

@u1735067 commented on GitHub (Nov 4, 2017): Hi, you might be interested in merging https://github.com/Alex131089/youtube-dl/compare/Alex131089-mkv-thumbnail or https://github.com/Alex131089/youtube-dl/compare/Alex131089-mkv-thumbnail-filename, I was able to embed thumbnail without issue in VLC or MPC-HC with this. The second branch tries to respect the [filename convention](https://matroska.org/technical/cover_art/index.html) (there's no orientation check nor dimensions enforcement/conversion), but using another/video's filename works too, at least in VLC. I guess this would fix #6046 ? Thanks for this utility :)
Author
Owner

@yan12125 commented on GitHub (Nov 4, 2017):

Awesome! Does it support non-ASCII thumbnail filenames? And I wonder how accurate guess_type is.

@yan12125 commented on GitHub (Nov 4, 2017): Awesome! Does it support non-ASCII thumbnail filenames? And I wonder how accurate ```guess_type``` is.
Author
Owner

@u1735067 commented on GitHub (Nov 4, 2017):

Awesome! Does it support non-ASCII thumbnail filenames?

No idea, but as much as for the MP3 I guess.

And I wonder how accurate guess_type is.

Mimetypes module seems to rely on the extension, so it's very "light".

And with only 2 extensions recognized by the convention, I came with this much simpler version : https://github.com/Alex131089/youtube-dl/tree/Alex131089-mkv-thumbnail-simpler.
For other filetypes, you'd still need mimetype detection.

@u1735067 commented on GitHub (Nov 4, 2017): > Awesome! Does it support non-ASCII thumbnail filenames? No idea, but as much as for the MP3 I guess. >And I wonder how accurate guess_type is. [Mimetypes module](https://docs.python.org/3/library/mimetypes.html) seems to rely on the extension, so it's very "light". And with only 2 extensions recognized by the convention, I came with this much simpler version : https://github.com/Alex131089/youtube-dl/tree/Alex131089-mkv-thumbnail-simpler. For other filetypes, you'd still need mimetype detection.
Author
Owner

@grenzor commented on GitHub (Dec 16, 2017):

This looks good, any reason it isn't merged yet?

@grenzor commented on GitHub (Dec 16, 2017): This looks good, any reason it isn't merged yet?
Author
Owner

@srussel commented on GitHub (Jul 20, 2018):

Any progress on this? I am also experiencing this bug.

@srussel commented on GitHub (Jul 20, 2018): Any progress on this? I am also experiencing this bug.
Author
Owner

@Dialga commented on GitHub (Nov 3, 2018):

Any chance of merging this soon?

@Dialga commented on GitHub (Nov 3, 2018): Any chance of merging this soon?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl-ytdl-org#8476
No description provided.