Embedding thumbnail to mp3 causes a error of file not found. #25662

Open
opened 2026-02-21 13:54:22 -05:00 by deekerman · 20 comments
Owner

Originally created by @p3nguinmeme on GitHub (Jan 6, 2023).

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2021.12.17
  • 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

Enter youtube link here
: https://youtu.be/EmuBOfurv3o
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dl version 2021.12.17
[debug] Python version 3.9.7 (CPython) - Windows-10-10.0.19045-SP0
[debug] exe versions: ffmpeg N-55702-g920046a, ffprobe N-55702-g920046a
[debug] Proxy map: {}
[youtube] EmuBOfurv3o: Downloading webpage
[youtube] EmuBOfurv3o: Downloading thumbnail ...
[youtube] EmuBOfurv3o: Writing thumbnail to: C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webp
[debug] Invoking downloader on 'https://rr3---sn-8pgbpohxqp5-auoz.googlevideo.com/videoplayback?expire=1673060111&ei=r4q4Y7XKFpL6WZHhiogJ&ip=82.20.109.132&id=o-ABJG1zZD9xhRDoI0mygZaA-sn8GKrAXQCfedDAIETFW1&itag=251&source=youtube&requiressl=yes&mh=Hl&mm=31%2C29&mn=sn-8pgbpohxqp5-auoz%2Csn-aigzrnld&ms=au%2Crdu&mv=m&mvi=3&pl=24&gcr=gb&initcwndbps=1452500&vprv=1&mime=audio%2Fwebm&ns=d2TFtsH5f29GfvewFyI1bsYK&gir=yes&clen=3652610&dur=218.881&lmt=1591477016463657&mt=1673038191&fvip=2&keepalive=yes&fexp=24007246&c=WEB&txp=5531432&n=TzRconJyS9f2typNK&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cgcr%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhAJVxiFfSM06d1_ZYmKMk6jhglWpU9-0YH_kltRReOQYcAiEA0VDOLjdBtxCK37s53cgcwHcP8-6U7UOmKJLWNIezNuc%3D&sig=AOq0QJ8wRAIgRJWXXrTtel1uWPH1zK0jIr5-zvgmAlgVaQVIj2VH7loCIEOVpuTSB_t2UQabcAHc3HT7uUPTs557ZZxfrgwh-MPk'
[download] Destination: C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webm

[download]   0.0% of 3.48MiB at  5.98KiB/s ETA 09:56
[download]   0.1% of 3.48MiB at 16.76KiB/s ETA 03:32
[download]   0.2% of 3.48MiB at 38.90KiB/s ETA 01:31
[download]   0.4% of 3.48MiB at 82.44KiB/s ETA 00:43
[download]   0.9% of 3.48MiB at 65.26KiB/s ETA 00:54
[download]   1.8% of 3.48MiB at 57.15KiB/s ETA 01:01
[download]   3.2% of 3.48MiB at 48.38KiB/s ETA 01:11
[download]   4.3% of 3.48MiB at 52.48KiB/s ETA 01:05
[download]   6.3% of 3.48MiB at 53.38KiB/s ETA 01:02
[download]   7.8% of 3.48MiB at 51.38KiB/s ETA 01:03
[download]   9.1% of 3.48MiB at 50.83KiB/s ETA 01:03
[download]  10.4% of 3.48MiB at 50.84KiB/s ETA 01:02
[download]  11.8% of 3.48MiB at 51.41KiB/s ETA 01:01
[download]  13.4% of 3.48MiB at 52.27KiB/s ETA 00:59
[download]  15.1% of 3.48MiB at 51.78KiB/s ETA 00:58
[download]  16.4% of 3.48MiB at 51.70KiB/s ETA 00:57
[download]  17.9% of 3.48MiB at 52.03KiB/s ETA 00:56
[download]  19.4% of 3.48MiB at 51.44KiB/s ETA 00:55
[download]  20.7% of 3.48MiB at 51.24KiB/s ETA 00:55
[download]  22.1% of 3.48MiB at 51.28KiB/s ETA 00:54
[download]  23.5% of 3.48MiB at 51.60KiB/s ETA 00:52
[download]  25.1% of 3.48MiB at 52.10KiB/s ETA 00:51
[download]  26.8% of 3.48MiB at 51.89KiB/s ETA 00:50
[download]  28.2% of 3.48MiB at 51.92KiB/s ETA 00:49
[download]  29.7% of 3.48MiB at 51.34KiB/s ETA 00:48
[download]  30.9% of 3.48MiB at 51.87KiB/s ETA 00:47
[download]  32.8% of 3.48MiB at 51.42KiB/s ETA 00:46
[download]  34.1% of 3.48MiB at 51.95KiB/s ETA 00:45
[download]  36.1% of 3.48MiB at 51.58KiB/s ETA 00:44
[download]  37.4% of 3.48MiB at 51.49KiB/s ETA 00:43
[download]  38.7% of 3.48MiB at 51.52KiB/s ETA 00:42
[download]  40.2% of 3.48MiB at 51.71KiB/s ETA 00:41
[download]  41.8% of 3.48MiB at 51.49KiB/s ETA 00:40
[download]  43.1% of 3.48MiB at 51.42KiB/s ETA 00:39
[download]  44.5% of 3.48MiB at 51.46KiB/s ETA 00:38
[download]  46.0% of 3.48MiB at 51.65KiB/s ETA 00:37
[download]  47.6% of 3.48MiB at 51.47KiB/s ETA 00:36
[download]  48.9% of 3.48MiB at 51.36KiB/s ETA 00:35
[download]  50.3% of 3.48MiB at 51.36KiB/s ETA 00:34
[download]  51.7% of 3.48MiB at 51.49KiB/s ETA 00:33
[download]  53.3% of 3.48MiB at 51.71KiB/s ETA 00:32
[download]  55.0% of 3.48MiB at 51.60KiB/s ETA 00:31
[download]  56.3% of 3.48MiB at 51.60KiB/s ETA 00:30
[download]  57.8% of 3.48MiB at 51.72KiB/s ETA 00:29
[download]  59.4% of 3.48MiB at 51.54KiB/s ETA 00:28
[download]  60.6% of 3.48MiB at 51.49KiB/s ETA 00:27
[download]  62.0% of 3.48MiB at 51.50KiB/s ETA 00:26
[download]  63.5% of 3.48MiB at 51.59KiB/s ETA 00:25
[download]  65.0% of 3.48MiB at 51.79KiB/s ETA 00:24
[download]  66.8% of 3.48MiB at 51.72KiB/s ETA 00:22
[download]  68.1% of 3.48MiB at 51.74KiB/s ETA 00:21
[download]  69.6% of 3.48MiB at 51.51KiB/s ETA 00:21
[download]  70.8% of 3.48MiB at 51.74KiB/s ETA 00:20
[download]  72.8% of 3.48MiB at 51.51KiB/s ETA 00:18
[download]  74.0% of 3.48MiB at 51.47KiB/s ETA 00:18
[download]  75.4% of 3.48MiB at 51.49KiB/s ETA 00:17
[download]  76.9% of 3.48MiB at 51.57KiB/s ETA 00:15
[download]  78.5% of 3.48MiB at 51.74KiB/s ETA 00:14
[download]  80.2% of 3.48MiB at 51.70KiB/s ETA 00:13
[download]  81.6% of 3.48MiB at 51.72KiB/s ETA 00:12
[download]  83.1% of 3.48MiB at 51.52KiB/s ETA 00:11
[download]  84.3% of 3.48MiB at 51.70KiB/s ETA 00:10
[download]  86.2% of 3.48MiB at 51.49KiB/s ETA 00:09
[download]  87.4% of 3.48MiB at 51.70KiB/s ETA 00:08
[download]  89.4% of 3.48MiB at 51.57KiB/s ETA 00:07
[download]  90.7% of 3.48MiB at 51.54KiB/s ETA 00:06
[download]  92.1% of 3.48MiB at 51.57KiB/s ETA 00:05
[download]  93.6% of 3.48MiB at 51.66KiB/s ETA 00:04
[download]  95.2% of 3.48MiB at 51.56KiB/s ETA 00:03
[download]  96.5% of 3.48MiB at 51.53KiB/s ETA 00:02
[download]  97.9% of 3.48MiB at 51.55KiB/s ETA 00:01
[download]  99.4% of 3.48MiB at 51.61KiB/s ETA 00:00
[download] 100.0% of 3.48MiB at 51.71KiB/s ETA 00:00
[download] 100% of 3.48MiB in 01:09                 
[debug] ffmpeg command line: ffprobe -show_streams "file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webm"
[ffmpeg] Destination: C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).mp3
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webm" -vn -acodec libmp3lame "-b:a" 192k "file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).mp3"
Deleting original file C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webm (pass -k to keep)
[ffmpeg] Converting thumbnail "C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webp" to JPEG
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webp" "-bsf:v" mjpeg2jpeg "file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).jpg"
[debug] ffmpeg version N-55702-g920046a Copyright (c) 2000-2013 the FFmpeg developers

  built on Aug 21 2013 18:10:00 with gcc 4.7.3 (GCC)

  configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib

  libavutil      52. 42.100 / 52. 42.100

  libavcodec     55. 29.100 / 55. 29.100

  libavformat    55. 14.101 / 55. 14.101

  libavdevice    55.  3.100 / 55.  3.100

  libavfilter     3. 82.100 /  3. 82.100

  libswscale      2.  5.100 /  2.  5.100

  libswresample   0. 17.103 /  0. 17.103

  libpostproc    52.  3.100 / 52.  3.100

[image2 @ 00000000006ecc80] Could find no file with path 'file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webp' and index in the range 0-4

ERROR: file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webp: No such file or directory
Traceback (most recent call last):
  File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 2115, in post_process
    files_to_delete, info = pp.run(info)
  File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\postprocessor\embedthumbnail.py", line 70, in run
    self.run_ffmpeg(escaped_thumbnail_filename, escaped_thumbnail_jpg_filename, ['-bsf:v', 'mjpeg2jpeg'])
  File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\postprocessor\ffmpeg.py", line 242, in run_ffmpeg
    self.run_ffmpeg_multiple_files([path], out_path, opts)
  File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\postprocessor\ffmpeg.py", line 238, in run_ffmpeg_multiple_files
    raise FFmpegPostProcessorError(msg)
youtube_dl.postprocessor.ffmpeg.FFmpegPostProcessorError: file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webp: No such file or directory

Traceback (most recent call last):
  File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 2115, in post_process
    files_to_delete, info = pp.run(info)
  File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\postprocessor\embedthumbnail.py", line 70, in run
    self.run_ffmpeg(escaped_thumbnail_filename, escaped_thumbnail_jpg_filename, ['-bsf:v', 'mjpeg2jpeg'])
  File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\postprocessor\ffmpeg.py", line 242, in run_ffmpeg
    self.run_ffmpeg_multiple_files([path], out_path, opts)
  File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\postprocessor\ffmpeg.py", line 238, in run_ffmpeg_multiple_files
    raise FFmpegPostProcessorError(msg)
