--embed-thumbnail conversion failed, ffmpeg and .webp images. #20814

Closed
opened 2026-02-21 11:23:17 -05:00 by deekerman · 12 comments
Owner

Originally created by @thunduaga on GitHub (Jun 15, 2020).

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2020.06.16.1
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

youtube-dl -x -i --add-metadata --embed-thumbnail --audio-format mp3 -v -o '20200615_001/%(title)s.(ext)s' "https://www.youtube.com/watch?v=_mCc3ROOspg"
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-x', u'-i', u'--add-metadata', u'--embed-thumbnail', u'--audio-format', u'mp3', u'-v', u'-o', u'20200615_001/%(title)s.(ext)s', u'https://www.youtube.com/watch?v=_mCc3ROOspg']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.06.16.1
[debug] Python version 2.7.16 (CPython) - CYGWIN_NT-6.1-7601-WOW64-3.1.4-340.i686-i686-32bit
[debug] exe versions: ffmpeg git-2020-06-15-9d80f3e, ffprobe git-2020-06-15-9d80f3e
[debug] Proxy map: {}
[youtube] _mCc3ROOspg: Downloading webpage
[youtube] _mCc3ROOspg: Downloading thumbnail ...
[youtube] _mCc3ROOspg: Writing thumbnail to: 20200615_001/SIERRA - UNBROKEN.webp
[debug] Invoking downloader on u'https://r3---sn-ni5f-t8gz.googlevideo.com/videoplayback?expire=1592285498&ei=2gToXvXeC9eSkwbm2ZTwCw&ip=70.69.34.113&id=o-AOVncKkHIH0gplcdeRiavD58Jqim4lxLPWxDaEcYzPUY&itag=251&source=youtube&requiressl=yes&mh=Nf&mm=31%2C26&mn=sn-ni5f-t8gz%2Csn-vgqsrn76&ms=au%2Conr&mv=m&mvi=2&pl=22&initcwndbps=1817500&vprv=1&mime=audio%2Fwebm&gir=yes&clen=3328603&dur=194.941&lmt=1561544859300681&mt=1592263777&fvip=3&keepalive=yes&fexp=23882513&c=WEB&txp=5431432&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIgSPt868wMa_RWdeyP2Pl-ViiOEvdpKOByjttG3FBfOB0CIQCy4-M1CjhBtSOLKnx_7btUlfwcU_FF6V-_xzIx9PTTqQ%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhALYCFaL3SY3MYgKYe81vs8tf_pKvHkrEsV9IK1tYh5BdAiEArAnYxtdkKG2jV6Ic2PFX2GPRHgkbIhdSihU0FBVPRVY%3D&ratebypass=yes'
[download] Destination: 20200615_001/SIERRA - UNBROKEN.(ext)s
[download] 100% of 3.17MiB in 00:00
[debug] ffmpeg command line: ffprobe -show_streams 'file:20200615_001/SIERRA - UNBROKEN.(ext)s'
[ffmpeg] Destination: 20200615_001/SIERRA - UNBROKEN.mp3
[debug] ffmpeg command line: ffmpeg -y -loglevel 'repeat+info' -i 'file:20200615_001/SIERRA - UNBROKEN.(ext)s' -vn -acodec libmp3lame '-q:a' 5 'file:20200615_001/SIERRA - UNBROKEN.mp3'
Deleting original file 20200615_001/SIERRA - UNBROKEN.(ext)s (pass -k to keep)
[ffmpeg] Adding metadata to '20200615_001/SIERRA - UNBROKEN.mp3'
[debug] ffmpeg command line: ffmpeg -y -loglevel 'repeat+info' -i 'file:20200615_001/SIERRA - UNBROKEN.mp3' -c copy -metadata 'comment=► Subscribe to Electronic Body Synth Music : https://goo.gl/qjhdSk
► Subscribe to The 80'"'"'s Guy B-Sides : https://bit.ly/2S5Azwl
► Subscribe to The 80'"'"'s Guy : https://goo.gl/PkmN4M


▼ Support:
https://lazerdiscs.bandcamp.com/album/gone


▬
Note for the new Artists:

►► Want to submit your track, visual art for promotion ?
►► Missing any kind of information which belongs to the video (audio or visual) ?
►► Having any issues regarding any of the videos ?

Please look for my email address in my channel'"'"'s about page.

▬
Submission Requirements:

►► Must be Darksynth, EBSM, Dark Electro, Dark Clubbing
►► Please specify the genre on submission
►► Please provide all your social media links for description.

▬
Copyright Info ©

♫ Be aware all music belong to the original artists.
♫ I am not in position to give anyone permission to use this.

#ebm #ebsm #darkclubbing' -metadata 'description=► Subscribe to Electronic Body Synth Music : https://goo.gl/qjhdSk
► Subscribe to The 80'"'"'s Guy B-Sides : https://bit.ly/2S5Azwl
► Subscribe to The 80'"'"'s Guy : https://goo.gl/PkmN4M


▼ Support:
https://lazerdiscs.bandcamp.com/album/gone


▬
Note for the new Artists:

►► Want to submit your track, visual art for promotion ?
►► Missing any kind of information which belongs to the video (audio or visual) ?
►► Having any issues regarding any of the videos ?

Please look for my email address in my channel'"'"'s about page.

▬
Submission Requirements:

►► Must be Darksynth, EBSM, Dark Electro, Dark Clubbing
►► Please specify the genre on submission
►► Please provide all your social media links for description.

▬
Copyright Info ©

♫ Be aware all music belong to the original artists.
♫ I am not in position to give anyone permission to use this.

#ebm #ebsm #darkclubbing' -metadata 'artist=EBSM Electro Body Synth Music' -metadata 'title=SIERRA - UNBROKEN' -metadata 'date=20190605' -metadata 'purl=https://www.youtube.com/watch?v=_mCc3ROOspg' 'file:20200615_001/SIERRA - UNBROKEN.temp.mp3'
[ffmpeg] Adding thumbnail to "20200615_001/SIERRA - UNBROKEN.mp3"
[debug] ffmpeg command line: ffmpeg -y -loglevel 'repeat+info' -i 'file:20200615_001/SIERRA - UNBROKEN.mp3' -i 'file:20200615_001/SIERRA - UNBROKEN.webp' -c copy -map 0 -map 1 '-metadata:s:v' 'title="Album cover"' '-metadata:s:v' 'comment="Cover (Front)"' 'file:20200615_001/SIERRA - UNBROKEN.temp.mp3'
ERROR: Conversion failed!
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2065, in post_process
    files_to_delete, info = pp.run(info)
  File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/embedthumbnail.py", line 51, in run
    self.run_ffmpeg_multiple_files([filename, thumbnail_filename], temp_filename, options)
  File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 235, in run_ffmpeg_multiple_files
    raise FFmpegPostProcessorError(msg)
FFmpegPostProcessorError: Conversion failed!

Description

From what I can tell, when attempting to embed the video thumbnail (into an MP3 file in my case) ffmpeg dies when decoding the .webp file. I tried running the ffmpeg command manually and below is a small snippet of the output:

    TPE1            : EBSM Electro Body Synth Music
    TIT2            : SIERRA - UNBROKEN
    TDRC            : 20190605
    TSSE            : Lavf58.46.101
    Stream #0:0: Audio: mp3, 48000 Hz, stereo, fltp, 136 kb/s
    Metadata:
      encoder         : Lavc58.92
    Stream #0:1: Video: webp, yuv420p(tv, bt470bg/unknown/unknown), 1280x720, q=2-31, 25 tbr, 25 tbn, 25 tbc
    Metadata:
      title           : "Album cover"
      comment         : "Cover (Front)"
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mp3 @ 0000000002630600] No mimetype is known for stream 1, cannot write an attached picture.
av_interleaved_write_frame(): Invalid argument
[mp3 @ 0000000002630600] No packets were sent for some of the attached pictures.
frame=    1 fps=0.0 q=-1.0 Lsize=       3kB time=00:00:00.04 bitrate= 605.0kbits/s speed=N/A
video:34kB audio:1kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Conversion failed!

However, when I simply run a conversion from .webp to .jpg

