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

--download-sections/--sponsorblock-remove does not cut at exact point #4216

Closed
6 tasks done
Lesmiscore opened this issue Jun 28, 2022 · 1 comment
Closed
6 tasks done
Labels
question Question

Comments

@Lesmiscore
Copy link
Contributor

Lesmiscore commented Jun 28, 2022

Checklist

  • I'm reporting a bug unrelated to a specific site
  • I've verified that I'm running yt-dlp commit 962ffcf
  • 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 the bugtracker for similar issues including closed ones. DO NOT post duplicates
  • I've read the guidelines for opening an issue

Description

--download-sections doesn't cut the video at exact point, specified by --download-sections.
The video (https://www.youtube.com/watch?v=3LkcDrcoJ80) has the opening for the first 2 seconds, and I was trying to trim it off.

Resulting file here: https://cdn.discordapp.com/attachments/807247901981016094/991331113693884476/3-4_KGH-439_3LkcDrcoJ80.opus
You can hear the opening part, which has lower volume than the following part.

Verbose log

[debug] Command-line config: ['-vx', '-S', 'proto:https', '--force-overwrite', '--download-section', '*2-3:00', 'https://www.youtube.com/watch?v=3LkcDrcoJ80']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8 (No ANSI), error utf-8 (No ANSI), screen utf-8 (No ANSI)
[debug] yt-dlp version 2022.06.22.1 [a86e01e74] (source)
[debug] Lazy loading extractors is disabled
[debug] Plugins: ['SamplePluginIE', 'SamplePluginPP']
[debug] Git HEAD: 962ffcf89
[debug] Python version 3.10.4 (CPython 64bit) - Linux-5.15.0-39-generic-x86_64-with-glibc2.35
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: ffprobe -bsfs
[debug] exe versions: ffmpeg 4.4.2 (setts), ffprobe 4.4.2, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.11.0, brotli-1.0.9, certifi-2020.06.20, mutagen-1.45.1, pyxattr-0.7.2, secretstorage-3.3.1, sqlite3-2.6.0, websockets-9.1
[debug] Proxy map: {}
[debug] [youtube] Extracting URL: https://www.youtube.com/watch?v=3LkcDrcoJ80
[youtube] 3LkcDrcoJ80: Downloading webpage
[youtube] 3LkcDrcoJ80: Downloading android player API JSON
[youtube] 3LkcDrcoJ80: Downloading MPD manifest
[youtube] 3LkcDrcoJ80: Downloading MPD manifest
[debug] Sort order given by user: proto:https
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, codec:vp9.2, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, proto:https(10), quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), acodec, lang, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[info] 3LkcDrcoJ80: Downloading 1 format(s): 251
[info] 3LkcDrcoJ80: Downloading 1 time ranges: 2-180
[debug] Invoking ffmpeg downloader on "https://rr2---sn-nvoxu-ioqk.googlevideo.com/videoplayback?expire=1656443554&ei=Qv66YqiiIZuukwaYuqeIDw&ip=118.238.237.85&id=o-ALPFSQeoNwjjYM7DU5K6C-UXa-1ZMNY7sOhtZF1J5K0m&itag=251&source=youtube&requiressl=yes&mh=Fw&mm=31%2C29&mn=sn-nvoxu-ioqk%2Csn-ogul7n7z&ms=au%2Crdu&mv=m&mvi=2&pl=18&initcwndbps=1630000&vprv=1&mime=audio%2Fwebm&gir=yes&clen=3334971&otfp=1&dur=168.101&lmt=1618799987683435&mt=1656421529&fvip=4&keepalive=yes&fexp=24001373%2C24007246&beids=24239132&c=ANDROID&txp=6211222&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cotfp%2Cdur%2Clmt&sig=AOq0QJ8wRgIhANEoPUeAYN-z48hr2dpIOUGEpdOfN1yaWOT1-6UbFBnRAiEAyYe5BMh8r6BrgEfUUMlJonOSwu7m9I0vHs1e-vO1EJs%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgfFSj0vL9l0wGdEtH-gpyE9e9nXYIS9lY_f1tj7vO8_ICIQDqYhYNNx9YAbSKQPyEvjAW9MKh_0Lj4QDC97MnzP31yw%3D%3D"
[download] Destination: 【3-4年生用】小さな世界(ディズニーランドより)【小学生のための器楽合奏 全体演奏】ロケットミュージック KGH-439 [3LkcDrcoJ80].webm
[debug] ffmpeg command line: ffmpeg -y -loglevel verbose -headers 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.106 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Sec-Fetch-Mode: navigate
' -ss 2.0 -t 166.0 -i 'https://rr2---sn-nvoxu-ioqk.googlevideo.com/videoplayback?expire=1656443554&ei=Qv66YqiiIZuukwaYuqeIDw&ip=118.238.237.85&id=o-ALPFSQeoNwjjYM7DU5K6C-UXa-1ZMNY7sOhtZF1J5K0m&itag=251&source=youtube&requiressl=yes&mh=Fw&mm=31%2C29&mn=sn-nvoxu-ioqk%2Csn-ogul7n7z&ms=au%2Crdu&mv=m&mvi=2&pl=18&initcwndbps=1630000&vprv=1&mime=audio%2Fwebm&gir=yes&clen=3334971&otfp=1&dur=168.101&lmt=1618799987683435&mt=1656421529&fvip=4&keepalive=yes&fexp=24001373%2C24007246&beids=24239132&c=ANDROID&txp=6211222&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cotfp%2Cdur%2Clmt&sig=AOq0QJ8wRgIhANEoPUeAYN-z48hr2dpIOUGEpdOfN1yaWOT1-6UbFBnRAiEAyYe5BMh8r6BrgEfUUMlJonOSwu7m9I0vHs1e-vO1EJs%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgfFSj0vL9l0wGdEtH-gpyE9e9nXYIS9lY_f1tj7vO8_ICIQDqYhYNNx9YAbSKQPyEvjAW9MKh_0Lj4QDC97MnzP31yw%3D%3D' -c copy -f webm 'file:【3-4年生用】小さな世界(ディズニーランドより)【小学生のための器楽合奏 全体演奏】ロケットミュージック KGH-439 [3LkcDrcoJ80].webm.part'
ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
  configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --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-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --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 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
