I don't know how YouTube does it in practice, but you could either
- make the chunks small enough that they are essentially static images (one or a few frames)
- use some form of dynamic chunking where a chunk lasts until the image is sufficiently different according to some metric.
In both cases the chunks are fairly resistent to changes in speed, and the worst you need to deal with is that multiple chunks in clip A may map to the same chunk in clip B.