ffmpeg -i "SIERRA - UNBROKEN.webp" "SIERRA - UNBROKEN.jpg"

then repeat the ffmpeg command spat out by youtube-dl when embedding the thumbnail replacing the .webp with the .jpg file it works just fine.

Is there any way to have youtube-dl specify the file type it downloads the video thumbnails as? I believe the --embed-thumbnail flag would work if the thumbnail was originally downloaded as something other than a .webp file.

Thank you for your time,

Originally created by @thunduaga on GitHub (Jun 15, 2020). <!-- ###################################################################### WARNING! IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE ###################################################################### --> ## Checklist <!-- Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl: - First of, make sure you are using the latest version of youtube-dl. Run `youtube-dl --version` and ensure your version is 2020.06.16.1. If it's not, see https://yt-dl.org/update on how to update. Issues with outdated version will be REJECTED. - Make sure that all provided video/audio/playlist URLs (if any) are alive and playable in a browser. - Make sure that all URLs and arguments with special characters are properly quoted or escaped as explained in http://yt-dl.org/escape. - Search the bugtracker for similar issues: http://yt-dl.org/search-issues. DO NOT post duplicates. - Read bugs section in FAQ: http://yt-dl.org/reporting - Finally, put x into all relevant boxes (like this [x]) --> - [ ] I'm reporting a broken site support issue - [X] I've verified that I'm running youtube-dl version **2020.06.16.1** - [X] I've checked that all provided URLs are alive and playable in a browser - [X] I've checked that all URLs and arguments with special characters are properly quoted or escaped - [X] I've searched the bugtracker for similar bug reports including closed ones - [X] I've read bugs section in FAQ ## Verbose log <!-- Provide the complete verbose output of youtube-dl that clearly demonstrates the problem. Add the `-v` flag to your command line you run youtube-dl with (`youtube-dl -v <your command line>`), copy the WHOLE output and insert it below. It should look similar to this: [debug] System config: [] [debug] User config: [] [debug] Command-line args: [u'-v', u'http://www.youtube.com/watch?v=BaW_jenozKcj'] [debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251 [debug] youtube-dl version 2020.06.16.1 [debug] Python version 2.7.11 - Windows-2003Server-5.2.3790-SP2 [debug] exe versions: ffmpeg N-75573-g1d0487f, ffprobe N-75573-g1d0487f, rtmpdump 2.4 [debug] Proxy map: {} <more lines> --> ``` youtube-dl -x -i --add-metadata --embed-thumbnail --audio-format mp3 -v -o '20200615_001/%(title)s.(ext)s' "https://www.youtube.com/watch?v=_mCc3ROOspg" [debug] System config: [] [debug] User config: [] [debug] Custom config: [] [debug] Command-line args: [u'-x', u'-i', u'--add-metadata', u'--embed-thumbnail', u'--audio-format', u'mp3', u'-v', u'-o', u'20200615_001/%(title)s.(ext)s', u'https://www.youtube.com/watch?v=_mCc3ROOspg'] [debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8 [debug] youtube-dl version 2020.06.16.1 [debug] Python version 2.7.16 (CPython) - CYGWIN_NT-6.1-7601-WOW64-3.1.4-340.i686-i686-32bit [debug] exe versions: ffmpeg git-2020-06-15-9d80f3e, ffprobe git-2020-06-15-9d80f3e [debug] Proxy map: {} [youtube] _mCc3ROOspg: Downloading webpage [youtube] _mCc3ROOspg: Downloading thumbnail ... [youtube] _mCc3ROOspg: Writing thumbnail to: 20200615_001/SIERRA - UNBROKEN.webp [debug] Invoking downloader on u'https://r3---sn-ni5f-t8gz.googlevideo.com/videoplayback?expire=1592285498&ei=2gToXvXeC9eSkwbm2ZTwCw&ip=70.69.34.113&id=o-AOVncKkHIH0gplcdeRiavD58Jqim4lxLPWxDaEcYzPUY&itag=251&source=youtube&requiressl=yes&mh=Nf&mm=31%2C26&mn=sn-ni5f-t8gz%2Csn-vgqsrn76&ms=au%2Conr&mv=m&mvi=2&pl=22&initcwndbps=1817500&vprv=1&mime=audio%2Fwebm&gir=yes&clen=3328603&dur=194.941&lmt=1561544859300681&mt=1592263777&fvip=3&keepalive=yes&fexp=23882513&c=WEB&txp=5431432&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIgSPt868wMa_RWdeyP2Pl-ViiOEvdpKOByjttG3FBfOB0CIQCy4-M1CjhBtSOLKnx_7btUlfwcU_FF6V-_xzIx9PTTqQ%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhALYCFaL3SY3MYgKYe81vs8tf_pKvHkrEsV9IK1tYh5BdAiEArAnYxtdkKG2jV6Ic2PFX2GPRHgkbIhdSihU0FBVPRVY%3D&ratebypass=yes' [download] Destination: 20200615_001/SIERRA - UNBROKEN.(ext)s [download] 100% of 3.17MiB in 00:00 [debug] ffmpeg command line: ffprobe -show_streams 'file:20200615_001/SIERRA - UNBROKEN.(ext)s' [ffmpeg] Destination: 20200615_001/SIERRA - UNBROKEN.mp3 [debug] ffmpeg command line: ffmpeg -y -loglevel 'repeat+info' -i 'file:20200615_001/SIERRA - UNBROKEN.(ext)s' -vn -acodec libmp3lame '-q:a' 5 'file:20200615_001/SIERRA - UNBROKEN.mp3' Deleting original file 20200615_001/SIERRA - UNBROKEN.(ext)s (pass -k to keep) [ffmpeg] Adding metadata to '20200615_001/SIERRA - UNBROKEN.mp3' [debug] ffmpeg command line: ffmpeg -y -loglevel 'repeat+info' -i 'file:20200615_001/SIERRA - UNBROKEN.mp3' -c copy -metadata 'comment=► Subscribe to Electronic Body Synth Music : https://goo.gl/qjhdSk ► Subscribe to The 80'"'"'s Guy B-Sides : https://bit.ly/2S5Azwl ► Subscribe to The 80'"'"'s Guy : https://goo.gl/PkmN4M ▼ Support: https://lazerdiscs.bandcamp.com/album/gone ▬ Note for the new Artists: ►► Want to submit your track, visual art for promotion ? ►► Missing any kind of information which belongs to the video (audio or visual) ? ►► Having any issues regarding any of the videos ? Please look for my email address in my channel'"'"'s about page. ▬ Submission Requirements: ►► Must be Darksynth, EBSM, Dark Electro, Dark Clubbing ►► Please specify the genre on submission ►► Please provide all your social media links for description. ▬ Copyright Info © ♫ Be aware all music belong to the original artists. ♫ I am not in position to give anyone permission to use this. #ebm #ebsm #darkclubbing' -metadata 'description=► Subscribe to Electronic Body Synth Music : https://goo.gl/qjhdSk ► Subscribe to The 80'"'"'s Guy B-Sides : https://bit.ly/2S5Azwl ► Subscribe to The 80'"'"'s Guy : https://goo.gl/PkmN4M ▼ Support: https://lazerdiscs.bandcamp.com/album/gone ▬ Note for the new Artists: ►► Want to submit your track, visual art for promotion ? ►► Missing any kind of information which belongs to the video (audio or visual) ? ►► Having any issues regarding any of the videos ? Please look for my email address in my channel'"'"'s about page. ▬ Submission Requirements: ►► Must be Darksynth, EBSM, Dark Electro, Dark Clubbing ►► Please specify the genre on submission ►► Please provide all your social media links for description. ▬ Copyright Info © ♫ Be aware all music belong to the original artists. ♫ I am not in position to give anyone permission to use this. #ebm #ebsm #darkclubbing' -metadata 'artist=EBSM Electro Body Synth Music' -metadata 'title=SIERRA - UNBROKEN' -metadata 'date=20190605' -metadata 'purl=https://www.youtube.com/watch?v=_mCc3ROOspg' 'file:20200615_001/SIERRA - UNBROKEN.temp.mp3' [ffmpeg] Adding thumbnail to "20200615_001/SIERRA - UNBROKEN.mp3" [debug] ffmpeg command line: ffmpeg -y -loglevel 'repeat+info' -i 'file:20200615_001/SIERRA - UNBROKEN.mp3' -i 'file:20200615_001/SIERRA - UNBROKEN.webp' -c copy -map 0 -map 1 '-metadata:s:v' 'title="Album cover"' '-metadata:s:v' 'comment="Cover (Front)"' 'file:20200615_001/SIERRA - UNBROKEN.temp.mp3' ERROR: Conversion failed! Traceback (most recent call last): File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2065, in post_process files_to_delete, info = pp.run(info) File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/embedthumbnail.py", line 51, in run self.run_ffmpeg_multiple_files([filename, thumbnail_filename], temp_filename, options) File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 235, in run_ffmpeg_multiple_files raise FFmpegPostProcessorError(msg) FFmpegPostProcessorError: Conversion failed! ``` ## Description <!-- Provide an explanation of your issue in an arbitrary form. Please make sure the description is worded well enough to be understood, see https://github.com/ytdl-org/youtube-dl#is-the-description-of-the-issue-itself-sufficient. Provide any additional information, suggested solution and as much context and examples as possible. If work on your issue requires account credentials please provide them or explain how one can obtain them. --> From what I can tell, when attempting to embed the video thumbnail (into an MP3 file in my case) ffmpeg dies when decoding the .webp file. I tried running the ffmpeg command manually and below is a small snippet of the output: ``` TPE1 : EBSM Electro Body Synth Music TIT2 : SIERRA - UNBROKEN TDRC : 20190605 TSSE : Lavf58.46.101 Stream #0:0: Audio: mp3, 48000 Hz, stereo, fltp, 136 kb/s Metadata: encoder : Lavc58.92 Stream #0:1: Video: webp, yuv420p(tv, bt470bg/unknown/unknown), 1280x720, q=2-31, 25 tbr, 25 tbn, 25 tbc Metadata: title : "Album cover" comment : "Cover (Front)" Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #1:0 -> #0:1 (copy) Press [q] to stop, [?] for help [mp3 @ 0000000002630600] No mimetype is known for stream 1, cannot write an attached picture. av_interleaved_write_frame(): Invalid argument [mp3 @ 0000000002630600] No packets were sent for some of the attached pictures. frame= 1 fps=0.0 q=-1.0 Lsize= 3kB time=00:00:00.04 bitrate= 605.0kbits/s speed=N/A video:34kB audio:1kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown Conversion failed! ``` However, when I simply run a conversion from .webp to .jpg > ffmpeg -i "SIERRA - UNBROKEN.webp" "SIERRA - UNBROKEN.jpg" then repeat the ffmpeg command spat out by youtube-dl when embedding the thumbnail *replacing the .webp with the .jpg file* it works just fine. Is there any way to have youtube-dl specify the file type it downloads the video thumbnails as? I believe the --embed-thumbnail flag would work if the thumbnail was originally downloaded as something other than a .webp file. Thank you for your time,
Author
Owner