youtube_dl.postprocessor.ffmpeg.FFmpegPostProcessorError: file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webp: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Tayga\Desktop\videos\download videos.py", line 26, in <module>
    ydl.download([video])
  File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 2068, in download
    res = self.extract_info(
  File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 808, in extract_info
    return self.__extract_info(url, ie, download, extra_info, process)
  File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 815, in wrapper
    return func(self, *args, **kwargs)
  File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 847, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 881, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 1692, in process_video_result
    self.process_info(new_info)
  File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 2050, in process_info
    self.post_process(filename, info_dict)
  File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 2117, in post_process
    self.report_error(e.msg)
  File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 628, in report_error
    self.trouble(error_message, tb)
  File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 598, in trouble
    raise DownloadError(message, exc_info)
youtube_dl.utils.DownloadError: ERROR: file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webp: No such file or directory

Description

A exception is raised when embedding the video thumbnail to the mp3 file,
The program is unable to find the file despite the fact the file exists in the correct directory,
The problem hasn't occurred when working on another computer with Windows 11 but occurs here on Windows 10
both computers have the same dependencies and running the same version of python

I am not sure what has caused this bug and I am unable to propose a solution due to this

Originally created by @p3nguinmeme on GitHub (Jan 6, 2023). <!-- ###################################################################### 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 2021.12.17. 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 **2021.12.17** - [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 2021.12.17 [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> --> ``` Enter youtube link here : https://youtu.be/EmuBOfurv3o [debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252 [debug] youtube-dl version 2021.12.17 [debug] Python version 3.9.7 (CPython) - Windows-10-10.0.19045-SP0 [debug] exe versions: ffmpeg N-55702-g920046a, ffprobe N-55702-g920046a [debug] Proxy map: {} [youtube] EmuBOfurv3o: Downloading webpage [youtube] EmuBOfurv3o: Downloading thumbnail ... [youtube] EmuBOfurv3o: Writing thumbnail to: C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webp [debug] Invoking downloader on 'https://rr3---sn-8pgbpohxqp5-auoz.googlevideo.com/videoplayback?expire=1673060111&ei=r4q4Y7XKFpL6WZHhiogJ&ip=82.20.109.132&id=o-ABJG1zZD9xhRDoI0mygZaA-sn8GKrAXQCfedDAIETFW1&itag=251&source=youtube&requiressl=yes&mh=Hl&mm=31%2C29&mn=sn-8pgbpohxqp5-auoz%2Csn-aigzrnld&ms=au%2Crdu&mv=m&mvi=3&pl=24&gcr=gb&initcwndbps=1452500&vprv=1&mime=audio%2Fwebm&ns=d2TFtsH5f29GfvewFyI1bsYK&gir=yes&clen=3652610&dur=218.881&lmt=1591477016463657&mt=1673038191&fvip=2&keepalive=yes&fexp=24007246&c=WEB&txp=5531432&n=TzRconJyS9f2typNK&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cgcr%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhAJVxiFfSM06d1_ZYmKMk6jhglWpU9-0YH_kltRReOQYcAiEA0VDOLjdBtxCK37s53cgcwHcP8-6U7UOmKJLWNIezNuc%3D&sig=AOq0QJ8wRAIgRJWXXrTtel1uWPH1zK0jIr5-zvgmAlgVaQVIj2VH7loCIEOVpuTSB_t2UQabcAHc3HT7uUPTs557ZZxfrgwh-MPk' [download] Destination: C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webm [download] 0.0% of 3.48MiB at 5.98KiB/s ETA 09:56 [download] 0.1% of 3.48MiB at 16.76KiB/s ETA 03:32 [download] 0.2% of 3.48MiB at 38.90KiB/s ETA 01:31 [download] 0.4% of 3.48MiB at 82.44KiB/s ETA 00:43 [download] 0.9% of 3.48MiB at 65.26KiB/s ETA 00:54 [download] 1.8% of 3.48MiB at 57.15KiB/s ETA 01:01 [download] 3.2% of 3.48MiB at 48.38KiB/s ETA 01:11 [download] 4.3% of 3.48MiB at 52.48KiB/s ETA 01:05 [download] 6.3% of 3.48MiB at 53.38KiB/s ETA 01:02 [download] 7.8% of 3.48MiB at 51.38KiB/s ETA 01:03 [download] 9.1% of 3.48MiB at 50.83KiB/s ETA 01:03 [download] 10.4% of 3.48MiB at 50.84KiB/s ETA 01:02 [download] 11.8% of 3.48MiB at 51.41KiB/s ETA 01:01 [download] 13.4% of 3.48MiB at 52.27KiB/s ETA 00:59 [download] 15.1% of 3.48MiB at 51.78KiB/s ETA 00:58 [download] 16.4% of 3.48MiB at 51.70KiB/s ETA 00:57 [download] 17.9% of 3.48MiB at 52.03KiB/s ETA 00:56 [download] 19.4% of 3.48MiB at 51.44KiB/s ETA 00:55 [download] 20.7% of 3.48MiB at 51.24KiB/s ETA 00:55 [download] 22.1% of 3.48MiB at 51.28KiB/s ETA 00:54 [download] 23.5% of 3.48MiB at 51.60KiB/s ETA 00:52 [download] 25.1% of 3.48MiB at 52.10KiB/s ETA 00:51 [download] 26.8% of 3.48MiB at 51.89KiB/s ETA 00:50 [download] 28.2% of 3.48MiB at 51.92KiB/s ETA 00:49 [download] 29.7% of 3.48MiB at 51.34KiB/s ETA 00:48 [download] 30.9% of 3.48MiB at 51.87KiB/s ETA 00:47 [download] 32.8% of 3.48MiB at 51.42KiB/s ETA 00:46 [download] 34.1% of 3.48MiB at 51.95KiB/s ETA 00:45 [download] 36.1% of 3.48MiB at 51.58KiB/s ETA 00:44 [download] 37.4% of 3.48MiB at 51.49KiB/s ETA 00:43 [download] 38.7% of 3.48MiB at 51.52KiB/s ETA 00:42 [download] 40.2% of 3.48MiB at 51.71KiB/s ETA 00:41 [download] 41.8% of 3.48MiB at 51.49KiB/s ETA 00:40 [download] 43.1% of 3.48MiB at 51.42KiB/s ETA 00:39 [download] 44.5% of 3.48MiB at 51.46KiB/s ETA 00:38 [download] 46.0% of 3.48MiB at 51.65KiB/s ETA 00:37 [download] 47.6% of 3.48MiB at 51.47KiB/s ETA 00:36 [download] 48.9% of 3.48MiB at 51.36KiB/s ETA 00:35 [download] 50.3% of 3.48MiB at 51.36KiB/s ETA 00:34 [download] 51.7% of 3.48MiB at 51.49KiB/s ETA 00:33 [download] 53.3% of 3.48MiB at 51.71KiB/s ETA 00:32 [download] 55.0% of 3.48MiB at 51.60KiB/s ETA 00:31 [download] 56.3% of 3.48MiB at 51.60KiB/s ETA 00:30 [download] 57.8% of 3.48MiB at 51.72KiB/s ETA 00:29 [download] 59.4% of 3.48MiB at 51.54KiB/s ETA 00:28 [download] 60.6% of 3.48MiB at 51.49KiB/s ETA 00:27 [download] 62.0% of 3.48MiB at 51.50KiB/s ETA 00:26 [download] 63.5% of 3.48MiB at 51.59KiB/s ETA 00:25 [download] 65.0% of 3.48MiB at 51.79KiB/s ETA 00:24 [download] 66.8% of 3.48MiB at 51.72KiB/s ETA 00:22 [download] 68.1% of 3.48MiB at 51.74KiB/s ETA 00:21 [download] 69.6% of 3.48MiB at 51.51KiB/s ETA 00:21 [download] 70.8% of 3.48MiB at 51.74KiB/s ETA 00:20 [download] 72.8% of 3.48MiB at 51.51KiB/s ETA 00:18 [download] 74.0% of 3.48MiB at 51.47KiB/s ETA 00:18 [download] 75.4% of 3.48MiB at 51.49KiB/s ETA 00:17 [download] 76.9% of 3.48MiB at 51.57KiB/s ETA 00:15 [download] 78.5% of 3.48MiB at 51.74KiB/s ETA 00:14 [download] 80.2% of 3.48MiB at 51.70KiB/s ETA 00:13 [download] 81.6% of 3.48MiB at 51.72KiB/s ETA 00:12 [download] 83.1% of 3.48MiB at 51.52KiB/s ETA 00:11 [download] 84.3% of 3.48MiB at 51.70KiB/s ETA 00:10 [download] 86.2% of 3.48MiB at 51.49KiB/s ETA 00:09 [download] 87.4% of 3.48MiB at 51.70KiB/s ETA 00:08 [download] 89.4% of 3.48MiB at 51.57KiB/s ETA 00:07 [download] 90.7% of 3.48MiB at 51.54KiB/s ETA 00:06 [download] 92.1% of 3.48MiB at 51.57KiB/s ETA 00:05 [download] 93.6% of 3.48MiB at 51.66KiB/s ETA 00:04 [download] 95.2% of 3.48MiB at 51.56KiB/s ETA 00:03 [download] 96.5% of 3.48MiB at 51.53KiB/s ETA 00:02 [download] 97.9% of 3.48MiB at 51.55KiB/s ETA 00:01 [download] 99.4% of 3.48MiB at 51.61KiB/s ETA 00:00 [download] 100.0% of 3.48MiB at 51.71KiB/s ETA 00:00 [download] 100% of 3.48MiB in 01:09 [debug] ffmpeg command line: ffprobe -show_streams "file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webm" [ffmpeg] Destination: C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).mp3 [debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webm" -vn -acodec libmp3lame "-b:a" 192k "file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).mp3" Deleting original file C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webm (pass -k to keep) [ffmpeg] Converting thumbnail "C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webp" to JPEG [debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webp" "-bsf:v" mjpeg2jpeg "file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).jpg" [debug] ffmpeg version N-55702-g920046a Copyright (c) 2000-2013 the FFmpeg developers built on Aug 21 2013 18:10:00 with gcc 4.7.3 (GCC) configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib libavutil 52. 42.100 / 52. 42.100 libavcodec 55. 29.100 / 55. 29.100 libavformat 55. 14.101 / 55. 14.101 libavdevice 55. 3.100 / 55. 3.100 libavfilter 3. 82.100 / 3. 82.100 libswscale 2. 5.100 / 2. 5.100 libswresample 0. 17.103 / 0. 17.103 libpostproc 52. 3.100 / 52. 3.100 [image2 @ 00000000006ecc80] Could find no file with path 'file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webp' and index in the range 0-4 ERROR: file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webp: No such file or directory Traceback (most recent call last): File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 2115, in post_process files_to_delete, info = pp.run(info) File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\postprocessor\embedthumbnail.py", line 70, in run self.run_ffmpeg(escaped_thumbnail_filename, escaped_thumbnail_jpg_filename, ['-bsf:v', 'mjpeg2jpeg']) File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\postprocessor\ffmpeg.py", line 242, in run_ffmpeg self.run_ffmpeg_multiple_files([path], out_path, opts) File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\postprocessor\ffmpeg.py", line 238, in run_ffmpeg_multiple_files raise FFmpegPostProcessorError(msg) youtube_dl.postprocessor.ffmpeg.FFmpegPostProcessorError: file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webp: No such file or directory Traceback (most recent call last): File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 2115, in post_process files_to_delete, info = pp.run(info) File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\postprocessor\embedthumbnail.py", line 70, in run self.run_ffmpeg(escaped_thumbnail_filename, escaped_thumbnail_jpg_filename, ['-bsf:v', 'mjpeg2jpeg']) File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\postprocessor\ffmpeg.py", line 242, in run_ffmpeg self.run_ffmpeg_multiple_files([path], out_path, opts) File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\postprocessor\ffmpeg.py", line 238, in run_ffmpeg_multiple_files raise FFmpegPostProcessorError(msg) youtube_dl.postprocessor.ffmpeg.FFmpegPostProcessorError: file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webp: No such file or directory During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\Tayga\Desktop\videos\download videos.py", line 26, in <module> ydl.download([video]) File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 2068, in download res = self.extract_info( File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 808, in extract_info return self.__extract_info(url, ie, download, extra_info, process) File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 815, in wrapper return func(self, *args, **kwargs) File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 847, in __extract_info return self.process_ie_result(ie_result, download, extra_info) File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 881, in process_ie_result return self.process_video_result(ie_result, download=download) File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 1692, in process_video_result self.process_info(new_info) File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 2050, in process_info self.post_process(filename, info_dict) File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 2117, in post_process self.report_error(e.msg) File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 628, in report_error self.trouble(error_message, tb) File "C:\Users\Tayga\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 598, in trouble raise DownloadError(message, exc_info) youtube_dl.utils.DownloadError: ERROR: file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webp: No such file or directory ``` ## 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. --> A exception is raised when embedding the video thumbnail to the mp3 file, The program is unable to find the file despite the fact the file exists in the correct directory, The problem hasn't occurred when working on another computer with Windows 11 but occurs here on Windows 10 both computers have the same dependencies and running the same version of python I am not sure what has caused this bug and I am unable to propose a solution due to this
Author
Owner

@dirkf commented on GitHub (Jan 6, 2023):

Please show the actual yt-dl command that you ran.

However this error seems familiar. I thought it might be a yt-dl version of yt-dlp#4604, but no, though it appears related.

This ffmpeg command is being run and giving this error:

ffmpeg -y -loglevel "repeat+info" -i "file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webp" "-bsf:v" mjpeg2jpeg "file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).jpg"
[image2 @ 00000000006ecc80] Could find no file with path 'file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webp' and index in the range 0-4

I think that this is what is happening...

  1. The code from PR #25717 is trying to convert some possible image sequence format to a JPG.
  2. It invokes the mjpeg2jpeg bitstream filter with the -bsf:v option to fix the JPG encoding.
  3. As the input file is a single frame WEBP image, the image2 demuxer is implicitly used to get the image data from the input file.
  4. Some change in ffmpeg (>4.3) causes image2 to look for an image sequence by default when its output is connected to the mjpeg2jpeg codec.
  5. yt-dl should be adding -pattern_type none to the image2 parameters.

I don't have a new enough version of ffmpeg to trigger the issue but the fix appears to work with my older version (ie, behaviour doesn't change when adding the new parameters):

