Tagging mkv files with cover images?

送分小仙女□ 提交于 2019-12-06 19:06:39

问题


I found this screenshot which shows that you can add a cover image to an mkv file in a way that it is displayed as the icon of the file in the Windows explorer using Shark007+icaros.
But these tools are messing with the system in a really bad way. A lot of people are having problems with it and I too very much regret that I've installed it. I'm really glad I got my Windows to boot again...

Anyway, how could I programmatically add a cover image to an mkv file?
And would I need to change something in the registry to make Windows display them?

I'm not neccessarely looking for code, I'm more looking for something like the format the cover needs to have and the byte at which I have to inject/insert/attach the image file and maybe a registry entry that would cause the tagged images to be displayed etc.


回答1:


You can use the FFmpeg multimedia framework to attach an image as MKV metadata. More Windows builds can be found at Zeranoe.

Example CLI usage:

ffmpeg -i input.mkv -c copy -attach image.jpg -metadata:s:t \
mimetype=image/jpeg output.mkv
  • -c copy copy all streams in the source file without re-encoding
  • -attach image.jpg attach a JPEG image
  • -metadata:s:t mimetype=image/jpeg set the attachement MIME type

On *nix the same can be accomplished with MKVToolNix.

Ubuntu demo:


Programmatic approach:

  • use the ffmpeg C libraries to attach or replace the cover art
  • write a custom Shell Extension to read the MKV format and display the image attachement as thumbnail.


来源:https://stackoverflow.com/questions/34137442/tagging-mkv-files-with-cover-images

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!