@Zirro commented on GitHub (Jun 15, 2020):

The default format for the highest resolution thumbnail seems to have changed to .webp, but a .jpg version remains available as well. youtube-dl ought to use the latter for compatibility.

https://i.ytimg.com/vi_webp/HOYDj769s6k/maxresdefault.webp

https://i.ytimg.com/vi/HOYDj769s6k/maxresdefault.jpg

@Zirro commented on GitHub (Jun 15, 2020): The default format for the highest resolution thumbnail seems to have changed to .webp, but a .jpg version remains available as well. youtube-dl ought to use the latter for compatibility. https://i.ytimg.com/vi_webp/HOYDj769s6k/maxresdefault.webp https://i.ytimg.com/vi/HOYDj769s6k/maxresdefault.jpg
Author
Owner

@Janbong commented on GitHub (Jun 16, 2020):

Same issue here, youtube-dl creates the .webp file, but fails to embed it in the (in my case) .mp3 file. Then outputs two mp3 files:

  • one working mp3 file without the thumbnail
  • one .temp.mp3 file, couple of kilobytes, doesn't seem to contain anything
@Janbong commented on GitHub (Jun 16, 2020): Same issue here, youtube-dl creates the .webp file, but fails to embed it in the (in my case) .mp3 file. Then outputs two mp3 files: - one working mp3 file without the thumbnail - one .temp.mp3 file, couple of kilobytes, doesn't seem to contain anything
Author
Owner

