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

Videos with only dots cause an FFMPEG-related abort #9970

Open
10 tasks done
AshleighTheCutie opened this issue May 19, 2024 · 10 comments
Open
10 tasks done

Videos with only dots cause an FFMPEG-related abort #9970

AshleighTheCutie opened this issue May 19, 2024 · 10 comments
Labels
bug Bug that is not site-specific

Comments

@AshleighTheCutie
Copy link

AshleighTheCutie commented May 19, 2024

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

Provide a description that is worded well enough to be understood

If a video is only named as a single dot (or multiple) it will give a error when it attempts to merge the files with FFMPEG.

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 to YoutubeDL params instead
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

ashleigh@SmolLinuxBox:~$ yt-dlp -vU --embed-metadata --parse-metadata "description:(?s)(?P<meta_comment>.+)" --write-comments --write-subs --write-thumbnail -o "/mnt/SecondaryDisk1/%(title)s.%(ext)s" https://youtu.be/VZRjWrlJ_1w
[debug] Command-line config: ['-vU', '--embed-metadata', '--parse-metadata', 'description:(?s)(?P<meta_comment>.+)', '--write-comments', '--write-subs', '--write-thumbnail', '-o', '/mnt/SecondaryDisk1/%(title)s.%(ext)s', 'https://youtu.be/VZRjWrlJ_1w']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version nightly@2024.05.18.232655 from yt-dlp/yt-dlp-nightly-builds (linux_aarch64_exe)
[debug] Python 3.8.0 (CPython aarch64 64bit) - Linux-6.8.0-meson64-aarch64-with-glibc2.17 (OpenSSL 1.1.1  11 Sep 2018, glibc 2.36)
[debug] exe versions: ffmpeg 5.1.4-0 (setts), ffprobe 5.1.4-0
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.02.02, mutagen-1.47.0, requests-2.31.0, secretstorage-3.3.3, sqlite3-3.22.0, urllib3-2.2.1, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1803 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-nightly-builds/releases/latest
Latest version: nightly@2024.05.18.232655 from yt-dlp/yt-dlp-nightly-builds
yt-dlp is up to date (nightly@2024.05.18.232655 from yt-dlp/yt-dlp-nightly-builds)
[youtube] Extracting URL: https://youtu.be/VZRjWrlJ_1w
[youtube] VZRjWrlJ_1w: Downloading webpage
[youtube] VZRjWrlJ_1w: Downloading ios player API JSON
[debug] Loading youtube-nsig.b05eda73 from cache
[debug] [youtube] Decrypted nsig J5ho6CO3sQ2gwq3RS4yS => oxTZl8jbjcBlHg
[debug] Loading youtube-nsig.b05eda73 from cache
[debug] [youtube] Decrypted nsig _tiyapyf-yazsjrxpW6t => Wlnv5ydP4qZ8LA
[youtube] VZRjWrlJ_1w: Downloading m3u8 information
[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, size, br, asr, vext, aext, hasaud, id
[debug] Searching for '(?s)(?P<meta_comment>.+)' in '%(description)s'
[MetadataParser] Could not interpret 'description' as '(?s)(?P<meta_comment>.+)'
[youtube] Downloading comment section API JSON
[youtube] Downloading ~0 comments
[youtube] Sorting comments by newest first
[youtube] Downloading comment API JSON page 1 (0/~0)
[youtube] Extracted 0 comments
[debug] Default format spec: bestvideo*+bestaudio/best
[info] VZRjWrlJ_1w: Downloading 1 format(s): 18
[info] There are no subtitles for the requested languages
[info] Downloading video thumbnail 42 ...
[info] Video Thumbnail 42 does not exist
[info] Downloading video thumbnail 41 ...
[info] Video Thumbnail 41 does not exist
[info] Downloading video thumbnail 40 ...
[info] Video Thumbnail 40 does not exist
[info] Downloading video thumbnail 39 ...
[info] Video Thumbnail 39 does not exist
[info] Downloading video thumbnail 38 ...
[info] Video Thumbnail 38 does not exist
[info] Downloading video thumbnail 37 ...
[info] Video Thumbnail 37 does not exist
[info] Downloading video thumbnail 36 ...
[info] Writing video thumbnail 36 to: /mnt/SecondaryDisk1/..mp4.webp
[info] Writing video metadata as JSON to: /mnt/SecondaryDisk1/..mp4.info.json
[debug] Invoking http downloader on "https://rr1---sn-5ualdnle.googlevideo.com/videoplayback?expire=1716172874&ei=6WNKZpe8NN3g0_wP8suUyAk&ip=71.14.58.63&id=o-AGXXQn7noYoVKXxyh63R01CxgtPyc8gyJebPxwY_Oqcg&itag=18&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&mh=Io&mm=31%2C26&mn=sn-5ualdnle%2Csn-p5qddn7r&ms=au%2Conr&mv=m&mvi=1&pl=20&initcwndbps=1072500&bui=AWRWj2RVYqWlkt-vJapsIZg7F_52OAfBymonb2Ga3_9ynyOpbhwjtHKLxGboqsAM3M4NZZIdf3mj3cr4&spc=UWF9fzu08FgXn2f5uhpsYd2HKQOjz6Tj82IvVnuRmzQQNdysVMmG9NpZUqZU&vprv=1&svpuc=1&mime=video%2Fmp4&ns=7mWyOIwNqFyasENQgWOqUp8Q&rqh=1&gir=yes&clen=257607&ratebypass=yes&dur=16.973&lmt=1700991385284188&mt=1716150780&fvip=1&c=WEB&sefc=1&txp=6219224&n=oxTZl8jbjcBlHg&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&sig=AJfQdSswRgIhAL_x2_7z86NO-VLhWfHwuaXIWuBgroKCK4kd2xevF3pfAiEA_ZauPZFf7aIKhNbL3jm0H9kv6U1ggq25gigfZsL62fg%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHWaYeowRQIhAKzejSJfRd9BpkNpjK-OUOECJwZujgz7YgSQWp6emR4RAiAT0tLZO1XXZdFReMFuO2KhFy6TvtKPywrWq0Cc-w1E6Q%3D%3D"
[download] Destination: /mnt/SecondaryDisk1/..mp4
[download] 100% of  251.57KiB in 00:00:00 at 349.39KiB/s
[Metadata] Adding metadata to "/mnt/SecondaryDisk1/..mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i file:/mnt/SecondaryDisk1/..mp4 -map 0 -dn -ignore_unknown -c copy -write_id3v1 1 -metadata title=. -metadata date=20231126 -metadata 'purl=https://www.youtube.com/watch?v=VZRjWrlJ_1w' -metadata 'comment=https://www.youtube.com/watch?v=VZRjWrlJ_1w' -metadata artist=Siamaru -movflags +faststart file:/mnt/SecondaryDisk1/..mp4.temp
[debug] ffmpeg version 5.1.4-0+deb12u1 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12 (Debian 12.2.0-14)
  configuration: --prefix=/usr --extra-version=0+deb12u1 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-libjxl --enable-pocketsphinx --enable-librsvg --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file:/mnt/SecondaryDisk1/..mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    encoder         : Google
  Duration: 00:00:16.97, start: 0.000000, bitrate: 121 kb/s
  Stream #0:0[0x1](und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 264x200 [SAR 1:1 DAR 33:25], 21 kb/s, 30 fps, 30 tbr, 15360 tbn (default)
    Metadata:
      handler_name    : ISO Media file produced by Google Inc.
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 95 kb/s (default)
    Metadata:
      handler_name    : ISO Media file produced by Google Inc.
      vendor_id       : [0][0][0][0]
[NULL @ 0xaaaaeb9fec00] Unable to find a suitable output format for 'file:/mnt/SecondaryDisk1/..mp4.temp'
file:/mnt/SecondaryDisk1/..mp4.temp: Invalid argument

ERROR: Postprocessing: file:/mnt/SecondaryDisk1/..mp4.temp: Invalid argument
Traceback (most recent call last):
  File "yt_dlp/YoutubeDL.py", line 3537, in process_info
  File "yt_dlp/YoutubeDL.py", line 3719, in post_process
  File "yt_dlp/YoutubeDL.py", line 3701, in run_all_pps
  File "yt_dlp/YoutubeDL.py", line 3679, in run_pp
  File "yt_dlp/postprocessor/common.py", line 23, in run
  File "yt_dlp/postprocessor/common.py", line 128, in wrapper
  File "yt_dlp/postprocessor/ffmpeg.py", line 711, in run
  File "yt_dlp/postprocessor/ffmpeg.py", line 329, in run_ffmpeg_multiple_files
  File "yt_dlp/postprocessor/ffmpeg.py", line 367, in real_run_ffmpeg
yt_dlp.postprocessor.ffmpeg.FFmpegPostProcessorError: file:/mnt/SecondaryDisk1/..mp4.temp: Invalid argument
@AshleighTheCutie AshleighTheCutie added bug Bug that is not site-specific triage Untriaged issue labels May 19, 2024
@AshleighTheCutie
Copy link
Author

Addendum: I did try to look for this, and I didn't see it anywhere else. But I could have missed it as well.

@bashonly bashonly removed the triage Untriaged issue label May 19, 2024
@barsnick
Copy link
Contributor

Reproducible with the somewhat shorter

yt-dlp -vU --embed-metadata -o "./%(title)s.%(ext)s" https://youtu.be/VZRjWrlJ_1w

@AshleighTheCutie
Copy link
Author

FYI, I did check the "read the guidelines for opening an issue" when I first posted this, but it seems to have unchecked itself and I can't recheck it.

@dirkf
Copy link
Contributor

dirkf commented May 24, 2024

The creator of this video has given it the title .. OP's template puts the title next to extension-separating ., which breaks some file-type parsing code in the relevant ffmpeg (and probably others). At a guess this is because the destination of the metadata embedding has a filename with a leading . which Python doesn't consider an extension separator; thus:

$ python3
Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os.path
>>> os.path.splitext('..mp4')
('..mp4', '')
>>> os.path.splitext('foo..mp4')
('foo.', '.mp4')
>>> 

Then yt-dlp can't tell ffmpeg what sort of thing ..mp4.temp is (a file of empty extension) and ffmpeg gives up with the logged message.

Specifying ffmpeg as downloader with no embedding exhibits the weird filenames but without the crash and can be compared with upstream. yt-dl successfully makes a file _.mkv for the worstvideo+worstaudio format, while the yt-dlp file is ..mp4.mp4 as expected from the log above.

To avoid this (pathological) case, include the ID (as in the default) or just a fixed non-dot character between the title and the .ext in the output template.

PRs #9591, #7954 might take account of this.

@AshleighTheCutie
Copy link
Author

The creator of this video has given it the title .. OP's template puts the title next to extension-separating ., which breaks some file-type parsing code in the relevant ffmpeg (and probably others). At a guess this is because the destination of the metadata embedding has a filename with a leading . which Python doesn't consider an extension separator; thus:

$ python3
Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os.path
>>> os.path.splitext('..mp4')
('..mp4', '')
>>> os.path.splitext('foo..mp4')
('foo.', '.mp4')
>>> 

Then yt-dlp can't tell ffmpeg what sort of thing ..mp4.temp is (a file of empty extension) and ffmpeg gives up with the logged message.

Specifying ffmpeg as downloader with no embedding exhibits the weird filenames but without the crash and can be compared with upstream. yt-dl successfully makes a file _.mkv for the worstvideo+worstaudio format, while the yt-dlp file is ..mp4.mp4 as expected from the log above.

To avoid this (pathological) case, include the ID (as in the default) or just a fixed non-dot character between the title and the .ext in the output template.

PRs #9591, #7954 might take account of this.

Define "pathological" in this context, please.

@dirkf
Copy link
Contributor

dirkf commented May 26, 2024

Being the single title that causes this issue by having an initial . that is also its final . makes it pathological, in the mathematical sense of a weird but valid counter-example. Also, though this is not a matter for the program, it's not a sensible title, is it?

@AshleighTheCutie
Copy link
Author

It's not the only video I regularly archive like this, either.

@dirkf
Copy link
Contributor

dirkf commented May 26, 2024

It would be helpful to identify any other problem videos.

@AshleighTheCutie
Copy link
Author

There's another one on the same channel, actually: https://www.youtube.com/watch?v=w9OdyIXzF6Y

@dirkf
Copy link
Contributor

dirkf commented May 27, 2024

OK, that one has the title ... Logically, any title that is a non-empty sequence of . will provoke the same behaviour with this choice of output template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug that is not site-specific
Projects
None yet
Development

No branches or pull requests

4 participants