Why do videos on media players like VLC or some website players suddenly start glitching, making fragments of the video different colors or not refresh parts of the frame at the same time as the rest of them when skipping ahead or back a few seconds?

447 views

Why do videos on media players like VLC or some website players suddenly start glitching, making fragments of the video different colors or not refresh parts of the frame at the same time as the rest of them when skipping ahead or back a few seconds?

In: Other

4 Answers

Anonymous 0 Comments

Usually this is due to how video is optimized for space and bandwidth. A lot of video runs at around 24 frames per second. If you’ve ever taken a full screenshot of a desktop, it can be around a megabyte or two.

Imagine if you wanted to capture a video of your mouse cursor moving around on your desktop for about 10 seconds, and you wanted it to look smooth so you took 24 full screenshots every single second for 10 seconds. At the end, you have 240 screenshots that are each maybe 2 megabytes in size, so you could create a video of your desktop that was 10 seconds long, consisting of 240 screenshots (frames) and is 480 megabytes in size.

Now imagine doing that for a movie that is 2 hours long (7200 seconds * 2 megabytes = roughly 14.4 gigabytes). And that’s JUST the video – no audio! Add in surround sound audio and you might have another 15 gigabytes or so, making your movie a whopping 30 gigabytes.

Even with high speed internet, 30 gigabytes of data is a lot to download just for a 2 hour movie.

Now if you think about your 10-second video of your desktop, most of it isn’t moving. In fact, there’s probably only a tiny portion of each frame that actually IS changing (the part with your moving cursor).

So someone said, “Hey, what if we didn’t include the FULL screenshot on every single frame? Instead, we’ll just take a full 2-megabyte screenshot every 20 or 30 frames, and then the next 20 or so frames can be just the part of the picture that CHANGES from one frame to the next, and we’ll overlay each of those frames on top of the full screenshot! And we can compress each individual frame to make it even smaller!”

So now your 10-second video has only 10 full screenshots taking up a total of 20 megabytes and then 230 tiny changes-only screenshots that might be 20k a piece, so you end up with a video that almost looks perfectly like the original but it’s only 25 megabytes instead of 480 megabytes!

Those full screenshots are called “key frames.” When you see the glitches when rewinding/seeking to a part of the video, you’re usually ending up in the middle of the regular, changes-only compressed frames. If you don’t have a recent, usable key frame, the system can have a hard time figuring out what that part of the screen should look like. The result can be a glitchy-looking part of the screen until the video hits the next key frame and resets everything on the screen back exactly to where it should be.

You are viewing 1 out of 4 answers, click here to view all answers.