@alexanderadam commented on GitHub (Jun 17, 2020):

Could it be that it is unrelated to webp? Because it fails for jpg, too.

Try this one:

$ youtube-dl -v --prefer-ffmpeg --extract-audio --audio-format mp3 --embed-thumbnail 'https://www.youtube.com/watch?v=YJoAZqT8mTs'
@alexanderadam commented on GitHub (Jun 17, 2020): Could it be that it is unrelated to `webp`? Because it fails for `jpg`, too. Try this one: ``` $ youtube-dl -v --prefer-ffmpeg --extract-audio --audio-format mp3 --embed-thumbnail 'https://www.youtube.com/watch?v=YJoAZqT8mTs' ```
Author
Owner

@alexmerkel commented on GitHub (Jun 17, 2020):

Could it be that it is unrelated to webp? Because it fails for jpg, too.

Try this one:

$ youtube-dl -v --prefer-ffmpeg --extract-audio --audio-format mp3 --embed-thumbnail 'https://www.youtube.com/watch?v=YJoAZqT8mTs'

I think this is an unrelated problem, the JPEG thumbnail seems to be corrupted. I am unable to open the downloaded file on its own using Preview or Photoshop, and I assume thats the reason ffmpeg is unable to embed it as well.

@alexmerkel commented on GitHub (Jun 17, 2020): > Could it be that it is unrelated to `webp`? Because it fails for `jpg`, too. > > Try this one: > > ``` > $ youtube-dl -v --prefer-ffmpeg --extract-audio --audio-format mp3 --embed-thumbnail 'https://www.youtube.com/watch?v=YJoAZqT8mTs' > ``` I think this is an unrelated problem, the JPEG thumbnail seems to be corrupted. I am unable to open the downloaded file on its own using Preview or Photoshop, and I assume thats the reason `ffmpeg` is unable to embed it as well.
Author
Owner

@bubbleguuum commented on GitHub (Jun 17, 2020):

Shouldn't the default thumbnail be the jpg version though, for better compatibility ? Webp is not universally supported.

@bubbleguuum commented on GitHub (Jun 17, 2020): Shouldn't the default thumbnail be the jpg version though, for better compatibility ? Webp is not universally supported.
Author
Owner

@barsnick commented on GitHub (Jun 17, 2020):

Shouldn't the default thumbnail be the jpg version though, for better compatibility ? Webp is not universally supported.

Indeed, the ID3 spec says:

The "image/png" or "image/jpeg" picture format should be used when interoperability is wanted.

Embedding of WEBP into MP3 isn't supported by ffmpeg anyway, and that's the (original) issue, reported as No mimetype is known for stream 1, cannot write an attached picture. So youtube-dl should either choose to download JPEG for embedding, or convert WEBP to JPEG first, or let ffmpeg convert.

@barsnick commented on GitHub (Jun 17, 2020): > Shouldn't the default thumbnail be the jpg version though, for better compatibility ? Webp is not universally supported. Indeed, [the ID3 spec](https://id3.org/id3v2.3.0#Attached_picture) says: > The "image/png" or "image/jpeg" picture format should be used when interoperability is wanted. Embedding of WEBP into MP3 isn't supported by ffmpeg anyway, and that's the (original) issue, reported as ```No mimetype is known for stream 1, cannot write an attached picture```. So youtube-dl should either choose to download JPEG for embedding, or convert WEBP to JPEG first, or let ffmpeg convert.
Author
Owner

@noname8753 commented on GitHub (Jun 17, 2020):

I've also seen it download and add a jpg extension while still webp format and ffmpeg will complain about the mime-type.

