this post was submitted on 18 Oct 2023
730 points (98.4% liked)

Technology

59578 readers
3233 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related content.
  3. Be excellent to each another!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, to ask if your bot can be added please contact us.
  9. Check for duplicates before posting, duplicates may be removed

Approved Bots


founded 1 year ago
MODERATORS
 

YouTube intensifies fight against ad blockers showing pop-ups, and users are frustrated | Blocking ad-block users::undefined

you are viewing a single comment's thread
view the rest of the comments
[โ€“] Aux@lemmy.world 1 points 1 year ago (1 children)

That's not how it works. I don't know exactly what YouTube is doing, but it's not serving files at all. There are several options available today, perhaps the easiest one to look at is HLS.

In short, the streaming server splits video files into small chunks. Then instead of sending you one huge file, it sends you a HLS playlist. Your browser reads the playlist and starts playing small video chunks one by one. If you want to navigate somewhere inside the video, you don't wait for the whole file to be downloaded, instead the browser will simply skip lots of chunks in the middle until it lands on the one you want to watch. That's also how changing video resolution works - the browser doesn't re-download 4K video after downloading 1080p video, it just stops at current chunk and switches to a higher res one for the next portion of the video.

So, few important things:

  • There's no big video file.
  • There's no real-time video processing.
  • Chunks can be of varied time.
  • You can create any playlist and insert whatever chunks you want from your existing chunk library.

This means that YouTube can create a new HLS playlist on the fly, send you 10 chunks of the your video, then send 3 chunks of the ad video, then 42 chunks of your video and 5 more ad video chunks. There's no need to decode/encode anything. And you will never know what the next chunk holds. They can also add ad chunks at random moments, so you won't be able to auto-skip them like you do with sponsor segments.

The real question is why Google is not doing it already.

[โ€“] virtualbriefcase@lemm.ee 1 points 1 year ago

Thanks for the breakdown and the link, cool to learn about the new (well new to me) tech, sad to see it's gonna probably bit us in the butt at somepoint.