Ask HN: Why does a video rewind on YouTube require a rebuffer?

11 points by osrec ↗ HN
I've noticed that even after I've fully downloaded a video, it appears to rebuffer the entire thing when I replay it. Why is this? Why not just stream it once?

10 comments

[ 3.1 ms ] story [ 36.0 ms ] thread
Just a guess-

The way the video is generated is based on specific points in time.

While going back to that part of the video with it already downloaded would make sense, it might require going back decently far to get all of the pixels.

Because they are explicitly preventing the whole thing from staying in memory to make it more difficult to download/pirate.
That's ridiculous, YouTube videos are trivial to download.
It’s only trivial because so many people put continuous effort into untrivializing it.
I certainly appreciate the work of youtube-dl developers, but (in order to test it out) I was just able to go to the YouTube page, open the network request log on my browser, and pick out the particular URLs (one for video, one for audio) the content is downloaded from, just from the MIME types displayed. Then I was able to replay those requests (using Copy as cURL), removing the range argument, in order to download the video and audio to my machine, in an easily-playable format. (From there, nearly any video conversion software could combine video and audio into one container.)

That's a far cry from having to pick out those segments from the memory of my browser as it runs.

Edit: I may have misread your comment, apologies if I misunderstood.

wat? YT video is just a mp4 file on "someone elses computer "
Google could use HTML storage https://developer.chrome.com/apps/offline_storage, like MEGA does, and temp store played videos. I suspect either nobody bothered because its not as glamorous as inventing more idiotic UI "improvements", or someone ran the numbers and came to the conclusion saved BW is minuscule compared to potential support issues (maintaining code, bugs etc). Not to mention Offline means Google cant sp^track you.

I played with this idea, custom extension rewriting ://.googlevideo.com/videoplayback?* webRequests, redirecting to my local proxy server, but in the end it was more trouble than its worth, instead I just have "download with yt-dl" button right under the videos I intend to watch multiple times/later/offline (https://github.com/raszpl/smplayer4YT).

I personally think the additional bandwidth requirements would be rather large... I still don't get why they wouldn't optimise this (but would, for example, optimise all their icons into a CSS sprite)
It might be encoded in a way that doesn't lend well to seeking.
Maybe downloaded content as an extra metric to track views. Also it is harder to fake thousands of views if you have to download it every time.

Managing cache in my opinion is also complicated. For how long will should it last? Will you delete it on finish/page close? Or will ppl accept watching yt will take a big chunk of space, and disk performance? What if the browser crash? In mobile it would not be possible.