postprocessor/embedthumbnail.py temp workaround telling ffmpeg to convert thumb before it adds it:

    if not os.path.exists(encodeFilename(thumbnail_filename)):
        self._downloader.report_warning(
            'Skipping embedding the thumbnail because the file is missing.')
        return [], info

    temp_thumb = encodeFilename(thumbnail_filename, True)
    thumbnail_filename = encodeFilename(thumbnail_filename, True) + ".jpg"

    if self._downloader.params.get('verbose', False):
        self._downloader.to_screen('Converting thumbnail')
    p1 = subprocess.Popen(["ffmpeg", "-i", temp_thumb, thumbnail_filename], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    stdout1, stderr1 = p1.communicate()
    if p1.returncode != 0:
        msg1 = stderr.decode('utf-8', 'replace').strip()
        raise EmbedThumbnailPPError(msg1)

    os.remove(temp_thumb)

    if info['ext'] == 'mp3':

Which works for what I need for the time being (only tested mp3).

@noname8753 commented on GitHub (Jun 17, 2020): I've also seen it download and add a jpg extension while still webp format and ffmpeg will complain about the mime-type. postprocessor/embedthumbnail.py temp workaround telling ffmpeg to convert thumb before it adds it: if not os.path.exists(encodeFilename(thumbnail_filename)): self._downloader.report_warning( 'Skipping embedding the thumbnail because the file is missing.') return [], info temp_thumb = encodeFilename(thumbnail_filename, True) thumbnail_filename = encodeFilename(thumbnail_filename, True) + ".jpg" if self._downloader.params.get('verbose', False): self._downloader.to_screen('Converting thumbnail') p1 = subprocess.Popen(["ffmpeg", "-i", temp_thumb, thumbnail_filename], stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout1, stderr1 = p1.communicate() if p1.returncode != 0: msg1 = stderr.decode('utf-8', 'replace').strip() raise EmbedThumbnailPPError(msg1) os.remove(temp_thumb) if info['ext'] == 'mp3': Which works for what I need for the time being (only tested mp3).
Author
Owner

@koloshor commented on GitHub (Jun 20, 2020):

Could it be that it is unrelated to webp? Because it fails for jpg, too.

Actually, it doesn't. Google, for reasons unknown, is sending webp files mislabeled with .jpg extensions. If you're comfortable with a hex editor, have a look: you'll see the ASCII for RIFF, 4 bytes of payload length, and the ASCII for WEBP.

Or try opening one of your failed jpgs with IrfanView, which is aware of magic numbers and will pop up "some poop-head gave you a webp file with a jpg extension. Would you like it renamed?

@koloshor commented on GitHub (Jun 20, 2020): > Could it be that it is unrelated to `webp`? Because it fails for `jpg`, too. Actually, it doesn't. Google, for reasons unknown, is sending webp files mislabeled with .jpg extensions. If you're comfortable with a hex editor, have a look: you'll see the ASCII for RIFF, 4 bytes of payload length, and the ASCII for WEBP. Or try opening one of your failed jpgs with IrfanView, which is aware of magic numbers and will pop up "some poop-head gave you a webp file with a jpg extension. Would you like it renamed?
Author
Owner

@alexmerkel commented on GitHub (Jun 21, 2020):

You're right @koloshor, I added a detection for this mislabeling to my pull request #25717.

@alexmerkel commented on GitHub (Jun 21, 2020): You're right @koloshor, I added a detection for this mislabeling to my pull request #25717.
Author
Owner

@MrChocolatine commented on GitHub (Jun 22, 2020):

Same problem as well when using --embed-thumbnail option.
I was about to create an Issue but I found this one, /following thread.

@MrChocolatine commented on GitHub (Jun 22, 2020): Same problem as well when using `--embed-thumbnail` option. I was about to create an Issue but I found this one, /following thread.
Author
Owner

@yuceltoluyag commented on GitHub (Jun 24, 2020):

Same problem as well when using --embed-thumbnail option.

@yuceltoluyag commented on GitHub (Jun 24, 2020): Same problem as well when using --embed-thumbnail option.
Author
Owner

@C1eriC commented on GitHub (Jun 25, 2020):

Same problem with .m4a file and AtomicParsley.exe (--embed-thumbnail).

@C1eriC commented on GitHub (Jun 25, 2020): Same problem with **.m4a** file and **AtomicParsley.exe** (--embed-thumbnail).
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#20814
No description provided.