yt-dlp / yt-dlp

A feature-rich command-line audio/video downloader
https://discord.gg/H5MNcFW63r
The Unlicense
81.82k stars 6.38k forks source link

Video distorts after downloading? Weird behaviour. #4500

Closed vada-pav closed 2 years ago

vada-pav commented 2 years ago

Checklist

Please make sure the question is worded well enough to be understood

Recently, i notice that the downloaded video distorts if i try to forward/backward seek. I have created a config file and below are the contents of it.

-o ~/Downloads/Youtube/%(title)s.%(ext)s

-f 'bv[height=1080][ext=mp4]+ba[ext=m4a]' --merge-output-format mp4

-f 'bv+ba/b' --merge-output-format mp4

Any idea if I’m using any setting wrongly? please suggest a better way?

Provide verbose output that clearly demonstrates the problem

Complete Verbose Output

[debug] Command-line config: ['-vU']
[debug] User config "/Users/ssb/.config/yt-dlp/config": ['-o', '~/Downloads/Youtube/%(title)s.%(ext)s', '-f', 'bv+ba/b', '--merge-output-format', 'mp4']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.07.18 [135f05e]
[debug] Python 3.10.5 (CPython 64bit) - macOS-12.5-x86_64-i386-64bit
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: ffprobe -bsfs
[debug] exe versions: ffmpeg 5.1 (setts), ffprobe 5.1
[debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3
[debug] Proxy map: {}
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2022.07.18, Current version: 2022.07.18
yt-dlp is up to date (2022.07.18)
pukkandan commented 2 years ago

The log needs to be of the actual download

vada-pav commented 2 years ago
[debug] Command-line config: ['-vU', 'https://www.youtube.com/watch?v=yT7yK_Vyn8M']
[debug] User config "/Users/ssb/.config/yt-dlp/config": ['-o', '~/Downloads/Youtube/%(title)s.%(ext)s', '-f', 'bv+ba/b', '--merge-output-format', 'mp4']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.07.18 [135f05e]
[debug] Python 3.10.5 (CPython 64bit) - macOS-12.5-x86_64-i386-64bit
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: ffprobe -bsfs
[debug] exe versions: ffmpeg 5.1 (setts), ffprobe 5.1
[debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3
[debug] Proxy map: {}
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2022.07.18, Current version: 2022.07.18
yt-dlp is up to date (2022.07.18)
[debug] [youtube] Extracting URL: https://www.youtube.com/watch?v=yT7yK_Vyn8M
[youtube] yT7yK_Vyn8M: Downloading webpage
[youtube] yT7yK_Vyn8M: Downloading android player API JSON
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, codec:vp9.2, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), acodec, lang, proto, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[info] yT7yK_Vyn8M: Downloading 1 format(s): 248+251
[debug] Invoking http downloader on "https://rr1---sn-b51vo-2o9z.googlevideo.com/videoplayback?expire=1659272233&ei=ySfmYq2XI8q_rQHXtpXgCA&ip=103.229.247.42&id=o-AC1bbBgyw3JZP0W6obHdCCLcoCKQWuU1fs8usJrG4g2K&itag=248&source=youtube&requiressl=yes&mh=6X&mm=31%2C29&mn=sn-b51vo-2o9z%2Csn-cvh76nl6&ms=au%2Crdu&mv=m&mvi=1&pl=24&initcwndbps=820000&vprv=1&mime=video%2Fwebm&gir=yes&clen=75965601&dur=409.542&lmt=1659110217430389&mt=1659249647&fvip=2&keepalive=yes&fexp=24001373%2C24007246&c=ANDROID&rbqsm=fr&txp=6319224&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAOffhjDFVBp9tLimvQ0mF3YZiW9UYk8L_ErKFIRfRsl8AiAfqo2GVmfu1-TL6XSLdQo8ijLq66n2C0elIK0OJye8CA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhAOR9svcMGcon90XG7pIPX_iP1yqKeho5fIIk8G2uRTpkAiBpzD58vcvMetjMpFG5dwFuTZjrelouFKJkqFxf_0ZyPw%3D%3D"
[download] Destination: /Users/ssb/Downloads/Youtube/Modern House in California Layout, Bengaluru _ Home Tour by Architecture + Swath.f248.webm
[download] 100% of 72.45MiB in 00:29
[debug] Invoking http downloader on "https://rr1---sn-b51vo-2o9z.googlevideo.com/videoplayback?expire=1659272233&ei=ySfmYq2XI8q_rQHXtpXgCA&ip=103.229.247.42&id=o-AC1bbBgyw3JZP0W6obHdCCLcoCKQWuU1fs8usJrG4g2K&itag=251&source=youtube&requiressl=yes&mh=6X&mm=31%2C29&mn=sn-b51vo-2o9z%2Csn-cvh76nl6&ms=au%2Crdu&mv=m&mvi=1&pl=24&initcwndbps=820000&vprv=1&mime=audio%2Fwebm&gir=yes&clen=6369645&dur=409.581&lmt=1659110247047473&mt=1659249647&fvip=2&keepalive=yes&fexp=24001373%2C24007246&c=ANDROID&rbqsm=fr&txp=6318224&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAKJOjpr-lxMn0OanpTpYI6tw2wcfcr4ICuUmIkBIdneWAiBcyHEk5CX6CzQCAJcEUz79019XrH1MkdKI0YsxFd66BQ%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhAOR9svcMGcon90XG7pIPX_iP1yqKeho5fIIk8G2uRTpkAiBpzD58vcvMetjMpFG5dwFuTZjrelouFKJkqFxf_0ZyPw%3D%3D"
[download] Destination: /Users/ssb/Downloads/Youtube/Modern House in California Layout, Bengaluru _ Home Tour by Architecture + Swath.f251.webm
[download] 100% of 6.07MiB in 00:02
[Merger] Merging formats into "/Users/ssb/Downloads/Youtube/Modern House in California Layout, Bengaluru _ Home Tour by Architecture + Swath.mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/Users/ssb/Downloads/Youtube/Modern House in California Layout, Bengaluru _ Home Tour by Architecture + Swath.f248.webm' -i 'file:/Users/ssb/Downloads/Youtube/Modern House in California Layout, Bengaluru _ Home Tour by Architecture + Swath.f251.webm' -c copy -map 0:v:0 -map 1:a:0 -movflags +faststart 'file:/Users/ssb/Downloads/Youtube/Modern House in California Layout, Bengaluru _ Home Tour by Architecture + Swath.temp.mp4'
Deleting original file /Users/ssb/Downloads/Youtube/Modern House in California Layout, Bengaluru _ Home Tour by Architecture + Swath.f248.webm (pass -k to keep)
Deleting original file /Users/ssb/Downloads/Youtube/Modern House in California Layout, Bengaluru _ Home Tour by Architecture + Swath.f251.webm (pass -k to keep)
vada-pav commented 2 years ago

My bad. I am new to this and did not know how to interpret the text instructions. Do i need to change anything in order for video to not distort while seeking?

Lesmiscore commented 2 years ago

The video does seek properly (both forward/backward) without any visible errors to me. Try changing player or ffmpeg

image

$ yt-dlp -v -f 248+251 --merge mp4 yT7yK_Vyn8M
[debug] Command-line config: ['-v', '-f', '248+251', '--merge', 'mp4', 'yT7yK_Vyn8M']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.06.29 [9d339c4]
[debug] Python 3.9.13 (CPython 64bit) - Linux-5.15.0-41-generic-x86_64-with-glibc2.35 (glibc 2.35)
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: ffprobe -bsfs
[debug] exe versions: ffmpeg n4.4.1-3-ge16ff82624-20211127 (setts), ffprobe n4.4.1-3-ge16ff82624-20211127, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3
[debug] Proxy map: {}
[debug] [youtube] Extracting URL: yT7yK_Vyn8M
[youtube] yT7yK_Vyn8M: Downloading webpage
[youtube] yT7yK_Vyn8M: Downloading android player API JSON
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, codec:vp9.2, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), acodec, lang, proto, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[info] yT7yK_Vyn8M: Downloading 1 format(s): 248+251
[debug] Invoking http downloader on "https://rr5---sn-nvoxu-ioqk.googlevideo.com/videoplayback?expire=1659272712&ei=qCnmYsWRFYvSkga5_KSoAw&ip=92.202.97.64&id=o-AERqrwc_97iXEbkYCxLC6lmXZgYqmQ8WX0ENaizZ9yAl&itag=248&source=youtube&requiressl=yes&mh=6X&mm=31%2C29&mn=sn-nvoxu-ioqk%2Csn-oguelnze&ms=au%2Crdu&mv=m&mvi=5&pl=18&initcwndbps=1138750&vprv=1&mime=video%2Fwebm&gir=yes&clen=75965601&dur=409.542&lmt=1659110217430389&mt=1659250850&fvip=4&keepalive=yes&fexp=24001373%2C24007246&c=ANDROID&txp=6319224&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIhALDuyY3RYD2-1UH4xB8x5-Dgvpv8pVNCQRxnHvq-qctCAiA136jsI1_N3Zi_LI5-riLUw_W2_Z9PlqilOsvrzeBtfA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhALeGWTy7uFXHS0K2eNDg7cr3W80HDqc3fE2qUZcqDIKfAiEAkhRvqPx43BcAggtgFXajUb6EIMKY5WuZj_24hRCc3Hs%3D"
[download] Destination: Modern House in California Layout, Bengaluru _ Home Tour by Architecture + Swath [yT7yK_Vyn8M].f248.webm
[download] 100% of 72.45MiB in 00:19
[debug] Invoking http downloader on "https://rr5---sn-nvoxu-ioqk.googlevideo.com/videoplayback?expire=1659272712&ei=qCnmYsWRFYvSkga5_KSoAw&ip=92.202.97.64&id=o-AERqrwc_97iXEbkYCxLC6lmXZgYqmQ8WX0ENaizZ9yAl&itag=251&source=youtube&requiressl=yes&mh=6X&mm=31%2C29&mn=sn-nvoxu-ioqk%2Csn-oguelnze&ms=au%2Crdu&mv=m&mvi=5&pl=18&initcwndbps=1138750&vprv=1&mime=audio%2Fwebm&gir=yes&clen=6369645&dur=409.581&lmt=1659110247047473&mt=1659250850&fvip=4&keepalive=yes&fexp=24001373%2C24007246&c=ANDROID&txp=6318224&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAJSYNRPa_uI82H5nMUG1iJrj47DwZZjDNnDKLxeMbBoBAiBu1S3e1skjP2cHRtwFzfgq54Ku0rubx_a2-cCUH3mleA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhALeGWTy7uFXHS0K2eNDg7cr3W80HDqc3fE2qUZcqDIKfAiEAkhRvqPx43BcAggtgFXajUb6EIMKY5WuZj_24hRCc3Hs%3D"
[download] Destination: Modern House in California Layout, Bengaluru _ Home Tour by Architecture + Swath [yT7yK_Vyn8M].f251.webm
[download] 100% of 6.07MiB in 00:01
[Merger] Merging formats into "Modern House in California Layout, Bengaluru _ Home Tour by Architecture + Swath [yT7yK_Vyn8M].mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:Modern House in California Layout, Bengaluru _ Home Tour by Architecture + Swath [yT7yK_Vyn8M].f248.webm' -i 'file:Modern House in California Layout, Bengaluru _ Home Tour by Architecture + Swath [yT7yK_Vyn8M].f251.webm' -c copy -map 0:v:0 -map 1:a:0 -movflags +faststart 'file:Modern House in California Layout, Bengaluru _ Home Tour by Architecture + Swath [yT7yK_Vyn8M].temp.mp4'
Deleting original file Modern House in California Layout, Bengaluru _ Home Tour by Architecture + Swath [yT7yK_Vyn8M].f248.webm (pass -k to keep)
Deleting original file Modern House in California Layout, Bengaluru _ Home Tour by Architecture + Swath [yT7yK_Vyn8M].f251.webm (pass -k to keep)
vada-pav commented 2 years ago

Change ffmpeg? How? I use vlc media player. Could it be because of it? Any recommendations for players on mac?

vada-pav commented 2 years ago

This is the distortion i see. Screenshot 2022-07-31 at 5 06 01 PM

vada-pav commented 2 years ago

Screenshot 2022-07-31 at 5 08 30 PM

More screenshots

pukkandan commented 2 years ago

It is possible your video player cannot properly handle vp9 in mp4. I suggest you try playing in latest version of ffplay/mpv to confirm