[tcp @ 0x5602b5961600] Starting connection attempt to 210.139.253.13 port 443
[tcp @ 0x5602b5961600] Successfully connected to 210.139.253.13 port 443
Input #0, matroska,webm, from 'https://rr2---sn-nvoxu-ioqk.googlevideo.com/videoplayback?expire=1656443554&ei=Qv66YqiiIZuukwaYuqeIDw&ip=118.238.237.85&id=o-ALPFSQeoNwjjYM7DU5K6C-UXa-1ZMNY7sOhtZF1J5K0m&itag=251&source=youtube&requiressl=yes&mh=Fw&mm=31%2C29&mn=sn-nvoxu-ioqk%2Csn-ogul7n7z&ms=au%2Crdu&mv=m&mvi=2&pl=18&initcwndbps=1630000&vprv=1&mime=audio%2Fwebm&gir=yes&clen=3334971&otfp=1&dur=168.101&lmt=1618799987683435&mt=1656421529&fvip=4&keepalive=yes&fexp=24001373%2C24007246&beids=24239132&c=ANDROID&txp=6211222&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cotfp%2Cdur%2Clmt&sig=AOq0QJ8wRgIhANEoPUeAYN-z48hr2dpIOUGEpdOfN1yaWOT1-6UbFBnRAiEAyYe5BMh8r6BrgEfUUMlJonOSwu7m9I0vHs1e-vO1EJs%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgfFSj0vL9l0wGdEtH-gpyE9e9nXYIS9lY_f1tj7vO8_ICIQDqYhYNNx9YAbSKQPyEvjAW9MKh_0Lj4QDC97MnzP31yw%3D%3D':
  Metadata:
    encoder         : google/video-file
  Duration: 00:02:48.10, start: -0.007000, bitrate: 158 kb/s
  Stream #0:0(jpn): Audio: opus, 48000 Hz, stereo, fltp, delay 312 (default)
