Hacker News new | ask | show | jobs
by csmpltn 733 days ago
This sounds technically unfeasible, at YouTube's scale.

They'll have to re-encode videos at all permutations across countries, regions and locales. They'll also have to somehow account for ads that have been pulled down after the fact... then they'll need to cache this stuff everywhere so that the latencies are reasonable and the experience is good, whilst serving you different version of the same clip if you refresh or rewatch the clip... they'll have to do all of this continuously, since ads change with the times - despite the clips themselves being stale and static?

I can imagine they will have to limit this "feature" to a very small subset of videos with high view count/interest/revenue potential... maybe just to live feeds... otherwise, the costs to do this for every video on the platform would shoot through the roof.

3 comments

They don't necessarily need to re-encode anything, encoded video has keyframes which don't depend on any prior frames placed at regular intervals to facilitate fast random seeking, and you can splice the video at those points very cheaply without having to re-encode.
> They'll have to re-encode videos at all permutations across countries, regions and locales.

Nope. Just inject them right before a full keyframe, that can be done pretty much on the fly.

Can't they do on-the-fly stream concatenation to avoid re-encoding everything?