$ ffmpeg -f image2 -pattern_type none -i 'Nærøyfjorden.webp' '-bsf:v' mjpeg2jpeg 'Nærøyfjorden.jpg'
ffmpeg version 4.3-2ubuntu0~ppa16.04+8 Copyright (c) 2000-2020 the FFmpeg developers
...
Input #0, image2, from 'Nærøyfjorden.webp':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: webp, yuv420p(tv, bt470bg/unknown/unknown), 550x368, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (webp (native) -> mjpeg (native))
...
Output #0, image2, to 'Nærøyfjorden.jpg':
  Metadata:
    encoder         : Lavf58.45.100
    Stream #0:0: Video: mjpeg, yuvj420p(pc), 550x368, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.91.100 mjpeg
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
frame=    1 fps=0.0 q=4.9 Lsize=N/A time=00:00:00.04 bitrate=N/A speed=2.38x    
video:33kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
$

The test WEBP image is the first one on the G developer site for WEBP.

In order to pass the -pattern_type I had to make image2 an explicit demuxer, which might break some other thumbnail formats that yt-dl, with older ffmpeg, currently handles OK. Maybe we can just add -update 1 to the output options instead.

The difference between your Windows systems is likely to be different ffmpeg versions. The logged version is a development build and may be newer than the version on the machine where the problem doesn't occur. Please also show the output of ffmpeg -version on that system.

