yt-dlp encounters an error embedding thumbnails when --format
is used #6686
Closed
Description
DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE
- I understand that I will be blocked if I intentionally remove or skip any mandatory* field
Checklist
- I'm reporting a bug unrelated to a specific site
- I've verified that I'm running yt-dlp version 2023.03.04 (update instructions) or later (specify commit)
- I've checked that all provided URLs are playable in a browser with the same IP and same login details
- I've checked that all URLs and arguments with special characters are properly quoted or escaped
- I've searched known issues and the bugtracker for similar issues including closed ones. DO NOT post duplicates
- I've read the guidelines for opening an issue
Provide a description that is worded well enough to be understood
I'm seeing yt-dlp error out when using the --format
flag. When the same command is executed without the --format
flag, the command completes without error. I don't know exactly what is being passed to the EmbedThumbnail
post-processor, but that is where the error is being thrown.
I've also noticed that when I run the same command without --format
, yt-dlp skips converting the thumbnail from webp
to png
before embedding. Webp thumbnail works perfectly fine on my system (Win10 w/ K-Lite codec pack installed).
Here's output from the same command but without the --format
flag (click to show)
[debug] Command-line config: ['--verbose', '--force-overwrites', '--no-continue', '--embed-thumbnail', '--merge-output-format', 'mkv', '--output', '%(title)s [@%(uploader)s] [%(id)s].%(ext)s', 'https://www.youtube.com/watch?v=Gub1bI12ODY']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out cp1252 (No ANSI), error cp1252 (No ANSI), screen cp1252 (No ANSI)
[debug] yt-dlp version stable@2023.03.04 [392389b7d] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.19045-SP0 (OpenSSL 1.1.1k 25 Mar 2021)
[debug] exe versions: ffmpeg 5.1.2-full_build-www.gyan.dev (setts), ffprobe 5.1.2-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.17, brotli-1.0.9, certifi-2022.12.07, mutagen-1.46.0, sqlite3-2.6.0, websockets-10.4
[debug] Proxy map: {}
[debug] Loaded 1786 extractors
[youtube] Extracting URL: https://www.youtube.com/watch?v=Gub1bI12ODY
[youtube] Gub1bI12ODY: Downloading webpage
[youtube] Gub1bI12ODY: Downloading android player API JSON
[debug] Loading youtube-nsig.fa7eb95c from cache
[debug] [youtube] Decrypted nsig McHoyqm-5dZCLmiWEt => W2XbOTkNs1KczQ
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] Gub1bI12ODY: Downloading 1 format(s): 308+251
Deleting existing file G-Sync & Reflex Low Latency - How To Use Both [@Battle(non)sense] [Gub1bI12ODY].webp
[info] Downloading video thumbnail 41 ...
[info] Writing video thumbnail 41 to: G-Sync & Reflex Low Latency - How To Use Both [@Battle(non)sense] [Gub1bI12ODY].webp
Deleting existing file G-Sync & Reflex Low Latency - How To Use Both [@Battle(non)sense] [Gub1bI12ODY].mkv
[debug] Invoking dashsegments downloader on "https://rr1---sn-ni5f-txbd.googlevideo.com/videoplayback?expire=1680283225&ei=-cEmZOyXOLmJsfIP5YOSgA4&ip=2604%3A3d09%3A8676%3Af900%3A1941%3A44a4%3A3dcb%3A61be&id=o-AFT88B7jlY2-zs7iGG2_RfM6tYN6cFCPI9RZ2AuksYQV&itag=308&source=youtube&requiressl=yes&mh=H_&mm=31%2C29&mn=sn-ni5f-txbd%2Csn-nx57ynss&ms=au%2Crdu&mv=m&mvi=1&pcm2cms=yes&pl=47&initcwndbps=2412500&spc=99c5CVKcaj4nd8QqTi2pyzr_Pfxibug&vprv=1&svpuc=1&mime=video%2Fwebm&gir=yes&clen=299713581&dur=662.499&lmt=1601657714466300&mt=1680261438&fvip=4&keepalive=yes&fexp=24007246&c=ANDROID&txp=5532432&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRAIgNSMUGB-Ger1-90fnQM9Q5oV8coDirBIE-QBltfTx1_gCIBV4qig0VJ6BkhjEQe8vlfyrEmFcyKoNWLXjRcnuI9yY&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpcm2cms%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhAJtfQ7um3JVkUex8-v-lY4E1sBfURjJAh2nqpw7St-veAiAb0x8kGk-KKLfVTbjhx6AlESSIOqa8ZGb_0qEhuONmCQ%3D%3D"
[dashsegments] Total fragments: 29
[download] Destination: G-Sync & Reflex Low Latency - How To Use Both [@Battle(non)sense] [Gub1bI12ODY].f308.webm
[debug] File locking is not supported. Proceeding without locking
[download] 100% of 285.83MiB in 00:00:06 at 44.45MiB/s
[debug] Invoking dashsegments downloader on "https://rr1---sn-ni5f-txbd.googlevideo.com/videoplayback?expire=1680283225&ei=-cEmZOyXOLmJsfIP5YOSgA4&ip=2604%3A3d09%3A8676%3Af900%3A1941%3A44a4%3A3dcb%3A61be&id=o-AFT88B7jlY2-zs7iGG2_RfM6tYN6cFCPI9RZ2AuksYQV&itag=251&source=youtube&requiressl=yes&mh=H_&mm=31%2C29&mn=sn-ni5f-txbd%2Csn-nx57ynss&ms=au%2Crdu&mv=m&mvi=1&pcm2cms=yes&pl=47&initcwndbps=2412500&spc=99c5CVKcaj4nd8QqTi2pyzr_Pfxibug&vprv=1&svpuc=1&mime=audio%2Fwebm&gir=yes&clen=9633389&dur=662.521&lmt=1601656533258954&mt=1680261438&fvip=4&keepalive=yes&fexp=24007246&c=ANDROID&txp=5531432&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRgIhALEcGGTCi0wbFab9obl4tw9fSNBcFHYkiVp5-3iH55TUAiEAhtZgyeB7rHzgb64jfCT_JbzY5r1ZsLyU3DeuQV-3akY%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpcm2cms%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhAJtfQ7um3JVkUex8-v-lY4E1sBfURjJAh2nqpw7St-veAiAb0x8kGk-KKLfVTbjhx6AlESSIOqa8ZGb_0qEhuONmCQ%3D%3D"
[dashsegments] Total fragments: 1
[download] Destination: G-Sync & Reflex Low Latency - How To Use Both [@Battle(non)sense] [Gub1bI12ODY].f251.webm
[download] 100% of 9.19MiB in 00:00:00 at 22.51MiB/s
[Merger] Merging formats into "G-Sync & Reflex Low Latency - How To Use Both [@Battle(non)sense] [Gub1bI12ODY].mkv"
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:G-Sync & Reflex Low Latency - How To Use Both [@Battle(non)sense] [Gub1bI12ODY].f308.webm" -i "file:G-Sync & Reflex Low Latency - How To Use Both [@Battle(non)sense] [Gub1bI12ODY].f251.webm" -c copy -map "0:v:0" -map "1:a:0" -movflags "+faststart" "file:G-Sync & Reflex Low Latency - How To Use Both [@Battle(non)sense] [Gub1bI12ODY].temp.mkv"
Deleting original file G-Sync & Reflex Low Latency - How To Use Both [@Battle(non)sense] [Gub1bI12ODY].f308.webm (pass -k to keep)
Deleting original file G-Sync & Reflex Low Latency - How To Use Both [@Battle(non)sense] [Gub1bI12ODY].f251.webm (pass -k to keep)
[debug] ffprobe command line: ffprobe -hide_banner -show_format -show_streams -print_format json "file:G-Sync & Reflex Low Latency - How To Use Both [@Battle(non)sense] [Gub1bI12ODY].mkv"
[EmbedThumbnail] ffmpeg: Adding thumbnail to "G-Sync & Reflex Low Latency - How To Use Both [@Battle(non)sense] [Gub1bI12ODY].mkv"
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:G-Sync & Reflex Low Latency - How To Use Both [@Battle(non)sense] [Gub1bI12ODY].mkv" -map 0 -dn -ignore_unknown -c copy -attach "G-Sync & Reflex Low Latency - How To Use Both [@Battle(non)sense] [Gub1bI12ODY].webp" "-metadata:s:2" "mimetype=image/webp" "-metadata:s:2" "filename=cover.webp" -movflags "+faststart" "file:G-Sync & Reflex Low Latency - How To Use Both [@Battle(non)sense] [Gub1bI12ODY].temp.mkv"
Hope I've listed everything relevant and proper. Please let me know if there's anything else I can provide.
Provide verbose output that clearly demonstrates the problem
- Run your yt-dlp command with -vU flag added (
yt-dlp -vU <your command line>
) - If using API, add
'verbose': True
toYoutubeDL
params instead - Copy the WHOLE output (starting with
[debug] Command-line config
) and insert it below
Complete Verbose Output
[debug] Command-line config: ['--verbose', '--force-overwrites', '--no-continue', '--embed-thumbnail', '--format', 'bv*[height<=1440]+ba*/b', '--merge-output-format', 'mkv', '--output', '%(title)s [@%(uploader)s] [%(id)s].%(ext)s', 'https://www.youtube.com/watch?v=Gub1bI12ODY']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out cp1252 (No ANSI), error cp1252 (No ANSI), screen cp1252 (No ANSI)
[debug] yt-dlp version stable@2023.03.04 [392389b7d] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.19045-SP0 (OpenSSL 1.1.1k 25 Mar 2021)
[debug] exe versions: ffmpeg 5.1.2-full_build-www.gyan.dev (setts), ffprobe 5.1.2-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.17, brotli-1.0.9, certifi-2022.12.07, mutagen-1.46.0, sqlite3-2.6.0, websockets-10.4
[debug] Proxy map: {}
[debug] Loaded 1786 extractors
[youtube] Extracting URL: https://www.youtube.com/watch?v=Gub1bI12ODY
[youtube] Gub1bI12ODY: Downloading webpage
[youtube] Gub1bI12ODY: Downloading android player API JSON
[debug] Loading youtube-nsig.fa7eb95c from cache
[debug] [youtube] Decrypted nsig HFgm-ZZtfgs8C-2Re1 => nzVUJvff1cqMuA
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[info] Gub1bI12ODY: Downloading 1 format(s): 308
[info] Downloading video thumbnail 41 ...
[info] Writing video thumbnail 41 to: G-Sync & Reflex Low Latency - How To Use Both [@Battle(non)sense] [Gub1bI12ODY].webp
Deleting existing file G-Sync & Reflex Low Latency - How To Use Both [@Battle(non)sense] [Gub1bI12ODY].webm
[debug] Invoking dashsegments downloader on "https://rr1---sn-ni5f-txbd.googlevideo.com/videoplayback?expire=1680283201&ei=4cEmZK3YLcGUkwa5mZqwBw&ip=2604%3A3d09%3A8676%3Af900%3A1941%3A44a4%3A3dcb%3A61be&id=o-AATE1GWuKNc1jn6_BlGZXPRfHI9pxyb-dmnatEmXXoxJ&itag=308&source=youtube&requiressl=yes&mh=H_&mm=31%2C29&mn=sn-ni5f-txbd%2Csn-nx57ynss&ms=au%2Crdu&mv=m&mvi=1&pl=47&initcwndbps=2412500&spc=99c5CQHF5wMXR3jPTNk3vkuycRiJfAI&vprv=1&svpuc=1&mime=video%2Fwebm&gir=yes&clen=299713581&dur=662.499&lmt=1601657714466300&mt=1680261438&fvip=4&keepalive=yes&fexp=24007246&c=ANDROID&txp=5532432&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRAIgV_X44zP4reVHAGsimIcHFsgtlVDPGnDXCQjuwijQd54CIG6dNbiyYHikahAlLFFqy4Y3WidOPlXPpJc98FeXjH1c&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhANrJvtpf-4NMafPYRSkI8AB0zQAqfH1AyUxIRkFGSGQNAiAK_q7hg-sbBx29U8vNtfODRXH0KwRu8XhjrcM0CDh_vQ%3D%3D"
[dashsegments] Total fragments: 29
[download] Destination: G-Sync & Reflex Low Latency - How To Use Both [@Battle(non)sense] [Gub1bI12ODY].webm
[debug] File locking is not supported. Proceeding without locking
[download] 100% of 285.83MiB in 00:00:07 at 37.02MiB/s
[ThumbnailsConvertor] Converting thumbnail "G-Sync & Reflex Low Latency - How To Use Both [@Battle(non)sense] [Gub1bI12ODY].webp" to png
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -f image2 -pattern_type none -i "file:G-Sync & Reflex Low Latency - How To Use Both [@Battle(non)sense] [Gub1bI12ODY].webp" -update 1 -movflags "+faststart" "file:G-Sync & Reflex Low Latency - How To Use Both [@Battle(non)sense] [Gub1bI12ODY].png"
ERROR: Postprocessing: Supported filetypes for thumbnail embedding are: mp3, mkv/mka, ogg/opus/flac, m4a/mp4/mov
Traceback (most recent call last):
File "yt_dlp\YoutubeDL.py", line 3323, in process_info
File "yt_dlp\YoutubeDL.py", line 3502, in post_process
File "yt_dlp\YoutubeDL.py", line 3484, in run_all_pps
File "yt_dlp\YoutubeDL.py", line 3462, in run_pp
File "yt_dlp\postprocessor\common.py", line 24, in run
File "yt_dlp\postprocessor\common.py", line 129, in wrapper
File "yt_dlp\postprocessor\embedthumbnail.py", line 216, in run
yt_dlp.postprocessor.embedthumbnail.EmbedThumbnailPPError: Supported filetypes for thumbnail embedding are: mp3, mkv/mka, ogg/opus/flac, m4a/mp4/mov