Open p3nguinmeme opened 1 year ago
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...
mjpeg2jpeg
bitstream filter with the -bsf:v
option to fix the JPG encoding.image2
demuxer is implicitly used to get the image data from the input file.image2
to look for an image sequence by default when its output is connected to the mjpeg2jpeg
codec.-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.
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])
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
>>>
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.
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.
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
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.
If you can still run the problem version of ffmpeg, it would be very helpful to run this test.
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.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
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%
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 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.
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
.
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.
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'])
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)
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'
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.
Also, embedding in MKV ought to be supported.
synopsis=
is forcing an empty description but from the yt-dlp code I have no idea how it came to be there (would becomment=
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 setfaststart
and don't reset any othermovflags
, 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
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.
Checklist
Verbose log
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