@dirkf commented on GitHub (Jan 6, 2023): Please show the actual yt-dl command that you ran. However this error seems familiar. I thought it might be a yt-dl version of [yt-dlp#4604](https://github.com/yt-dlp/yt-dlp/issues/4604#issuecomment-1295002727), but no, though it appears related. This _ffmpeg_ command is being run and giving this error: ``` ffmpeg -y -loglevel "repeat+info" -i "file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webp" "-bsf:v" mjpeg2jpeg "file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).jpg" [image2 @ 00000000006ecc80] Could find no file with path 'file:C:\Users\Tayga\Desktop\videos\Tusk (2018 Remaster).webp' and index in the range 0-4 ``` I think that this is what is happening... 1. The code from PR #25717 is trying to convert some possible image sequence format to a JPG. 2. It invokes the [`mjpeg2jpeg` bitstream filter](http://ffmpeg.org/ffmpeg-all.html#toc-mjpeg2jpeg) with the `-bsf:v` option to fix the JPG encoding. 3. As the input file is a single frame WEBP image, the [`image2`](http://ffmpeg.org/ffmpeg-all.html#toc-image2-1) demuxer is implicitly used to get the image data from the input file. 4. Some change in _ffmpeg_ (>4.3) causes `image2` to look for an image sequence by default when its output is connected to the `mjpeg2jpeg` codec. 5. yt-dl should be adding `-pattern_type none` to the `image2` parameters. I don't have a new enough version of _ffmpeg_ to trigger the issue but the fix appears to work with my older version (ie, behaviour doesn't change when adding the new parameters): ``` $ ffmpeg -f image2 -pattern_type none -i 'Nærøyfjorden.webp' '-bsf:v' mjpeg2jpeg 'Nærøyfjorden.jpg' ffmpeg version 4.3-2ubuntu0~ppa16.04+8 Copyright (c) 2000-2020 the FFmpeg developers ... Input #0, image2, from 'Nærøyfjorden.webp': Duration: 00:00:00.04, start: 0.000000, bitrate: N/A Stream #0:0: Video: webp, yuv420p(tv, bt470bg/unknown/unknown), 550x368, 25 tbr, 25 tbn, 25 tbc Stream mapping: Stream #0:0 -> #0:0 (webp (native) -> mjpeg (native)) ... Output #0, image2, to 'Nærøyfjorden.jpg': Metadata: encoder : Lavf58.45.100 Stream #0:0: Video: mjpeg, yuvj420p(pc), 550x368, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc Metadata: encoder : Lavc58.91.100 mjpeg Side data: cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A frame= 1 fps=0.0 q=4.9 Lsize=N/A time=00:00:00.04 bitrate=N/A speed=2.38x video:33kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown $ ``` The test [WEBP image](https://www.gstatic.com/webp/gallery/1.webp) is the first one on the G developer site for WEBP. In order to pass the `-pattern_type` I had to make `image2` an explicit demuxer, which might break some other thumbnail formats that yt-dl, with older _ffmpeg_, currently handles OK. Maybe we can just add `-update 1` to the output options instead. The difference between your Windows systems is likely to be different _ffmpeg_ versions. The logged version is a development build and may be newer than the version on the machine where the problem doesn't occur. Please also show the output of `ffmpeg -version` on that system.
Author
Owner

@p3nguinmeme commented on GitHub (Jan 7, 2023):

Here is the output to ffmpeg -version

ffmpeg version N-55702-g920046a
built on Aug 21 2013 18:10:00 with gcc 4.7.3 (GCC)
configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil      52. 42.100 / 52. 42.100
libavcodec     55. 29.100 / 55. 29.100
libavformat    55. 14.101 / 55. 14.101
libavdevice    55.  3.100 / 55.  3.100
libavfilter     3. 82.100 /  3. 82.100
libswscale      2.  5.100 /  2.  5.100
libswresample   0. 17.103 /  0. 17.103
libpostproc    52.  3.100 / 52.  3.100

Below is the code involved in running the program:

from __future__ import unicode_literals 
import youtube_dl
import os

video = input("Enter youtube link here\n: ")

ydl_opts = {
    'verbose': True,
    'writethumbnail': True,
    'outtmpl': f'{os.getcwd()}/%(title)s.%(ext)s',
    'format': 'bestaudio/best',
    'postprocessors': [
        {'key': 'FFmpegExtractAudio',
         'preferredcodec': 'mp3',
         'preferredquality': '192'},
        {'key': 'EmbedThumbnail',},]}

with youtube_dl.YoutubeDL(ydl_opts) as ydl:
    ydl.download([video])
@p3nguinmeme commented on GitHub (Jan 7, 2023): Here is the output to ffmpeg -version ``` ffmpeg version N-55702-g920046a built on Aug 21 2013 18:10:00 with gcc 4.7.3 (GCC) configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib libavutil 52. 42.100 / 52. 42.100 libavcodec 55. 29.100 / 55. 29.100 libavformat 55. 14.101 / 55. 14.101 libavdevice 55. 3.100 / 55. 3.100 libavfilter 3. 82.100 / 3. 82.100 libswscale 2. 5.100 / 2. 5.100 libswresample 0. 17.103 / 0. 17.103 libpostproc 52. 3.100 / 52. 3.100 ``` Below is the code involved in running the program: ``` from __future__ import unicode_literals import youtube_dl import os video = input("Enter youtube link here\n: ") ydl_opts = { 'verbose': True, 'writethumbnail': True, 'outtmpl': f'{os.getcwd()}/%(title)s.%(ext)s', 'format': 'bestaudio/best', 'postprocessors': [ {'key': 'FFmpegExtractAudio', 'preferredcodec': 'mp3', 'preferredquality': '192'}, {'key': 'EmbedThumbnail',},]} with youtube_dl.YoutubeDL(ydl_opts) as ydl: ydl.download([video]) ```
Author
Owner

@dirkf commented on GitHub (Jan 7, 2023):

N-55702-g920046a is the ffmpeg version in your problem log. Just to confirm, that is the same on the Win 11 machine where you don't get the problem?

This is what happens with the git master on my machine (the thumbnail code is the same), and ffmpeg 4.3:

$ python3
Python 3.5.2 (default, Dec  1 2022, 11:14:24) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import youtube_dl

>>> ydl_opts = { 
...     'verbose': True, 
...     'writethumbnail': True,
...     'outtmpl': '%(title)s.%(ext)s',
...     'format': 'bestaudio/best',
...     'postprocessors': [{
...         'key': 'FFmpegExtractAudio', 
...         'preferredcodec': 'mp3', 
...         'preferredquality': '192'
...     }, {'key': 'EmbedThumbnail',},
...     ]
... }
>>> with youtube_dl.YoutubeDL(ydl_opts) as ydl: 
...     ydl.download(['gdZLi9oWNZg'])
... 
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Git HEAD: 774b346f9
[debug] Python version 3.5.2 (CPython) - Linux-4.4.0-210-generic-i686-with-Ubuntu-16.04-xenial
[debug] exe versions: avconv 4.3, avprobe 4.3, ffmpeg 4.3, ffprobe 4.3
[debug] Proxy map: {}
[youtube] gdZLi9oWNZg: Downloading webpage
[debug] [youtube] Decrypted nsig MYwlgErBSIqWbuUyF => M0_RTOAWx5uSTA
[debug] [youtube] Decrypted nsig pJ07oijQzEmRciNJE => QBA0Jrw2s8qTPg
[youtube] gdZLi9oWNZg: Downloading thumbnail ...
[youtube] gdZLi9oWNZg: Writing thumbnail to: BTS (방탄소년단) 'Dynamite' Official MV.webp
[debug] Invoking downloader on 'https://rr2---sn-cu-aigss.googlevideo.com/videoplayback?fexp=24007246&mm=31%2C29&id=o-ACMt9fcvEwO7JdYiQoGgnFQxHSr0IgI1fx_B-BwHC_WN&mh=LC&mvi=2&dur=223.381&ei=e1y5Y7qqOZmxxN8PtL2NuA0&ns=yOw4JojIt8EIiwpHQGEGGwYK&mt=1673091933&sig=AOq0QJ8wRAIgG2vZFOJQHX7BfHH1Y-TVN3pICs-o9DKTyxcPzZWqB-YCIBeQHTJJUGI3WcZPQ1JP5Q-k62aOQd5lOCpLYF70PXCy&keepalive=yes&itag=251&lsig=AG3C_xAwRgIhANhgS1OgVn_tAR0WDmQYDP1139ikpK0RS-pvxwLP3O5XAiEA6bxHAD_3vrhZR9VGAGfPOxnM4-n2QmhADZJGladbfBE%3D&n=M0_RTOAWx5uSTA&clen=3730537&mv=m&vprv=1&c=WEB&mn=sn-cu-aigss%2Csn-cu-c9id&requiressl=yes&expire=1673113820&ip=46.208.6.34&gir=yes&ms=au%2Crdu&fvip=5&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&source=youtube&pl=25&mime=audio%2Fwebm&initcwndbps=1582500&txp=4532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lmt=1653149808559966'
[download] Destination: BTS (방탄소년단) 'Dynamite' Official MV.webm
[download] 100% of 3.56MiB in 00:04
[debug] ffmpeg command line: ffprobe -show_streams 'file:BTS (방탄소년단) '"'"'Dynamite'"'"' Official MV.webm'
[ffmpeg] Destination: BTS (방탄소년단) 'Dynamite' Official MV.mp3
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:BTS (방탄소년단) '"'"'Dynamite'"'"' Official MV.webm' -vn -acodec libmp3lame -b:a 192k 'file:BTS (방탄소년단) '"'"'Dynamite'"'"' Official MV.mp3'
Deleting original file BTS (방탄소년단) 'Dynamite' Official MV.webm (pass -k to keep)
[ffmpeg] Converting thumbnail "BTS (방탄소년단) 'Dynamite' Official MV.webp" to JPEG
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:BTS (방탄소년단) '"'"'Dynamite'"'"' Official MV.webp' -bsf:v mjpeg2jpeg 'file:BTS (방탄소년단) '"'"'Dynamite'"'"' Official MV.jpg'
[ffmpeg] Adding thumbnail to "BTS (방탄소년단) 'Dynamite' Official MV.mp3"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:BTS (방탄소년단) '"'"'Dynamite'"'"' Official MV.mp3' -i 'file:BTS (방탄소년단) '"'"'Dynamite'"'"' Official MV.jpg' -c copy -map 0 -map 1 -metadata:s:v 'title="Album cover"' -metadata:s:v 'comment="Cover (Front)"' 'file:BTS (방탄소년단) '"'"'Dynamite'"'"' Official MV.temp.mp3'
0
>>> 
@dirkf commented on GitHub (Jan 7, 2023): `N-55702-g920046a` is the _ffmpeg_ version in your problem log. Just to confirm, that is the same on the Win 11 machine where you don't get the problem? This is what happens with the git master on my machine (the thumbnail code is the same), and _ffmpeg_ 4.3: ```shellsession $ python3 Python 3.5.2 (default, Dec 1 2022, 11:14:24) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import youtube_dl >>> ydl_opts = { ... 'verbose': True, ... 'writethumbnail': True, ... 'outtmpl': '%(title)s.%(ext)s', ... 'format': 'bestaudio/best', ... 'postprocessors': [{ ... 'key': 'FFmpegExtractAudio', ... 'preferredcodec': 'mp3', ... 'preferredquality': '192' ... }, {'key': 'EmbedThumbnail',}, ... ] ... } >>> with youtube_dl.YoutubeDL(ydl_opts) as ydl: ... ydl.download(['gdZLi9oWNZg']) ... [debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8 [debug] youtube-dl version 2021.12.17 [debug] Git HEAD: 774b346f9 [debug] Python version 3.5.2 (CPython) - Linux-4.4.0-210-generic-i686-with-Ubuntu-16.04-xenial [debug] exe versions: avconv 4.3, avprobe 4.3, ffmpeg 4.3, ffprobe 4.3 [debug] Proxy map: {} [youtube] gdZLi9oWNZg: Downloading webpage [debug] [youtube] Decrypted nsig MYwlgErBSIqWbuUyF => M0_RTOAWx5uSTA [debug] [youtube] Decrypted nsig pJ07oijQzEmRciNJE => QBA0Jrw2s8qTPg [youtube] gdZLi9oWNZg: Downloading thumbnail ... [youtube] gdZLi9oWNZg: Writing thumbnail to: BTS (방탄소년단) 'Dynamite' Official MV.webp [debug] Invoking downloader on 'https://rr2---sn-cu-aigss.googlevideo.com/videoplayback?fexp=24007246&mm=31%2C29&id=o-ACMt9fcvEwO7JdYiQoGgnFQxHSr0IgI1fx_B-BwHC_WN&mh=LC&mvi=2&dur=223.381&ei=e1y5Y7qqOZmxxN8PtL2NuA0&ns=yOw4JojIt8EIiwpHQGEGGwYK&mt=1673091933&sig=AOq0QJ8wRAIgG2vZFOJQHX7BfHH1Y-TVN3pICs-o9DKTyxcPzZWqB-YCIBeQHTJJUGI3WcZPQ1JP5Q-k62aOQd5lOCpLYF70PXCy&keepalive=yes&itag=251&lsig=AG3C_xAwRgIhANhgS1OgVn_tAR0WDmQYDP1139ikpK0RS-pvxwLP3O5XAiEA6bxHAD_3vrhZR9VGAGfPOxnM4-n2QmhADZJGladbfBE%3D&n=M0_RTOAWx5uSTA&clen=3730537&mv=m&vprv=1&c=WEB&mn=sn-cu-aigss%2Csn-cu-c9id&requiressl=yes&expire=1673113820&ip=46.208.6.34&gir=yes&ms=au%2Crdu&fvip=5&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&source=youtube&pl=25&mime=audio%2Fwebm&initcwndbps=1582500&txp=4532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lmt=1653149808559966' [download] Destination: BTS (방탄소년단) 'Dynamite' Official MV.webm [download] 100% of 3.56MiB in 00:04 [debug] ffmpeg command line: ffprobe -show_streams 'file:BTS (방탄소년단) '"'"'Dynamite'"'"' Official MV.webm' [ffmpeg] Destination: BTS (방탄소년단) 'Dynamite' Official MV.mp3 [debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:BTS (방탄소년단) '"'"'Dynamite'"'"' Official MV.webm' -vn -acodec libmp3lame -b:a 192k 'file:BTS (방탄소년단) '"'"'Dynamite'"'"' Official MV.mp3' Deleting original file BTS (방탄소년단) 'Dynamite' Official MV.webm (pass -k to keep) [ffmpeg] Converting thumbnail "BTS (방탄소년단) 'Dynamite' Official MV.webp" to JPEG [debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:BTS (방탄소년단) '"'"'Dynamite'"'"' Official MV.webp' -bsf:v mjpeg2jpeg 'file:BTS (방탄소년단) '"'"'Dynamite'"'"' Official MV.jpg' [ffmpeg] Adding thumbnail to "BTS (방탄소년단) 'Dynamite' Official MV.mp3" [debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:BTS (방탄소년단) '"'"'Dynamite'"'"' Official MV.mp3' -i 'file:BTS (방탄소년단) '"'"'Dynamite'"'"' Official MV.jpg' -c copy -map 0 -map 1 -metadata:s:v 'title="Album cover"' -metadata:s:v 'comment="Cover (Front)"' 'file:BTS (방탄소년단) '"'"'Dynamite'"'"' Official MV.temp.mp3' 0 >>> ```
Author
Owner

@p3nguinmeme commented on GitHub (Jan 7, 2023):

The windows 11 machine has ffmpeg 5.1.2 on it.

how would I get the program to use a specific version of ffmpeg as the N-55702-g920046a version is being prioritised over any other version I install.

@p3nguinmeme commented on GitHub (Jan 7, 2023): The windows 11 machine has ffmpeg 5.1.2 on it. how would I get the program to use a specific version of ffmpeg as the N-55702-g920046a version is being prioritised over any other version I install.
Author
Owner

@dirkf commented on GitHub (Jan 7, 2023):

If you have a known version of ffmpeg that you would like to use rather than whatever is in your %PATH%, use the --ffmpg-location ... option (or its API equivalent ffmpeg_location).

I expect that Chocolatey has some way of forcing a particular version but I don't use it myself.

@dirkf commented on GitHub (Jan 7, 2023): If you have a known version of _ffmpeg_ that you would like to use rather than whatever is in your `%PATH%`, use the `--ffmpg-location ...` option (or its API equivalent `ffmpeg_location`). I expect that Chocolatey has some way of forcing a particular version but I don't use it myself.
Author
Owner

@p3nguinmeme commented on GitHub (Jan 8, 2023):

I've now removed the version of ffmpeg an have installed 4.3,
the log is similar to the one you have shown earlier
while the FileNotFound error has stopped the resulting mp3 file does not have the thumbnail embedded when I go to preview it
I've tried this with 5.1.2 as well with the same results

@p3nguinmeme commented on GitHub (Jan 8, 2023): I've now removed the version of ffmpeg an have installed 4.3, the log is similar to the one you have shown earlier while the FileNotFound error has stopped the resulting mp3 file does not have the thumbnail embedded when I go to preview it I've tried this with 5.1.2 as well with the same results
Author
Owner

@dirkf commented on GitHub (Jan 8, 2023):

The test for which I posted the log above creates a file BTS (방탄소년단) 'Dynamite' Official MV.mp3 containing a JPEG cover art item, as in this MediaInfo output:

General
Complete name                            : BTS (방탄소년단) 'Dynamite' Official MV.mp3
Format                                   : MPEG Audio
File size                                : 5.15 MiB
Duration                                 : 3mn 43s
Overall bit rate mode                    : Constant
Overall bit rate                         : 192 Kbps
Writing library                          : LAME3.100
Cover                                    : Yes
Cover description                        : "Album cover"
Cover MIME                               : image/jpeg

Audio
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 3
Mode                                     : Joint stereo
Mode extension                           : MS Stereo
Duration                                 : 3mn 43s
Bit rate mode                            : Constant
Bit rate                                 : 192 Kbps
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 KHz
Compression mode                         : Lossy
Stream size                              : 5.11 MiB (99%)
Writing library                          : LAME3.100

A picture of some random K-Pop Backstreet Boys revivalists is shown when playing the MP3 in mpv.

@dirkf commented on GitHub (Jan 8, 2023): The test for which I posted the log [above](https://github.com/ytdl-org/youtube-dl/issues/31454#issuecomment-1374462021) creates a file `BTS (방탄소년단) 'Dynamite' Official MV.mp3` containing a JPEG cover art item, as in this _MediaInfo_ output: ``` General Complete name : BTS (방탄소년단) 'Dynamite' Official MV.mp3 Format : MPEG Audio File size : 5.15 MiB Duration : 3mn 43s Overall bit rate mode : Constant Overall bit rate : 192 Kbps Writing library : LAME3.100 Cover : Yes Cover description : "Album cover" Cover MIME : image/jpeg Audio Format : MPEG Audio Format version : Version 1 Format profile : Layer 3 Mode : Joint stereo Mode extension : MS Stereo Duration : 3mn 43s Bit rate mode : Constant Bit rate : 192 Kbps Channel(s) : 2 channels Sampling rate : 48.0 KHz Compression mode : Lossy Stream size : 5.11 MiB (99%) Writing library : LAME3.100 ``` A picture of some random K-Pop Backstreet Boys revivalists is shown when playing the MP3 in _mpv_.
Author
Owner

@dirkf commented on GitHub (Jan 8, 2023):

If you can still run the problem version of ffmpeg, it would be very helpful to run this test.

  1. Download the test WEBP image as aaa.webp (or some other name that doesn't match any existing WEBP or JPEG image in the directory). It should show a Nordic landscape.
  2. Try these commands:
ffmpeg -f image2 -pattern_type -i aaa.webp -bsf:v mjpeg2jpeg aaa_1.jpg
ffmpeg -i aaa.webp -bsf:v mjpeg2jpeg -update 1 aaa_2.jpg
@dirkf commented on GitHub (Jan 8, 2023): If you can still run the problem version of _ffmpeg_, it would be very helpful to run this test. 1. Download the [test WEBP image](https://www.gstatic.com/webp/gallery/1.webp) as `aaa.webp` (or some other name that doesn't match any existing WEBP or JPEG image in the directory). It should show a Nordic landscape. 2. Try these commands: ``` ffmpeg -f image2 -pattern_type -i aaa.webp -bsf:v mjpeg2jpeg aaa_1.jpg ffmpeg -i aaa.webp -bsf:v mjpeg2jpeg -update 1 aaa_2.jpg ```
Author
Owner

@p3nguinmeme commented on GitHub (Jan 8, 2023):

for the first line I receive this:

Desktop>ffmpeg -f image2 -pattern_type -i aaa.webp -bsf:v mjpeg2jpeg aaa_1.jpg
ffmpeg version N-55702-g920046a Copyright (c) 2000-2013 the FFmpeg developers
  built on Aug 21 2013 18:10:00 with gcc 4.7.3 (GCC)
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 42.100 / 52. 42.100
  libavcodec     55. 29.100 / 55. 29.100
  libavformat    55. 14.101 / 55. 14.101
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 82.100 /  3. 82.100
  libswscale      2.  5.100 /  2.  5.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
File 'aaa.webp' already exists. Overwrite ? [y/N] y
Output #0, image2, to 'aaa.webp':
Output file #0 does not contain any stream

the second command did create a file called aaa_2.jpg which contains the nordic landscape
the output was this

Desktop>ffmpeg -i aaa.webp -bsf:v mjpeg2jpeg -update 1 aaa_2.jpg
ffmpeg version N-55702-g920046a Copyright (c) 2000-2013 the FFmpeg developers
  built on Aug 21 2013 18:10:00 with gcc 4.7.3 (GCC)
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 42.100 / 52. 42.100
  libavcodec     55. 29.100 / 55. 29.100
  libavformat    55. 14.101 / 55. 14.101
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 82.100 /  3. 82.100
  libswscale      2.  5.100 /  2.  5.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Input #0, image2, from 'aaa.webp':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: webp, yuv420p, 550x368, 25 tbr, 25 tbn, 25 tbc
[swscaler @ 0000000002656260] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to 'aaa_2.jpg':
  Metadata:
    encoder         : Lavf55.14.101
    Stream #0:0: Video: mjpeg, yuvj420p, 550x368, q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (webp -> mjpeg)
Press [q] to stop, [?] for help
[mjpeg @ 0000000002667f80] input is not MJPEG/AVI1
Failed to open bitstream filter mjpeg2jpeg for stream 0 with codec mjpeg: Invalid data found when processing input
frame=    1 fps=0.0 q=0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A
video:34kB audio:0kB subtitle:0 global headers:0kB muxing overhead -100.062528%
@p3nguinmeme commented on GitHub (Jan 8, 2023): for the first line I receive this: ``` Desktop>ffmpeg -f image2 -pattern_type -i aaa.webp -bsf:v mjpeg2jpeg aaa_1.jpg ffmpeg version N-55702-g920046a Copyright (c) 2000-2013 the FFmpeg developers built on Aug 21 2013 18:10:00 with gcc 4.7.3 (GCC) configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib libavutil 52. 42.100 / 52. 42.100 libavcodec 55. 29.100 / 55. 29.100 libavformat 55. 14.101 / 55. 14.101 libavdevice 55. 3.100 / 55. 3.100 libavfilter 3. 82.100 / 3. 82.100 libswscale 2. 5.100 / 2. 5.100 libswresample 0. 17.103 / 0. 17.103 libpostproc 52. 3.100 / 52. 3.100 File 'aaa.webp' already exists. Overwrite ? [y/N] y Output #0, image2, to 'aaa.webp': Output file #0 does not contain any stream ``` the second command did create a file called aaa_2.jpg which contains the nordic landscape the output was this ``` Desktop>ffmpeg -i aaa.webp -bsf:v mjpeg2jpeg -update 1 aaa_2.jpg ffmpeg version N-55702-g920046a Copyright (c) 2000-2013 the FFmpeg developers built on Aug 21 2013 18:10:00 with gcc 4.7.3 (GCC) configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib libavutil 52. 42.100 / 52. 42.100 libavcodec 55. 29.100 / 55. 29.100 libavformat 55. 14.101 / 55. 14.101 libavdevice 55. 3.100 / 55. 3.100 libavfilter 3. 82.100 / 3. 82.100 libswscale 2. 5.100 / 2. 5.100 libswresample 0. 17.103 / 0. 17.103 libpostproc 52. 3.100 / 52. 3.100 Input #0, image2, from 'aaa.webp': Duration: 00:00:00.04, start: 0.000000, bitrate: N/A Stream #0:0: Video: webp, yuv420p, 550x368, 25 tbr, 25 tbn, 25 tbc [swscaler @ 0000000002656260] deprecated pixel format used, make sure you did set range correctly Output #0, image2, to 'aaa_2.jpg': Metadata: encoder : Lavf55.14.101 Stream #0:0: Video: mjpeg, yuvj420p, 550x368, q=2-31, 200 kb/s, 90k tbn, 25 tbc Stream mapping: Stream #0:0 -> #0:0 (webp -> mjpeg) Press [q] to stop, [?] for help [mjpeg @ 0000000002667f80] input is not MJPEG/AVI1 Failed to open bitstream filter mjpeg2jpeg for stream 0 with codec mjpeg: Invalid data found when processing input frame= 1 fps=0.0 q=0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A video:34kB audio:0kB subtitle:0 global headers:0kB muxing overhead -100.062528% ```
Author
Owner

@dirkf commented on GitHub (Jan 8, 2023):

Excellent, thanks. I'll investigate adding -update 1 for all ffmpeg versions. The yt-dlp issue shows that it ought to be supported way back, to 2.8.

In principle we probably ought not to run the mjpeg2jpeg filter unless the image type is suitable, but that hasn't been a problem so far.

@dirkf commented on GitHub (Jan 8, 2023): Excellent, thanks. I'll investigate adding `-update 1` for all _ffmpeg_ versions. The yt-dlp issue shows that it ought to be supported way back, to 2.8. In principle we probably ought not to run the `mjpeg2jpeg` filter unless the image type is suitable, but that hasn't been a problem so far.
Author
Owner

@nicolaasjan commented on GitHub (Jan 11, 2023):

@dirkf
Can you explain why the mp3 downloaded with youtube-dl doesn't show the thumbnail in explorer, while the one downloaded with yt-dlp does.
Both show "Cover" in MediaInfo.

screenshot4

This is on Windows10 with the most recent FFmpeg.

On Linux the thumbnail is shown in both cases.

Yt-dlp and youtube-dl built from latest master.

@nicolaasjan commented on GitHub (Jan 11, 2023): @dirkf Can you explain why the mp3 downloaded with **youtube-dl** doesn't show the thumbnail in explorer, while the one downloaded with **yt-dlp** does. Both show "Cover" in MediaInfo. ![screenshot4](https://user-images.githubusercontent.com/14093220/211748541-ffb194d8-a3c7-43fc-bf33-9ed1b85d3b38.png) This is on Windows10 with the most recent FFmpeg. On Linux the thumbnail is shown in both cases. Yt-dlp and youtube-dl built from latest `master`.
Author
Owner

@dirkf commented on GitHub (Jan 11, 2023):

Thanks for this research.

On Linux the thumbnail is shown in both cases.

What, after copying to the Windows test machine? That's the acid test.

The postprocessor code has evolved somewhat in yt-dlp. It's possible that there's some subtle difference in the ffmpeg command lines used for the embedding, and/or for the MP3 extraction, such that the yt-dlp result matches Win10 Explorer's understanding of MP3 cover art better. Use --verbose to show the ffmpeg command lines.

Windows versions may differ. In the olden days there was a separate shell extension that could be inspected separately but who knows what's going on in the too-bad-for-open-source Windows code.

@dirkf commented on GitHub (Jan 11, 2023): Thanks for this research. >On Linux the thumbnail is shown in both cases. What, after copying to the Windows test machine? That's the acid test. The postprocessor code has evolved somewhat in yt-dlp. It's possible that there's some subtle difference in the _ffmpeg_ command lines used for the embedding, and/or for the MP3 extraction, such that the yt-dlp result matches Win10 Explorer's understanding of MP3 cover art better. Use `--verbose` to show the _ffmpeg_ command lines. Windows versions may differ. In the olden days there was a separate shell extension that could be inspected separately but who knows what's going on in the too-bad-for-open-source Windows code.
Author
Owner

@nicolaasjan commented on GitHub (Jan 11, 2023):

On Linux the thumbnail is shown in both cases.

What, after copying to the Windows test machine? That's the acid test.

I downloaded it on the Windows VM, but the same one downloaded from my Linux Mint Mate system also didn't show the thumbnail, when copied to the Windows VM.

ytd -v -f bestaudio -x --audio-format mp3 --add-metadata --embed-thumbnail --audio-quality 0 EmuBOfurv3o
[debug] System config: []
[debug] User config: ['-i', '-o', '/dev/shm/test-ytd/%(title)s.%(ext)s', '-f', 'bestvideo[height<=1080][ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best', '--no-mtime', '--add-metadata', '--embed-thumbnail', '--force-ipv4', '--external-downloader', 'aria2c', '--external-downloader-args', '-x 10 -s 10 -j 10 -k 1M --log-level=info --file-allocation=none']
[debug] Custom config: []
[debug] Command-line args: ['-v', '-f', 'bestaudio', '-x', '--audio-format', 'mp3', '--add-metadata', '--embed-thumbnail', '--audio-quality', '0', 'EmuBOfurv3o']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2022.11.13
[debug] Python version 3.8.10 (CPython) - Linux-5.4.0-136-generic-x86_64-with-glibc2.29
[debug] exe versions: ffmpeg N-109468-gd39b34123d-Nico-20221230, ffprobe N-109468-gd39b34123d-Nico-20221230, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] EmuBOfurv3o: Downloading webpage
[debug] [youtube] Decrypted nsig GsVlz4RsTGGjmpwP => m9gOz-l0Y7dUFA
[debug] [youtube] Decrypted nsig HorEBoGt335RsoH8 => nkbEboHdHEVCYQ
[youtube] EmuBOfurv3o: Downloading thumbnail ...
[youtube] EmuBOfurv3o: Writing thumbnail to: /dev/shm/test-ytd/Tusk (2018 Remaster).webp
[debug] Invoking downloader on 'https://rr2---sn-5hne6n6e.googlevideo.com/videoplayback?expire=1673457798&ei=Jpy-Y7W2C4ix1gK9-ZToDg&ip=<redacted>&id=o-AMn7ra_jQBBstAtHk-tybVyezVogrARotC2nfj4I8K6w&itag=251&source=youtube&requiressl=yes&mh=Hl&mm=31%2C26&mn=sn-5hne6n6e%2Csn-4g5ednss&ms=au%2Conr&mv=m&mvi=2&pl=20&gcr=nl&initcwndbps=2325000&vprv=1&mime=audio%2Fwebm&ns=aCy_ixdJAIk0-0aSiIB8jLsK&gir=yes&clen=3652610&dur=218.881&lmt=1591477016463657&mt=1673435835&fvip=2&keepalive=yes&fexp=24007246&c=WEB&txp=5531432&n=m9gOz-l0Y7dUFA&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cgcr%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgbfqsrDe3ZGl-0OykhMql5uS9MnVywD83vFWprik1EecCIQCUL_kfiUdONtzLBq94ATHredrYWXDjtZKLHc7cFANetQ%3D%3D&sig=AOq0QJ8wRQIgBmIQpFiIzCy_THEkJSM9J7CLfe8wiMNWlXwzeZq7nRECIQCJteu9kaGScU0kZn3D-yy3RZzwqz_q5h5DcG66FwYmgQ%3D%3D'
[download] Destination: /dev/shm/test-ytd/Tusk (2018 Remaster).webm
[debug] aria2c command line: aria2c -c -x 10 -s 10 -j 10 -k 1M --log-level=info --file-allocation=none --dir /dev/shm/test-ytd --out 'Tusk (2018 Remaster).webm.part' --header 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.1 Safari/537.36' --header 'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7' --header 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' --header 'Accept-Encoding: gzip, deflate' --header 'Accept-Language: en-us,en;q=0.5' --interface 0.0.0.0 --check-certificate=true --remote-time=false -- 'https://rr2---sn-5hne6n6e.googlevideo.com/videoplayback?expire=1673457798&ei=Jpy-Y7W2C4ix1gK9-ZToDg&ip=<redacted>&id=o-AMn7ra_jQBBstAtHk-tybVyezVogrARotC2nfj4I8K6w&itag=251&source=youtube&requiressl=yes&mh=Hl&mm=31%2C26&mn=sn-5hne6n6e%2Csn-4g5ednss&ms=au%2Conr&mv=m&mvi=2&pl=20&gcr=nl&initcwndbps=2325000&vprv=1&mime=audio%2Fwebm&ns=aCy_ixdJAIk0-0aSiIB8jLsK&gir=yes&clen=3652610&dur=218.881&lmt=1591477016463657&mt=1673435835&fvip=2&keepalive=yes&fexp=24007246&c=WEB&txp=5531432&n=m9gOz-l0Y7dUFA&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cgcr%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgbfqsrDe3ZGl-0OykhMql5uS9MnVywD83vFWprik1EecCIQCUL_kfiUdONtzLBq94ATHredrYWXDjtZKLHc7cFANetQ%3D%3D&sig=AOq0QJ8wRQIgBmIQpFiIzCy_THEkJSM9J7CLfe8wiMNWlXwzeZq7nRECIQCJteu9kaGScU0kZn3D-yy3RZzwqz_q5h5DcG66FwYmgQ%3D%3D'

01/11 12:23:20 [NOTICE] Downloading 1 item(s)
[#feddab 2.7MiB/3.4MiB(80%) CN:1 DL:286KiB ETA:2s]                             
01/11 12:23:30 [NOTICE] Download complete: /dev/shm/test-ytd/Tusk (2018 Remaster).webm.part

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
feddab|OK  |   351KiB/s|/dev/shm/test-ytd/Tusk (2018 Remaster).webm.part

Status Legend:
(OK):download completed.
[aria2c] Downloaded 3652610 bytes
[download] 100% of 3.48MiB in 00:10
[debug] ffmpeg command line: ffprobe -show_streams 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).webm'
[ffmpeg] Destination: /dev/shm/test-ytd/Tusk (2018 Remaster).mp3
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).webm' -vn -acodec libmp3lame -q:a 0 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).mp3'
Deleting original file /dev/shm/test-ytd/Tusk (2018 Remaster).webm (pass -k to keep)
[ffmpeg] Adding metadata to '/dev/shm/test-ytd/Tusk (2018 Remaster).mp3'
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).mp3' -c copy -metadata 'title=Tusk (2018 Remaster)' -metadata date=20181115 -metadata 'description=Provided to YouTube by Rhino/Warner Records

Tusk (2018 Remaster) · Fleetwood Mac

50 Years - Don'"'"'t Stop

℗ 1979 Warner Records Inc. 2018 Remastered Rhino Entertainment

Engineer: Barry Goldberg
Additional  Guitar: Brett Tuggle
Additional  Keyboards: Brett Tuggle
Backing  Vocals: Brett Tuggle
Unknown: Charlie Bouis
Unknown: Dr. Arthur C. Bartner
Unknown: Elliot Scheiner
Engineer: Elliot Scheiner
Producer: Elliot Scheiner
Unknown: Guy Charboneau
Bass  Guitar: John McVie
Unknown: John Nelson
Additional  Percussion: Lenny Castro
Guitar, Producer, Vocals: Lindsey Buckingham
Drums, Percussion: Mick Fleetwood
Backing  Vocals: Mindy Stein
Additional  Guitar: Neale Heywood
Backing  Vocals: Neale Heywood
Engineer: Paul DeCarli
Engineer: Scott Humphrey
Backing  Vocals: Sharon Celani
Vocals: Stevie Nicks
Unknown: Ted Jensen
Engineer: Ted Jensen
Ensemble: USC Marching Band
Writer: Lindsey Buckingham

Auto-generated by YouTube.' -metadata 'comment=Provided to YouTube by Rhino/Warner Records

Tusk (2018 Remaster) · Fleetwood Mac

50 Years - Don'"'"'t Stop

℗ 1979 Warner Records Inc. 2018 Remastered Rhino Entertainment

Engineer: Barry Goldberg
Additional  Guitar: Brett Tuggle
Additional  Keyboards: Brett Tuggle
Backing  Vocals: Brett Tuggle
Unknown: Charlie Bouis
Unknown: Dr. Arthur C. Bartner
Unknown: Elliot Scheiner
Engineer: Elliot Scheiner
Producer: Elliot Scheiner
Unknown: Guy Charboneau
Bass  Guitar: John McVie
Unknown: John Nelson
Additional  Percussion: Lenny Castro
Guitar, Producer, Vocals: Lindsey Buckingham
Drums, Percussion: Mick Fleetwood
Backing  Vocals: Mindy Stein
Additional  Guitar: Neale Heywood
Backing  Vocals: Neale Heywood
Engineer: Paul DeCarli
Engineer: Scott Humphrey
Backing  Vocals: Sharon Celani
Vocals: Stevie Nicks
Unknown: Ted Jensen
Engineer: Ted Jensen
Ensemble: USC Marching Band
Writer: Lindsey Buckingham

Auto-generated by YouTube.' -metadata 'purl=https://www.youtube.com/watch?v=EmuBOfurv3o' -metadata 'artist=Fleetwood Mac' -metadata 'album=50 Years - Don'"'"'t Stop' 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).temp.mp3'
[ffmpeg] Converting thumbnail "/dev/shm/test-ytd/Tusk (2018 Remaster).webp" to JPEG
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).webp' -qmin 1 -q:v 1 -bsf:v mjpeg2jpeg 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).jpg'
[ffmpeg] Adding thumbnail to "/dev/shm/test-ytd/Tusk (2018 Remaster).mp3"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).mp3' -i 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).jpg' -c copy -map 0 -map 1 -metadata:s:v 'title="Album cover"' -metadata:s:v 'comment="Cover (Front)"' 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).temp.mp3'