Output #0, webm, to 'file:【3-4年生用】小さな世界(ディズニーランドより)【小学生のための器楽合奏 全体演奏】ロケットミュージック KGH-439 [3LkcDrcoJ80].webm.part':
  Metadata:
    encoder         : Lavf58.76.100
  Stream #0:0(jpn): Audio: opus, 48000 Hz, stereo, fltp, delay 312 (default)
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
size=       0kB time=-00:00:01.97 bitrate=N/A speed=N/A    
size=     256kB time=00:00:27.26 bitrate=  76.9kbits/s speed=48.8x    
size=    1280kB time=00:01:05.38 bitrate= 160.4kbits/s speed=61.2x    
size=    2048kB time=00:01:47.84 bitrate= 155.6kbits/s speed=68.6x    
size=    2816kB time=00:02:32.62 bitrate= 151.2kbits/s speed=73.2x    
size=    3072kB time=00:02:44.90 bitrate= 152.6kbits/s speed=63.6x    
No more output streams to write to, finishing.
size=    3258kB time=00:02:45.98 bitrate= 160.8kbits/s speed=63.9x    
video:0kB audio:3199kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.840931%
Input file #0 (https://rr2---sn-nvoxu-ioqk.googlevideo.com/videoplayback?expire=1656443554&ei=Qv66YqiiIZuukwaYuqeIDw&ip=118.238.237.85&id=o-ALPFSQeoNwjjYM7DU5K6C-UXa-1ZMNY7sOhtZF1J5K0m&itag=251&source=youtube&requiressl=yes&mh=Fw&mm=31%2C29&mn=sn-nvoxu-ioqk%2Csn-ogul7n7z&ms=au%2Crdu&mv=m&mvi=2&pl=18&initcwndbps=1630000&vprv=1&mime=audio%2Fwebm&gir=yes&clen=3334971&otfp=1&dur=168.101&lmt=1618799987683435&mt=1656421529&fvip=4&keepalive=yes&fexp=24001373%2C24007246&beids=24239132&c=ANDROID&txp=6211222&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cotfp%2Cdur%2Clmt&sig=AOq0QJ8wRgIhANEoPUeAYN-z48hr2dpIOUGEpdOfN1yaWOT1-6UbFBnRAiEAyYe5BMh8r6BrgEfUUMlJonOSwu7m9I0vHs1e-vO1EJs%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgfFSj0vL9l0wGdEtH-gpyE9e9nXYIS9lY_f1tj7vO8_ICIQDqYhYNNx9YAbSKQPyEvjAW9MKh_0Lj4QDC97MnzP31yw%3D%3D):
  Input stream #0:0 (audio): 8400 packets read (3275411 bytes); 
  Total: 8400 packets (3275411 bytes) demuxed
Output file #0 (file:【3-4年生用】小さな世界(ディズニーランドより)【小学生のための器楽合奏 全体演奏】ロケットミュージック KGH-439 [3LkcDrcoJ80].webm.part):
  Output stream #0:0 (audio): 8399 packets muxed (3275408 bytes); 
  Total: 8399 packets (3275408 bytes) muxed
[AVIOContext @ 0x5602b5c3b880] Statistics: 2 seeks, 14 writeouts
[AVIOContext @ 0x5602b5c38b40] Statistics: 3334971 bytes read, 0 seeks

[ffmpeg] Downloaded 3335706 bytes

[download] 100% of 3.18MiB in 00:03
[debug] ffmpeg command line: ffprobe -show_streams 'file:【3-4年生用】小さな世界(ディズニーランドより)【小学生のための器楽合奏 全体演奏】ロケットミュージック KGH-439 [3LkcDrcoJ80].webm'
[ExtractAudio] Destination: 【3-4年生用】小さな世界(ディズニーランドより)【小学生のための器楽合奏 全体演奏】ロケットミュージック KGH-439 [3LkcDrcoJ80].opus
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:【3-4年生用】小さな世界(ディズニーランドより)【小学生のための器楽合奏 全体演奏】ロケットミュージック KGH-439 [3LkcDrcoJ80].webm' -vn -acodec copy -movflags +faststart 'file:【3-4年生用】小さな世界(ディズニーランドより)【小学生のための器楽合奏 全体演奏】ロケットミュージック KGH-439 [3LkcDrcoJ80].opus'
Deleting original file 【3-4年生用】小さな世界(ディズニーランドより)【小学生のための器楽合奏 全体演奏】ロケットミュージック KGH-439 [3LkcDrcoJ80].webm (pass -k to keep)
@Lesmiscore Lesmiscore added bug Bug that is not site-specific triage Untriaged issue labels Jun 28, 2022
@pukkandan
Copy link
Member

Video files cannot be cut at exact timestamps without re-encoding. --download-sections do not re-encode by default. To make it do so, use --force-keyframes-at-cuts

@pukkandan pukkandan added question Question and removed bug Bug that is not site-specific triage Untriaged issue labels Jun 28, 2022
@pukkandan pukkandan changed the title --download-sections does not cut at exact point --download-sections/--sponsorblock-remove does not cut at exact point Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question
Projects
None yet
Development

No branches or pull requests

2 participants