mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-17 16:43:12 +00:00
[MKV Thumbnail Support] MKV Thumbnails with FFMpeg
This commit is contained in:
parent
560d3b7d7c
commit
4c8cabe8ae
1 changed files with 13 additions and 0 deletions
|
@ -50,6 +50,19 @@ class EmbedThumbnailPP(FFmpegPostProcessor):
|
||||||
|
|
||||||
self.run_ffmpeg_multiple_files([filename, thumbnail_filename], temp_filename, options)
|
self.run_ffmpeg_multiple_files([filename, thumbnail_filename], temp_filename, options)
|
||||||
|
|
||||||
|
if not self._already_have_thumbnail:
|
||||||
|
os.remove(encodeFilename(thumbnail_filename))
|
||||||
|
os.remove(encodeFilename(filename))
|
||||||
|
os.rename(encodeFilename(temp_filename), encodeFilename(filename))
|
||||||
|
|
||||||
|
if info['ext'] == 'mkv':
|
||||||
|
options = [
|
||||||
|
'-c', 'copy', '-attach', thumbnail_filename, '-metadata:s:t', 'mimetype=image/jpeg']
|
||||||
|
|
||||||
|
self._downloader.to_screen('[ffmpeg] Adding thumbnail to "%s"' % filename)
|
||||||
|
|
||||||
|
self.run_ffmpeg_multiple_files([filename], temp_filename, options)
|
||||||
|
|
||||||
if not self._already_have_thumbnail:
|
if not self._already_have_thumbnail:
|
||||||
os.remove(encodeFilename(thumbnail_filename))
|
os.remove(encodeFilename(thumbnail_filename))
|
||||||
os.remove(encodeFilename(filename))
|
os.remove(encodeFilename(filename))
|
||||||
|
|
Loading…
Reference in a new issue