Note however, that I have edited line 72 in embedthumbnail.py to produce better jpeg quality. Doubt that can be the cause.

self.run_ffmpeg(escaped_thumbnail_filename, escaped_thumbnail_jpg_filename, ['-qmin', '1', '-q:v', '1', '-bsf:v', 'mjpeg2jpeg'])

@nicolaasjan commented on GitHub (Jan 11, 2023): > > On Linux the thumbnail is shown in both cases. > > What, after copying to the Windows test machine? That's the acid test. I downloaded it on the Windows VM, but the same one downloaded from my Linux Mint Mate system also didn't show the thumbnail, when copied to the Windows VM. ```bash ytd -v -f bestaudio -x --audio-format mp3 --add-metadata --embed-thumbnail --audio-quality 0 EmuBOfurv3o [debug] System config: [] [debug] User config: ['-i', '-o', '/dev/shm/test-ytd/%(title)s.%(ext)s', '-f', 'bestvideo[height<=1080][ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best', '--no-mtime', '--add-metadata', '--embed-thumbnail', '--force-ipv4', '--external-downloader', 'aria2c', '--external-downloader-args', '-x 10 -s 10 -j 10 -k 1M --log-level=info --file-allocation=none'] [debug] Custom config: [] [debug] Command-line args: ['-v', '-f', 'bestaudio', '-x', '--audio-format', 'mp3', '--add-metadata', '--embed-thumbnail', '--audio-quality', '0', 'EmuBOfurv3o'] [debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8 [debug] youtube-dl version 2022.11.13 [debug] Python version 3.8.10 (CPython) - Linux-5.4.0-136-generic-x86_64-with-glibc2.29 [debug] exe versions: ffmpeg N-109468-gd39b34123d-Nico-20221230, ffprobe N-109468-gd39b34123d-Nico-20221230, phantomjs 2.1.1, rtmpdump 2.4 [debug] Proxy map: {} [youtube] EmuBOfurv3o: Downloading webpage [debug] [youtube] Decrypted nsig GsVlz4RsTGGjmpwP => m9gOz-l0Y7dUFA [debug] [youtube] Decrypted nsig HorEBoGt335RsoH8 => nkbEboHdHEVCYQ [youtube] EmuBOfurv3o: Downloading thumbnail ... [youtube] EmuBOfurv3o: Writing thumbnail to: /dev/shm/test-ytd/Tusk (2018 Remaster).webp [debug] Invoking downloader on 'https://rr2---sn-5hne6n6e.googlevideo.com/videoplayback?expire=1673457798&ei=Jpy-Y7W2C4ix1gK9-ZToDg&ip=<redacted>&id=o-AMn7ra_jQBBstAtHk-tybVyezVogrARotC2nfj4I8K6w&itag=251&source=youtube&requiressl=yes&mh=Hl&mm=31%2C26&mn=sn-5hne6n6e%2Csn-4g5ednss&ms=au%2Conr&mv=m&mvi=2&pl=20&gcr=nl&initcwndbps=2325000&vprv=1&mime=audio%2Fwebm&ns=aCy_ixdJAIk0-0aSiIB8jLsK&gir=yes&clen=3652610&dur=218.881&lmt=1591477016463657&mt=1673435835&fvip=2&keepalive=yes&fexp=24007246&c=WEB&txp=5531432&n=m9gOz-l0Y7dUFA&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cgcr%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgbfqsrDe3ZGl-0OykhMql5uS9MnVywD83vFWprik1EecCIQCUL_kfiUdONtzLBq94ATHredrYWXDjtZKLHc7cFANetQ%3D%3D&sig=AOq0QJ8wRQIgBmIQpFiIzCy_THEkJSM9J7CLfe8wiMNWlXwzeZq7nRECIQCJteu9kaGScU0kZn3D-yy3RZzwqz_q5h5DcG66FwYmgQ%3D%3D' [download] Destination: /dev/shm/test-ytd/Tusk (2018 Remaster).webm [debug] aria2c command line: aria2c -c -x 10 -s 10 -j 10 -k 1M --log-level=info --file-allocation=none --dir /dev/shm/test-ytd --out 'Tusk (2018 Remaster).webm.part' --header 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.1 Safari/537.36' --header 'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7' --header 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' --header 'Accept-Encoding: gzip, deflate' --header 'Accept-Language: en-us,en;q=0.5' --interface 0.0.0.0 --check-certificate=true --remote-time=false -- 'https://rr2---sn-5hne6n6e.googlevideo.com/videoplayback?expire=1673457798&ei=Jpy-Y7W2C4ix1gK9-ZToDg&ip=<redacted>&id=o-AMn7ra_jQBBstAtHk-tybVyezVogrARotC2nfj4I8K6w&itag=251&source=youtube&requiressl=yes&mh=Hl&mm=31%2C26&mn=sn-5hne6n6e%2Csn-4g5ednss&ms=au%2Conr&mv=m&mvi=2&pl=20&gcr=nl&initcwndbps=2325000&vprv=1&mime=audio%2Fwebm&ns=aCy_ixdJAIk0-0aSiIB8jLsK&gir=yes&clen=3652610&dur=218.881&lmt=1591477016463657&mt=1673435835&fvip=2&keepalive=yes&fexp=24007246&c=WEB&txp=5531432&n=m9gOz-l0Y7dUFA&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cgcr%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgbfqsrDe3ZGl-0OykhMql5uS9MnVywD83vFWprik1EecCIQCUL_kfiUdONtzLBq94ATHredrYWXDjtZKLHc7cFANetQ%3D%3D&sig=AOq0QJ8wRQIgBmIQpFiIzCy_THEkJSM9J7CLfe8wiMNWlXwzeZq7nRECIQCJteu9kaGScU0kZn3D-yy3RZzwqz_q5h5DcG66FwYmgQ%3D%3D' 01/11 12:23:20 [NOTICE] Downloading 1 item(s) [#feddab 2.7MiB/3.4MiB(80%) CN:1 DL:286KiB ETA:2s] 01/11 12:23:30 [NOTICE] Download complete: /dev/shm/test-ytd/Tusk (2018 Remaster).webm.part Download Results: gid |stat|avg speed |path/URI ======+====+===========+======================================================= feddab|OK | 351KiB/s|/dev/shm/test-ytd/Tusk (2018 Remaster).webm.part Status Legend: (OK):download completed. [aria2c] Downloaded 3652610 bytes [download] 100% of 3.48MiB in 00:10 [debug] ffmpeg command line: ffprobe -show_streams 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).webm' [ffmpeg] Destination: /dev/shm/test-ytd/Tusk (2018 Remaster).mp3 [debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).webm' -vn -acodec libmp3lame -q:a 0 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).mp3' Deleting original file /dev/shm/test-ytd/Tusk (2018 Remaster).webm (pass -k to keep) [ffmpeg] Adding metadata to '/dev/shm/test-ytd/Tusk (2018 Remaster).mp3' [debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).mp3' -c copy -metadata 'title=Tusk (2018 Remaster)' -metadata date=20181115 -metadata 'description=Provided to YouTube by Rhino/Warner Records Tusk (2018 Remaster) · Fleetwood Mac 50 Years - Don'"'"'t Stop ℗ 1979 Warner Records Inc. 2018 Remastered Rhino Entertainment Engineer: Barry Goldberg Additional Guitar: Brett Tuggle Additional Keyboards: Brett Tuggle Backing Vocals: Brett Tuggle Unknown: Charlie Bouis Unknown: Dr. Arthur C. Bartner Unknown: Elliot Scheiner Engineer: Elliot Scheiner Producer: Elliot Scheiner Unknown: Guy Charboneau Bass Guitar: John McVie Unknown: John Nelson Additional Percussion: Lenny Castro Guitar, Producer, Vocals: Lindsey Buckingham Drums, Percussion: Mick Fleetwood Backing Vocals: Mindy Stein Additional Guitar: Neale Heywood Backing Vocals: Neale Heywood Engineer: Paul DeCarli Engineer: Scott Humphrey Backing Vocals: Sharon Celani Vocals: Stevie Nicks Unknown: Ted Jensen Engineer: Ted Jensen Ensemble: USC Marching Band Writer: Lindsey Buckingham Auto-generated by YouTube.' -metadata 'comment=Provided to YouTube by Rhino/Warner Records Tusk (2018 Remaster) · Fleetwood Mac 50 Years - Don'"'"'t Stop ℗ 1979 Warner Records Inc. 2018 Remastered Rhino Entertainment Engineer: Barry Goldberg Additional Guitar: Brett Tuggle Additional Keyboards: Brett Tuggle Backing Vocals: Brett Tuggle Unknown: Charlie Bouis Unknown: Dr. Arthur C. Bartner Unknown: Elliot Scheiner Engineer: Elliot Scheiner Producer: Elliot Scheiner Unknown: Guy Charboneau Bass Guitar: John McVie Unknown: John Nelson Additional Percussion: Lenny Castro Guitar, Producer, Vocals: Lindsey Buckingham Drums, Percussion: Mick Fleetwood Backing Vocals: Mindy Stein Additional Guitar: Neale Heywood Backing Vocals: Neale Heywood Engineer: Paul DeCarli Engineer: Scott Humphrey Backing Vocals: Sharon Celani Vocals: Stevie Nicks Unknown: Ted Jensen Engineer: Ted Jensen Ensemble: USC Marching Band Writer: Lindsey Buckingham Auto-generated by YouTube.' -metadata 'purl=https://www.youtube.com/watch?v=EmuBOfurv3o' -metadata 'artist=Fleetwood Mac' -metadata 'album=50 Years - Don'"'"'t Stop' 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).temp.mp3' [ffmpeg] Converting thumbnail "/dev/shm/test-ytd/Tusk (2018 Remaster).webp" to JPEG [debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).webp' -qmin 1 -q:v 1 -bsf:v mjpeg2jpeg 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).jpg' [ffmpeg] Adding thumbnail to "/dev/shm/test-ytd/Tusk (2018 Remaster).mp3" [debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).mp3' -i 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).jpg' -c copy -map 0 -map 1 -metadata:s:v 'title="Album cover"' -metadata:s:v 'comment="Cover (Front)"' 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).temp.mp3' ``` Note however, that I have edited line 72 in `embedthumbnail.py` to produce better jpeg quality. Doubt that can be the cause. ` self.run_ffmpeg(escaped_thumbnail_filename, escaped_thumbnail_jpg_filename, ['-qmin', '1', '-q:v', '1', '-bsf:v', 'mjpeg2jpeg'])`
Author
Owner

@dirkf commented on GitHub (Jan 11, 2023):

Probably it's this difference:

         if info['ext'] == 'mp3':
             options = [
-                '-c', 'copy', '-map', '0', '-map', '1',
-                '-metadata:s:v', 'title="Album cover"', '-metadata:s:v', 'comment="Cover (Front)"']
-
-            self._downloader.to_screen('[ffmpeg] Adding thumbnail to "%s"' % filename)
-
+                '-c', 'copy', '-map', '0:0', '-map', '1:0', '-write_id3v1', '1', '-id3v2_version', '3',
+                '-metadata:s:v', 'title="Album cover"', '-metadata:s:v', 'comment=Cover (front)']
+
+            self._report_run('ffmpeg', filename)
             self.run_ffmpeg_multiple_files([filename, thumbnail_filename], temp_filename, options)
@dirkf commented on GitHub (Jan 11, 2023): Probably it's this difference: ```diff if info['ext'] == 'mp3': options = [ - '-c', 'copy', '-map', '0', '-map', '1', - '-metadata:s:v', 'title="Album cover"', '-metadata:s:v', 'comment="Cover (Front)"'] - - self._downloader.to_screen('[ffmpeg] Adding thumbnail to "%s"' % filename) - + '-c', 'copy', '-map', '0:0', '-map', '1:0', '-write_id3v1', '1', '-id3v2_version', '3', + '-metadata:s:v', 'title="Album cover"', '-metadata:s:v', 'comment=Cover (front)'] + + self._report_run('ffmpeg', filename) self.run_ffmpeg_multiple_files([filename, thumbnail_filename], temp_filename, options) ```
Author
Owner

