Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error embedding thumbnail in opus file #38

Closed
5 of 6 tasks
nicolaasjan opened this issue Jan 28, 2021 · 9 comments
Closed
5 of 6 tasks

Error embedding thumbnail in opus file #38

nicolaasjan opened this issue Jan 28, 2021 · 9 comments

Comments

@nicolaasjan
Copy link

Checklist

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

Verbose log

youtube-dlc -v -x -f bestaudio https://www.youtube.com/watch?v=UsYkLXycbYU
[debug] User config file: /home/nico/.config/yt-dlp/config
[debug] User config: ['--list-formats-as-table', '-i', '-o', '~/Desktop/test-dlc/%(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']
[debug] Command-line config: ['-v', '-x', '-f', 'bestaudio', 'https://www.youtube.com/watch?v=UsYkLXycbYU']
[debug] Loading archive file None
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] yt-dlp version 2021.01.28
[debug] Python version 3.6.9 (CPython) - Linux-5.4.0-64-generic-x86_64-with-LinuxMint-19.3-tricia
[debug] exe versions: ffmpeg N-100550-gfde5593-Nico-20210104, ffprobe N-100550-gfde5593-Nico-20210104
[debug] Proxy map: {}
[youtube] UsYkLXycbYU: Downloading webpage
[youtube] {18} signature length 104, html5 player c6df6ed7
[youtube] {134} signature length 108, html5 player c6df6ed7
[youtube] {243} signature length 108, html5 player c6df6ed7
[youtube] {133} signature length 108, html5 player c6df6ed7
[youtube] {242} signature length 104, html5 player c6df6ed7
[youtube] {160} signature length 104, html5 player c6df6ed7
[youtube] {278} signature length 104, html5 player c6df6ed7
[youtube] {140} signature length 104, html5 player c6df6ed7
[youtube] {249} signature length 108, html5 player c6df6ed7
[youtube] {250} signature length 104, html5 player c6df6ed7
[youtube] {251} signature length 108, html5 player c6df6ed7
[debug] Sort order given by user: 
[debug] Formats sorted by: lang, quality, hasvid, ie_pref, res, fps, vcodec, acodec, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, source, id
[info] Downloading format(s) 251
[youtube] UsYkLXycbYU: Downloading thumbnail ...
[youtube] UsYkLXycbYU: Writing thumbnail to: /home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.jpg
[debug] Invoking downloader on 'https://r5---sn-5hnedn7e.googlevideo.com/videoplayback?expire=1611842618&ei=2m8SYJPiIpejgAfdpafYBA&ip=<REDACTED>&id=o-AP16HbcJcr6Yi884Eiuf6fSwM-cqs9K89i0sPOI5SRNF&itag=251&source=youtube&requiressl=yes&mh=tm&mm=31%2C29&mn=sn-5hnedn7e%2Csn-5hne6n7z&ms=au%2Crdu&mv=m&mvi=5&pl=15&initcwndbps=1888750&vprv=1&mime=audio%2Fwebm&ns=8-s2tyO8sklmy6wOWDhC90cF&gir=yes&clen=2481451&dur=200.841&lmt=1496705555203583&mt=1611820846&fvip=5&keepalive=yes&c=WEB&n=yVfFwJvqLhfzrar-drZ8&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgP1_MpAfupLOak3hlHjUqHvKmDeBDfbUQFy23D9ORlOMCIEiQbnAeobztAtsJ72iLtVht9gXjBmc2O7IEsmUMMJAr&sig=AOq0QJ8wRQIhAOti9tefpJYZ907dFNi_MnA9tLtryKyyMTi7YQmgXSWdAiBD9WcdGqJzj2aw3tcyzrSp5QEGD-16wN44_ArEjtqI-Q==&ratebypass=yes'
[download] Destination: /home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.webm
[download] 100% of 2.37MiB in 00:00
[debug] ffmpeg command line: ffprobe -show_streams 'file:/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.webm'
[ExtractAudio] Destination: /home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.opus
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.webm' -vn -acodec copy 'file:/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.opus'
Deleting original file /home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.webm (pass -k to keep)
[Metadata] Adding metadata to '/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.opus'
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.opus' -map 0 -dn -c copy -metadata 'title=cuby and the blizzards window of my eyes' -metadata date=20081219 -metadata 'description=Great live recording of the legendary song windows of my eyes.
I think the only recording on video of the song with eelco gelling.
Recorded during the "goud van oud" festival 1993 in Den Bosch.' -metadata 'comment=Great live recording of the legendary song windows of my eyes.
I think the only recording on video of the song with eelco gelling.
Recorded during the "goud van oud" festival 1993 in Den Bosch.' -metadata 'purl=https://www.youtube.com/watch?v=UsYkLXycbYU' -metadata artist=boxarnhem 'file:/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.temp.opus'
[EmbedThumbnail] Correcting extension to webp and escaping path for thumbnail "/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.jpg"
[EmbedThumbnail] Converting thumbnail "/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.webp" to JPEG
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.webp' -bsf:v mjpeg2jpeg 'file:/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.jpg'
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.jpg' -hide_banner file:
ERROR: Input #0, image2, from 'file:/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 2135 kb/s
    Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 336x188, 25 fps, 25 tbr, 25 tbn, 25 tbc
