faissaloo / SponSkrub

Strip advertisements from downloaded YouTube videos
GNU General Public License v3.0
177 stars 7 forks source link

SponsKrub removes thumbnail embedded in MKV video #29

Open nicolaasjan opened 3 years ago

nicolaasjan commented 3 years ago

@pukkandan advised me to open an issue here concerning removed thumbnail embedded in MKV video.

Long story short, see https://github.com/yt-dlp/yt-dlp/issues/204.

Is there a way to solve this issue?

pukkandan commented 3 years ago

To summarize the issue: When yt-dlp embeds thumbnail in mkv, it registered it as an attachment with filename=cover.jpg. This allows most file managers to correctly "see" the thumbnail. However, when the video is passed through sponskrub, this attachment information is lost even though the embedded thumbnail is still present inside the video file.

A workaround to this issue from my side would be to embed thumbnail AFTER sponskrub has done its job. But it is probably best if a solution can be implemented in sponskrub itself

nicolaasjan commented 3 years ago

I can confirm that this issue is now resolved with f4e4be1 :)

screenshot1

pukkandan commented 3 years ago

the issue isnt "resolved". I worked around it by doing this

A workaround to this issue from my side would be to embed thumbnail AFTER sponskrub has done its job.

imo, this issue should still be kept open since it affects users who use sponskrub separately from yt-dlp too

nicolaasjan commented 3 years ago

I'm so sorry for the confusion... Please forgive me.

faissaloo commented 3 years ago

So I've spent some time going through a bunch of the ffmpeg documentation and stuff, it looks like there's not really a standard way to deal with existing thumbnails, however adding a thumbnail as thing independent of the original seems fairly straightforward as does extracting an image from a video. Would generating a new thumbnail for the video (which might be different) be an acceptable solution? It might also make more sense given the fact that what's in the thumbnail might end up getting cut out

mirror176 commented 3 years ago

Maybe as a workaround or alternative, but being able to maintain the thumbnail should be preferred as the fix since the original may be artwork from outside the video.