@nicolaasjan commented on GitHub (Jan 11, 2023):

It's a bit offtopic here, but can't youtube-dl's behaviour be changed accordingly?
Disclaimer: I'm not a coder myself. 😀

Difference between conversion:
Youtube-dl:

[ffmpeg] Converting thumbnail "/dev/shm/test-ytd/Tusk (2018 Remaster).webp" to JPEG
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).webp' -qmin 1 -q:v 1 -bsf:v mjpeg2jpeg 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).jpg'

Yt-dlp:

[ThumbnailsConvertor] Converting thumbnail "/dev/shm/test-dlp/Tusk (2018 Remaster).webp" to jpg
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -f image2 -pattern_type none -i 'file:/dev/shm/test-dlp/Tusk (2018 Remaster).webp' -update 1 -bsf:v mjpeg2jpeg -movflags +faststart -qmin 1 -q:v 1 -metadata synopsis= 'file:/dev/shm/test-dlp/Tusk (2018 Remaster).jpg'

@nicolaasjan commented on GitHub (Jan 11, 2023): It's a bit offtopic here, but can't youtube-dl's behaviour be changed accordingly? Disclaimer: I'm not a coder myself. 😀️ Difference between conversion: Youtube-dl: ```bash [ffmpeg] Converting thumbnail "/dev/shm/test-ytd/Tusk (2018 Remaster).webp" to JPEG [debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).webp' -qmin 1 -q:v 1 -bsf:v mjpeg2jpeg 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).jpg' ``` Yt-dlp: ```bash [ThumbnailsConvertor] Converting thumbnail "/dev/shm/test-dlp/Tusk (2018 Remaster).webp" to jpg [debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -f image2 -pattern_type none -i 'file:/dev/shm/test-dlp/Tusk (2018 Remaster).webp' -update 1 -bsf:v mjpeg2jpeg -movflags +faststart -qmin 1 -q:v 1 -metadata synopsis= 'file:/dev/shm/test-dlp/Tusk (2018 Remaster).jpg' ```
Author
Owner

@dirkf commented on GitHub (Jan 11, 2023):

For the embedding, there are these two yt-dlp commits that make up the diff above:

At some point this comment applied and probably still does:

# Write id3v1 metadata also since Windows Explorer can't handle id3v2 tags

For the conversion:

ffmpeg -y -loglevel repeat+info -i 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).webp' ...
--qmin 1 -q:v 1 -bsf:v mjpeg2jpeg 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).jpg'
+-update 1 -bsf:v mjpeg2jpeg -movflags +faststart -qmin 1 -q:v 1 -metadata synopsis= 'file:/dev/shm/test-dlp/Tusk (2018 Remaster).jpg'
  • -update 1 has to be added according to this issue for new ffmpeg builds.
  • -movflags +faststart is only relevant for MP4/MOV destination containers, so not for MP3 (fun fact: the + means just set faststart and don't reset any other movflags, which was "so obvious that it went without saying" in the ffmpeg docs).
  • synopsis= is forcing an empty description but from the yt-dlp code I have no idea how it came to be there (would be comment= in yt-dl or, I guess, with yt-dlp compat set).

So I think -update 1 and the ID3 options have to be added.

@dirkf commented on GitHub (Jan 11, 2023): For the embedding, there are these two yt-dlp commits that make up the diff above: * https://github.com/yt-dlp/yt-dlp/commit/e51f368c275ea94dccc5cf4e07960d9c9633dfd5 * https://github.com/yt-dlp/yt-dlp/commit/f894294636989788f02b917037f1f4a771595489 At some point [this comment](https://github.com/yt-dlp/yt-dlp/blob/master/yt_dlp/postprocessor/ffmpeg.py#L771) applied and probably still does: ``` # Write id3v1 metadata also since Windows Explorer can't handle id3v2 tags ``` For the conversion: ``` ffmpeg -y -loglevel repeat+info -i 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).webp' ... ``` ```diff --qmin 1 -q:v 1 -bsf:v mjpeg2jpeg 'file:/dev/shm/test-ytd/Tusk (2018 Remaster).jpg' +-update 1 -bsf:v mjpeg2jpeg -movflags +faststart -qmin 1 -q:v 1 -metadata synopsis= 'file:/dev/shm/test-dlp/Tusk (2018 Remaster).jpg' ``` * `-update 1` has to be added according to this issue for new _ffmpeg_ builds. * `-movflags +faststart` is only relevant for MP4/MOV destination containers, so not for MP3 (fun fact: [the `+` means just set `faststart` and don't reset any other `movflags`](https://stackoverflow.com/a/66898438), which was "so obvious that it went without saying" in the _ffmpeg_ docs). * `synopsis=` is forcing an empty description but from the yt-dlp code I have no idea how it came to be there (would be `comment=` in yt-dl or, I guess, with yt-dlp compat set). So I think `-update 1` and the ID3 options have to be added.
Author
Owner

@dirkf commented on GitHub (Jan 28, 2023):

Also, embedding in MKV ought to be supported.

@dirkf commented on GitHub (Jan 28, 2023): Also, [embedding in MKV](https://github.com/ytdl-org/youtube-dl/issues/31471#issuecomment-1383135689) ought to be supported.
Author
Owner

@pukkandan commented on GitHub (Jan 28, 2023):

  • synopsis= is forcing an empty description but from the yt-dlp code I have no idea how it came to be there (would be comment= in yt-dl or, I guess, with yt-dlp compat set).

It looks like @nicolaasjan is manually supplying -qmin 1 -q:v 1 -metadata synopsis=with --ppa. It's not being added by yt-dlp

Since ffmpeg ignores movflags for non-mp4, yt-dlp just adds it to everything

@pukkandan commented on GitHub (Jan 28, 2023): > * `synopsis=` is forcing an empty description but from the yt-dlp code I have no idea how it came to be there (would be `comment=` in yt-dl or, I guess, with yt-dlp compat set). It looks like @nicolaasjan is manually supplying `-qmin 1 -q:v 1 -metadata synopsis=`with `--ppa`. It's not being added by yt-dlp > * `-movflags +faststart` is only relevant for MP4/MOV destination containers, so not for MP3 (fun fact: [the `+` means just set `faststart` and don't reset any other `movflags`](https://stackoverflow.com/a/66898438), which was "so obvious that it went without saying" in the _ffmpeg_docs). Since ffmpeg ignores movflags for non-mp4, yt-dlp just adds it to everything
Author
Owner

@nicolaasjan commented on GitHub (Jan 28, 2023):

It looks like @nicolaasjan is manually supplying -qmin 1 -q:v 1 -metadata synopsis=with --ppa. It's not being added by yt-dlp

This is indeed the case.

@nicolaasjan commented on GitHub (Jan 28, 2023): > It looks like @nicolaasjan is manually supplying `-qmin 1 -q:v 1 -metadata synopsis=`with `--ppa`. It's not being added by yt-dlp This is indeed the case.
Author
Owner

@dirkf commented on GitHub (Sep 14, 2025):

Now (ffmpeg 5.1.7):

youtube-dl -v -f bestaudio --write-thumb -x --audio-format mp3 --audio-quality 192K --embed-thumb --user-agent 'Mozilla/5.0' 'EmuBOfurv3o'
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-f', 'bestaudio', '--write-thumb', '-x', '--audio-format', 'mp3', '--audio-quality', '192K', '--embed-thumb', '--user-agent', 'Mozilla/5.0', 'EmuBOfurv3o']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2025.05.05 [a084c80f7] (single file build)
[debug] ** This version was built from the latest master code at https://github.com/ytdl-org/youtube-dl.
[debug] ** For support, visit the main site.
[debug] Python 3.11.2 (CPython i686 32bit) - Linux-6.1.0-38-686-pae-i686-with-glibc2.36 - OpenSSL 3.0.17 1 Jul 2025 - glibc 2.36
[debug] exe versions: ffmpeg 5.1.7-0, ffprobe 5.1.7-0
[debug] Proxy map: {}
[youtube] EmuBOfurv3o: Downloading webpage
[youtube] EmuBOfurv3o: Downloading TVHTML5 API JSON
[debug] [youtube] Extracting signature function https://www.youtube.com/s/player/b66835e2/player_ias.vflset/en_US/base.js-107
[debug] Loading youtube-sigfuncs.b66835e2-main-107 from cache
[debug] Loading youtube-nsig.b66835e2-main from cache
[debug] [youtube] Decrypted nsig lAem-BsyETWS70omwtm9 => d0Nr1HC1u1B4uw
[debug] [youtube] Decrypted nsig 94XQlTXUgkYPsZfCFsi6 => rxEm9ZTvH1b65A
[debug] [youtube] Extracting signature function https://www.youtube.com/s/player/b66835e2/player_ias.vflset/en_US/base.js-103
[debug] Loading youtube-sigfuncs.b66835e2-main-103 from cache
[youtube] EmuBOfurv3o: Downloading thumbnail ...
[youtube] EmuBOfurv3o: Writing thumbnail to: Tusk (2018 Remaster)-EmuBOfurv3o.jpg
[debug] Invoking downloader on 'https://rr4---sn-cu-aigsl.googlevideo.com/videoplayback?expire=1757874379&ei=a7TGaIvCCJK_mLAP4OuMuAE&ip=46.208.6.89&id=o-AL7-VxzfocDRGXrJ5uiiIvMUZaDdTuyx96Zl4YmPkXHR&itag=251&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1757852779%2C&mh=Hl&mm=31%2C29&mn=sn-cu-aigsl%2Csn-cu-c9id&ms=au%2Crdu&mv=m&mvi=4&pcm2cms=yes&pl=25&rms=au%2Cau&gcr=gb&initcwndbps=3551250&bui=AY1jyLNmsTOvKgzxnGmrjOX6TlN1ZCuFytRK9SxbeosGENE0Z5SIQ-AwcsJN2VipUw-6qkWY2u7tQh55&vprv=1&svpuc=1&mime=audio%2Fwebm&ns=pQXemN0gqX-BBjapaDf7tIQQ&rqh=1&gir=yes&clen=3668939&dur=218.881&lmt=1714550471076427&mt=1757852289&fvip=5&keepalive=yes&lmw=1&fexp=51557447%2C51565115%2C51565682%2C51580970%2C51583703&c=TVHTML5&sefc=1&txp=5532434&n=rxEm9ZTvH1b65A&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cgcr%2Cbui%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpcm2cms%2Cpl%2Crms%2Cinitcwndbps&lsig=APaTxxMwRQIgAatg_kC3Wz52_t7EvsVOTSru6CO22Dp8eISd0S5BiNkCIQDEEAKsdigMskpjq6D2nLmzhgbql6ewgOCqFqqmgAk2vQ%3D%3D&sig=AJfQdSswRAIgChFb8MXwzVMFVBxizwxaWiYIjKfZtVmFvxh0tiqKvMwCIHqYcKnb0z8KkYKVZujxh5QyQLBYEoKzbVSe3Xnqhoxr'
[dashsegments] Total fragments: 1
[download] Destination: Tusk (2018 Remaster)-EmuBOfurv3o.webm
[download] 100% of 3.50MiB in 00:10
[debug] ffmpeg command line: ffprobe -show_streams 'file:Tusk (2018 Remaster)-EmuBOfurv3o.webm'
[ffmpeg] Destination: Tusk (2018 Remaster)-EmuBOfurv3o.mp3
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:Tusk (2018 Remaster)-EmuBOfurv3o.webm' -vn -acodec libmp3lame -b:a 192k 'file:Tusk (2018 Remaster)-EmuBOfurv3o.mp3'
Deleting original file Tusk (2018 Remaster)-EmuBOfurv3o.webm (pass -k to keep)
[ffmpeg] Adding thumbnail to "Tusk (2018 Remaster)-EmuBOfurv3o.mp3"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:Tusk (2018 Remaster)-EmuBOfurv3o.mp3' -i 'file:Tusk (2018 Remaster)-EmuBOfurv3o.jpg' -c copy -map 0 -map 1 -metadata:s:v 'title="Album cover"' -metadata:s:v 'comment="Cover (Front)"' 'file:Tusk (2018 Remaster)-EmuBOfurv3o.temp.mp3'
$ 
@dirkf commented on GitHub (Sep 14, 2025): Now (_ffmpeg_ 5.1.7): ```console youtube-dl -v -f bestaudio --write-thumb -x --audio-format mp3 --audio-quality 192K --embed-thumb --user-agent 'Mozilla/5.0' 'EmuBOfurv3o' [debug] System config: [] [debug] User config: [] [debug] Custom config: [] [debug] Command-line args: ['-v', '-f', 'bestaudio', '--write-thumb', '-x', '--audio-format', 'mp3', '--audio-quality', '192K', '--embed-thumb', '--user-agent', 'Mozilla/5.0', 'EmuBOfurv3o'] [debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8 [debug] youtube-dl version 2025.05.05 [a084c80f7] (single file build) [debug] ** This version was built from the latest master code at https://github.com/ytdl-org/youtube-dl. [debug] ** For support, visit the main site. [debug] Python 3.11.2 (CPython i686 32bit) - Linux-6.1.0-38-686-pae-i686-with-glibc2.36 - OpenSSL 3.0.17 1 Jul 2025 - glibc 2.36 [debug] exe versions: ffmpeg 5.1.7-0, ffprobe 5.1.7-0 [debug] Proxy map: {} [youtube] EmuBOfurv3o: Downloading webpage [youtube] EmuBOfurv3o: Downloading TVHTML5 API JSON [debug] [youtube] Extracting signature function https://www.youtube.com/s/player/b66835e2/player_ias.vflset/en_US/base.js-107 [debug] Loading youtube-sigfuncs.b66835e2-main-107 from cache [debug] Loading youtube-nsig.b66835e2-main from cache [debug] [youtube] Decrypted nsig lAem-BsyETWS70omwtm9 => d0Nr1HC1u1B4uw [debug] [youtube] Decrypted nsig 94XQlTXUgkYPsZfCFsi6 => rxEm9ZTvH1b65A [debug] [youtube] Extracting signature function https://www.youtube.com/s/player/b66835e2/player_ias.vflset/en_US/base.js-103 [debug] Loading youtube-sigfuncs.b66835e2-main-103 from cache [youtube] EmuBOfurv3o: Downloading thumbnail ... [youtube] EmuBOfurv3o: Writing thumbnail to: Tusk (2018 Remaster)-EmuBOfurv3o.jpg [debug] Invoking downloader on 'https://rr4---sn-cu-aigsl.googlevideo.com/videoplayback?expire=1757874379&ei=a7TGaIvCCJK_mLAP4OuMuAE&ip=46.208.6.89&id=o-AL7-VxzfocDRGXrJ5uiiIvMUZaDdTuyx96Zl4YmPkXHR&itag=251&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1757852779%2C&mh=Hl&mm=31%2C29&mn=sn-cu-aigsl%2Csn-cu-c9id&ms=au%2Crdu&mv=m&mvi=4&pcm2cms=yes&pl=25&rms=au%2Cau&gcr=gb&initcwndbps=3551250&bui=AY1jyLNmsTOvKgzxnGmrjOX6TlN1ZCuFytRK9SxbeosGENE0Z5SIQ-AwcsJN2VipUw-6qkWY2u7tQh55&vprv=1&svpuc=1&mime=audio%2Fwebm&ns=pQXemN0gqX-BBjapaDf7tIQQ&rqh=1&gir=yes&clen=3668939&dur=218.881&lmt=1714550471076427&mt=1757852289&fvip=5&keepalive=yes&lmw=1&fexp=51557447%2C51565115%2C51565682%2C51580970%2C51583703&c=TVHTML5&sefc=1&txp=5532434&n=rxEm9ZTvH1b65A&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cgcr%2Cbui%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpcm2cms%2Cpl%2Crms%2Cinitcwndbps&lsig=APaTxxMwRQIgAatg_kC3Wz52_t7EvsVOTSru6CO22Dp8eISd0S5BiNkCIQDEEAKsdigMskpjq6D2nLmzhgbql6ewgOCqFqqmgAk2vQ%3D%3D&sig=AJfQdSswRAIgChFb8MXwzVMFVBxizwxaWiYIjKfZtVmFvxh0tiqKvMwCIHqYcKnb0z8KkYKVZujxh5QyQLBYEoKzbVSe3Xnqhoxr' [dashsegments] Total fragments: 1 [download] Destination: Tusk (2018 Remaster)-EmuBOfurv3o.webm [download] 100% of 3.50MiB in 00:10 [debug] ffmpeg command line: ffprobe -show_streams 'file:Tusk (2018 Remaster)-EmuBOfurv3o.webm' [ffmpeg] Destination: Tusk (2018 Remaster)-EmuBOfurv3o.mp3 [debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:Tusk (2018 Remaster)-EmuBOfurv3o.webm' -vn -acodec libmp3lame -b:a 192k 'file:Tusk (2018 Remaster)-EmuBOfurv3o.mp3' Deleting original file Tusk (2018 Remaster)-EmuBOfurv3o.webm (pass -k to keep) [ffmpeg] Adding thumbnail to "Tusk (2018 Remaster)-EmuBOfurv3o.mp3" [debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:Tusk (2018 Remaster)-EmuBOfurv3o.mp3' -i 'file:Tusk (2018 Remaster)-EmuBOfurv3o.jpg' -c copy -map 0 -map 1 -metadata:s:v 'title="Album cover"' -metadata:s:v 'comment="Cover (Front)"' 'file:Tusk (2018 Remaster)-EmuBOfurv3o.temp.mp3' $ ```
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#25662
No description provided.