[NULL @ 0x55c5be8c5880] Unable to find a suitable output format for 'file:'
file:: Invalid argument
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/bin/youtube-dlc/__main__.py", line 19, in <module>
    youtube_dlc.main()
  File "/usr/local/bin/youtube-dlc/youtube_dlc/__init__.py", line 535, in main
    _real_main(argv)
  File "/usr/local/bin/youtube-dlc/youtube_dlc/__init__.py", line 525, in _real_main
    retcode = ydl.download(all_urls)
  File "/usr/local/bin/youtube-dlc/youtube_dlc/YoutubeDL.py", line 2415, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "/usr/local/bin/youtube-dlc/youtube_dlc/YoutubeDL.py", line 943, in extract_info
    return self.__extract_info(url, ie, download, extra_info, process, info_dict)
  File "/usr/local/bin/youtube-dlc/youtube_dlc/YoutubeDL.py", line 950, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/bin/youtube-dlc/youtube_dlc/YoutubeDL.py", line 987, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/usr/local/bin/youtube-dlc/youtube_dlc/YoutubeDL.py", line 1026, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/usr/local/bin/youtube-dlc/youtube_dlc/YoutubeDL.py", line 1888, in process_video_result
    self.process_info(new_info)
  File "/usr/local/bin/youtube-dlc/youtube_dlc/YoutubeDL.py", line 2384, in process_info
    self.post_process(dl_filename, info_dict, files_to_move)
  File "/usr/local/bin/youtube-dlc/youtube_dlc/YoutubeDL.py", line 2491, in post_process
    files_to_move, info = self.run_pp(pp, info, files_to_move)
  File "/usr/local/bin/youtube-dlc/youtube_dlc/YoutubeDL.py", line 2459, in run_pp
    files_to_delete, infodict = pp.run(infodict)
  File "/usr/local/bin/youtube-dlc/youtube_dlc/postprocessor/embedthumbnail.py", line 158, in run
    size_result = self.run_ffmpeg_multiple_files([thumbnail_filename], '', ['-hide_banner'])
  File "/usr/local/bin/youtube-dlc/youtube_dlc/postprocessor/ffmpeg.py", line 265, in run_ffmpeg_multiple_files
    self.report_error(stderr)
  File "/usr/local/bin/youtube-dlc/youtube_dlc/postprocessor/common.py", line 55, in report_error
    return self._downloader.report_error(text, *args, **kwargs)
  File "/usr/local/bin/youtube-dlc/youtube_dlc/YoutubeDL.py", line 713, in report_error
    self.trouble(error_message, tb)
  File "/usr/local/bin/youtube-dlc/youtube_dlc/YoutubeDL.py", line 675, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())

ERROR: file:: Invalid argument
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dlc/youtube_dlc/YoutubeDL.py", line 2459, in run_pp
    files_to_delete, infodict = pp.run(infodict)
  File "/usr/local/bin/youtube-dlc/youtube_dlc/postprocessor/embedthumbnail.py", line 158, in run
    size_result = self.run_ffmpeg_multiple_files([thumbnail_filename], '', ['-hide_banner'])
  File "/usr/local/bin/youtube-dlc/youtube_dlc/postprocessor/ffmpeg.py", line 266, in run_ffmpeg_multiple_files
    raise FFmpegPostProcessorError(stderr.split('\n')[-1])
