Unable to seek through Youtube videos
Opened this issue · 5 comments
This plugin works great and with a variety of sources, however in my case I cannot browse through videos coming from youtube.
The videos/playlist open properly, but if I try to select a specific time in the video, the video freezes and the audio playback starts from the beginning.
Here the relevant output from vlc -vv
:
[00007f55a40fd0a0] mkv demux debug: seek request to 12,85%
[00007f55a40a4f40] packetizer_avparser packetizer debug: CPU flags: 0x000fd3db
[00007f55a44d6240] main tls client debug: resolving r7---sn-a0jpm-a0ml.googlevideo.com ...
[00007f55a44d6240] gnutls tls client debug: TLS handshake: Resource temporarily unavailable, try again.
[00007f55a44d6240] gnutls tls client debug: TLS handshake: Resource temporarily unavailable, try again.
[00007f55a44d6240] gnutls tls client debug: TLS handshake: Success.
[00007f55a40b74f0] http stream debug: outgoing request:
GET /videoplayback?expire=1613679588&ei=hHcuYJ-GD5HB8gP1nrfYDg&ip=83.222.49.36&id=o-AB_KYjcc-1r88ysQaqspazffgX1n7VJTl4_NXpblwQOJ&itag=302&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C299%2C302%2C303&source=youtube&requiressl=yes&mh=ct&mm=31%2C29&mn=sn-a0jpm-a0ml%2Csn-4g5e6nsy&ms=au%2Crdu&mv=m&mvi=7&pl=19&initcwndbps=1340000&vprv=1&mime=video%2Fwebm&ns=RxC6ek8HYhdEh59798o3V0UF&gir=yes&clen=148641049&dur=1567.583&lmt=1582557785406999&mt=1613657612&fvip=5&keepalive=yes&c=WEB&txp=5431432&n=hGI9WJzBtMj8Mf7hp&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIgNg8hjdXxVVBwSUEdrTyJJDiEKhKDX9gI8upVfG1VfscCIQChXKGqCl396KI2fIoLRCQAdLPrNDA9P4_Fp7yROyjHXg%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhANxTX5LupEyQSW9d7WpEuZGZkQPeOvKX2WthAIaIBnFIAiEAuYZ7TnO3CLDEq59ZEBvXvQGwEOkCTJFISqRtnTXhQmw%3D HTTP/1.1
Host: r7---sn-a0jpm-a0ml.googlevideo.com
Accept: */*
Accept-Language: en_US
User-Agent: VLC/3.0.12 LibVLC/3.0.12
If-Unmodified-Since: Mon, 24 Feb 2020 15:23:05 GMT
Range: bytes=20134939-
[00007f55a40b74f0] http stream debug: incoming response:
HTTP/1.1 206 Partial Content
Last-Modified: Mon, 24 Feb 2020 15:23:05 GMT
Content-Type: video/webm
Date: Thu, 18 Feb 2021 14:19:54 GMT
Expires: Thu, 18 Feb 2021 14:19:54 GMT
Cache-Control: private, max-age=21294
Content-Range: bytes 20134939-148641048/148641049
Accept-Ranges: bytes
Content-Length: 128506110
Connection: keep-alive
Alt-Svc: h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Vary: Origin
Cross-Origin-Resource-Policy: cross-origin
X-Restrict-Formats-Hint: None
X-Content-Type-Options: nosniff
Server: gvs 1.0
[00007f55a40fd0a0] mkv demux debug: seek: preroll{ track: 1, pts: 197067000, fpos: 20134951 skip: 20134951}
[00007f55a40fd0a0] mkv demux debug: seek: preroll{ req: 201434415, start-pts: 197067001, start-fpos: 20134951}
[00007f55a40d36f0] mkv demux debug: SET_TIME to 0
[00007f55a40d36f0] mkv demux debug: seek request to i_pos = 0
[00007f55a40d36f0] mkv demux debug: seek: preroll{ track: 1, pts: 0, fpos: 2994 skip: 2994}
[00007f55a40d36f0] mkv demux debug: seek: preroll{ req: 1, start-pts: 1, start-fpos: 2994}
[00007f55b0005e30] main input debug: Buffering 0%
[00007f55b0005e30] main input warning: clock gap, unexpected stream discontinuity
[00007f55b0005e30] main input warning: feeding synchro with a new reference point trying to recover from clock gap
Any idea why this is happening ?
Can someone confirm that they do not experience the same issue ?
I also get this error sometimes when seeking, but not always. It also happens on videos where seeking works properly:
[00007ff6300a31b0] main decoder error: Timestamp conversion failed for 1350001: no reference clock
[00007ff6300a31b0] main decoder error: Could not convert timestamp 0 for FFmpeg
I tried with https://www.youtube.com/watch?v=ZQGGhtguHns
Although I get the same error I can seek the video without any problems.
[00007fe2d057f800] main decoder error: Timestamp conversion failed for 245678768: no reference clock
[00007fe2d057f800] main decoder error: Could not convert timestamp 0 for FFmpeg
Can you provide a link for which the plugin is not working?
I cannot seek on this link either so it must be something related to my setup. The troubling part is that seeking works properly when I disable this extension...
A little while after the above error, I also get the following log:
[00007f63180950a0] main decoder error: buffer deadlock prevented
And then the playback starts over.
I will keep this issue posted and look for more information elsewhere, but if you have any idea where to look at, please share.
Thanks!
Ok, it seems that the issue comes in whenever the 'mkv demux' comes into play. Typically, this should happen whenever youtube-dl selects a MKV source (usually in a webm container).
So first I remembered that my default youtube-dl config was favoring the webm format, commented that and then seeking on your link started working (mp4 source selected by youtube-dl).
But then this video doesn't work https://www.youtube.com/watch?v=erxb_XBhxLc
So I worked around it by adding a format argument to the youtube-dl command, favoring mp4:
--format "bestvideo[ext=mp4][height<=720]+bestaudio[ext=m4a]/bestvideo[height<=720]+bestaudio/best[height<=720]/best"
If this is reproducible by anybody, it could be reasonable to include a more generic version of this. Or investigate why the mkv demux is not working properly.
Regarding this format argument, I wonder if using a separate video/audio stream format in the youtube-dl command impacts VLC's performance or anything at all?