system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Why does it take youtube a long time to load a video when going frame by frame [using , or . ] but not when playing the video normally?

You would think that a video would take longer to load than an individual frame but it's the oposite on youtube.
gpt
Inefficient web-based code. It seeks back to the last keyframe and decodes the preceding group of pictures until the required frame.

Video compression works by saving differences between frames. At certain intervals there are independent pictures (keyframes), usually at scene changes. But in case of YouTube this interval is fixed to 5 seconds. Direct seeking is only possible to keyframes. You can see that frame-stepping is faster at the start of a video and at certain points.

A normal video player will maintain the current state and is able to seek forward quickly. Seeking backwards is almost always slow, unless the required frame has been cached in memory.

You can have more responsive control over video playback if you download it with YouTube-DL and use a native media player. Holding the frame-step key in MPC-HC or SMPlayer plays back at full speed on a low-power PC.