youtube_dlc.postprocessor.ffmpeg.FFmpegPostProcessorError: file:: Invalid argument

[SponSkrub] Trying to mark sponsor sections
[debug] sponskrub command line: sponskrub -chapter -- UsYkLXycbYU '/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.opus' '/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.spons.opus'
[SponSkrub] No segments in the SponsorBlock database


Description

When using the current master branch the thumbnail fails to embed...

@pukkandan
Copy link
Member

pukkandan commented Jan 28, 2021

@nicolaasjan Please confirm whether both your issues are solved

@nicolaasjan
Copy link
Author

nicolaasjan commented Jan 28, 2021

@nicolaasjan Please confirm whether both your issues are solved

Unfortunately still the ffmpeg embedding issue (both with my own compiled version and with the official one (https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz)...

[Edit]
Sorry, scratch that.
I forgot to replace the binary in /usr/local/bin. Haha...

It works alright now!:

youtube-dlc -v -x -f bestaudio https://www.youtube.com/watch?v=UsYkLXycbYU
[debug] User config file: /home/nico/.config/yt-dlp/config
[debug] User config: ['--list-formats-as-table', '-i', '-o', '~/Desktop/test-dlc/%(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']
[debug] Command-line config: ['-v', '-x', '-f', 'bestaudio', 'https://www.youtube.com/watch?v=UsYkLXycbYU']
[debug] Loading archive file None
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] yt-dlp version 2021.01.28-1
[debug] Python version 3.6.9 (CPython) - Linux-5.4.0-64-generic-x86_64-with-LinuxMint-19.3-tricia
[debug] exe versions: ffmpeg N-55863-g9f38fac053-static, ffprobe N-55863-g9f38fac053-static
[debug] Proxy map: {}
[youtube] UsYkLXycbYU: Downloading webpage
[youtube] {18} signature length 108, html5 player c6df6ed7
[youtube] {134} signature length 108, html5 player c6df6ed7
[youtube] {243} signature length 104, html5 player c6df6ed7
[youtube] {133} signature length 108, html5 player c6df6ed7
[youtube] {242} signature length 108, html5 player c6df6ed7
[youtube] {160} signature length 108, html5 player c6df6ed7
[youtube] {278} signature length 108, html5 player c6df6ed7
[youtube] {140} signature length 108, html5 player c6df6ed7
[youtube] {249} signature length 104, html5 player c6df6ed7
[youtube] {250} signature length 108, html5 player c6df6ed7
[youtube] {251} signature length 104, html5 player c6df6ed7
[debug] Sort order given by user: 
[debug] Formats sorted by: lang, quality, hasvid, ie_pref, res, fps, vcodec, acodec, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, source, id
[info] Downloading format(s) 251
[youtube] UsYkLXycbYU: Downloading thumbnail ...
[youtube] UsYkLXycbYU: Writing thumbnail to: /home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.jpg
[debug] Invoking downloader on 'https://r5---sn-5hnedn7e.googlevideo.com/videoplayback?expire=1611852451&ei=Q5YSYKiVFvqF6dsP5ZCUkAM&ip=217.121.193.63&id=o-AEq4vfiOxcTYTcpWBUwsztxCX5h3tkvwOC9WQQ2TYBUI&itag=251&source=youtube&requiressl=yes&mh=tm&mm=31%2C29&mn=sn-5hnedn7e%2Csn-5hne6n7z&ms=au%2Crdu&mv=m&mvi=5&pl=15&initcwndbps=1677500&vprv=1&mime=audio%2Fwebm&ns=oC8umpPVbWJK0yne7cfOIHoF&gir=yes&clen=2481451&dur=200.841&lmt=1496705555203583&mt=1611830681&fvip=5&keepalive=yes&c=WEB&n=35dXZq0LoL3aA75jmBrO&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhANQA-umqUtgfjtahyPJJ9geWUjFFGhJU4HhqRXutzCMtAiEAr5NlzMDBHN9DJGu5kXcNWq-Idv52kBPx-KDYLKeQDbs%3D&sig=AOq0QJ8wRAIgWe2PAokUHjVil1ZdhhAGcXoc_6YyUVEul9u0TWNUDEMCIB0es95p91rX7Duwemi0FGHZxdt30G8PwihL21zM9fWb&ratebypass=yes'
[download] Destination: /home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.webm
[download] 100% of 2.37MiB in 00:00
[debug] ffmpeg command line: ffprobe -show_streams 'file:/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.webm'
[ExtractAudio] Destination: /home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.opus
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.webm' -vn -acodec copy 'file:/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.opus'
Deleting original file /home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.webm (pass -k to keep)
[Metadata] Adding metadata to '/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.opus'
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.opus' -map 0 -dn -c copy -metadata 'title=cuby and the blizzards window of my eyes' -metadata date=20081219 -metadata 'description=Great live recording of the legendary song windows of my eyes.
I think the only recording on video of the song with eelco gelling.
Recorded during the "goud van oud" festival 1993 in Den Bosch.' -metadata 'comment=Great live recording of the legendary song windows of my eyes.
I think the only recording on video of the song with eelco gelling.
Recorded during the "goud van oud" festival 1993 in Den Bosch.' -metadata 'purl=https://www.youtube.com/watch?v=UsYkLXycbYU' -metadata artist=boxarnhem 'file:/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.temp.opus'
[EmbedThumbnail] Correcting extension to webp and escaping path for thumbnail "/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.jpg"
[EmbedThumbnail] Converting thumbnail "/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.webp" to JPEG
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.webp' -bsf:v mjpeg2jpeg 'file:/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.jpg'
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.jpg' -hide_banner 'file:/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.jpg'
Deleting original file /home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.jpg (pass -k to keep)
[SponSkrub] Trying to mark sponsor sections
[debug] sponskrub command line: sponskrub -chapter -- UsYkLXycbYU '/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.opus' '/home/nico/Desktop/test-dlc/cuby and the blizzards window of my eyes.spons.opus'
[SponSkrub] No segments in the SponsorBlock database

Schermafdruk op 2021-01-28 11-53-03

@pukkandan
Copy link
Member

pukkandan commented Jan 28, 2021

I think you didn't pull the current master.

https://github.com/pukkandan/yt-dlp/blob/bf330f5f2932f1d13eb57851f307bd7ea7523c8e/youtube_dlc/postprocessor/embedthumbnail.py#L158

The traceback says:

  File "/usr/local/bin/youtube-dlc/youtube_dlc/postprocessor/embedthumbnail.py", line 158, in run
    size_result = self.run_ffmpeg_multiple_files([thumbnail_filename], '', ['-hide_banner'])

@nicolaasjan
Copy link
Author

I think you didn't pull the current master.

https://github.com/pukkandan/yt-dlp/blob/master/youtube_dlc/postprocessor/embedthumbnail.py#L158

The traceback says:

  File "/usr/local/bin/youtube-dlc/youtube_dlc/postprocessor/embedthumbnail.py", line 158, in run
    size_result = self.run_ffmpeg_multiple_files([thumbnail_filename], '', ['-hide_banner'])

Yeah, sorry...
I already edited my comment before I saw your reply.

@pukkandan
Copy link
Member

The anvato issue is also fixed, correct?

@nicolaasjan
Copy link
Author

The anvato issue is also fixed, correct?

Don't know for sure, but I guess is must be solved, otherwise I would have encountered the same ModuleNotFoundError.
Did you find the root cause of that one?

@pukkandan
Copy link
Member

No, for the time being, I put the token import inside a try block. So now the import fails silently. As long as it doesn't show any errors for you, it's fine. The token generation will now only work for some users, but I guess it's better than entirely disabling it like youtube-dl did

@nicolaasjan
Copy link
Author

Maybe it's wise to mention installing mutagen in the installation instructions?

@pukkandan
Copy link
Member

Will update readme when I make release

nswanberg pushed a commit to nswanberg/yt-dlp that referenced this issue Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants