Answers.Body: <p>The effect that you've seen is a side effect of the compression algorithm that was used to encode the video.</p>
  
  <p>The most common compression algorithms (MPEG-4 and MPEG-2 among them) compress different frames with different methods, and that is why two very close and relatively similar frames may look so different.</p>
  
  <p>The frame that looks pretty good is likely a <em>keyframe</em>. This is a frame that has all its pixels represented in the encoded stream. The compression introduces some loss of quality, but since the whole image is encoded the result typically looks good.</p>
  
  <p>The image that looks bad is a frame that is not fully represented in the encoded stream. To make videos smaller, for certain parts of the picture the encoder references parts of previous frames that the player/decoder keeps stored in memory, so only the parts that are different are stored for the frame. Because of this these frames end up being a sort of collage. If the bitrate is too low, then you end up with really washed up images like the one you show. But increasing the bitrate enough helps dissimulate this effect, to the point that it is barely or not noticeable. Consider that all the TV that you watch (digital over the air, satellite, FIOS, cable, etc.) is encoded in this way.</p>
  
  <p>For MPEG-2 it is common practice to insert a keyframe in the stream every half a second (15 frames for 29.97fps video, 12 frames for 25fps). For H.264 sometimes they go even longer than half a second.</p>
  
  <p>In general, the image quality of a compressed video is at its highest at the keyframe points, and then slowly starts to degrade, going up again with the next keyframe.</p>
  
  <p>For a more detailed explanation of frame types used in compression algorithms see the Wikipedia article <a href="http://en.wikipedia.org/wiki/Video_compression_picture_types" rel="nofollow">Video compression picture types</a>.</p>
  
  <p>Unfortunately a player cannot improve the quality of the video, since the problem is that the information to reproduce the frame with better quality isn't there. The only ways to address this is by increasing the bitrate when encoding and/or increase the number of keyframes. </p>
  
  <p>On the player side I think the only thing you can do is play the video in a smaller window, so then these artifacts will be less visible.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2012-05-26T06:07:06.630Z
Answers.LastActivityDate: 2012-05-27T16:05:19.197Z
Answers.LastEditDate: 2012-05-27T16:05:19.197Z
Answers.UserDisplayName: Miguel
Body: <p>I notice this on a regular basis while watching videos I've downloaded. The image will alternate pretty quickly between blurry and sharp and sometimes the effect is quite drastic. Below is an example image of a tree and the difference between two frames.</p>
  
  <p><img src="https://i.sstatic.net/peOzz.jpg" alt="Two frames less than a second apart"></p>
  
  <p><strong>What is this effect called and why does it happen</strong>? I'm fairly certain it has to do with compression but what is going on?</p>
  
  <p>If you receive a video like this and there's nothing you can do with how it was rendered or processed, <strong>is there anything you can do after the fact to minimize the effect</strong>? Settings in your video player maybe?</p>
  
  <p>This particular screen shot was taken in Windows Media Player on Windows 7 playing an AVI file. The effect is still visible in VLC and I first noticed this while playing video through my PS3 off a harddrive. I can't say for sure, but I'm fairly certain that it's happened on multiple file types as well.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2012-05-25T08:38:45.350Z
Comments.Text: You could help us work it out if you provide some more information. What player are you using? What quality are the videos you are downloading? What platform are you running these on?
Comments.UserDisplayName: Dr Mayhem
Tags: <video><video-quality>
Title: Why is my video alternating between blurry and sharp?
UserDisplayName: Vian Esterhuizen
ThreadText: # Why is my video alternating between blurry and sharp?
  
  (Asked by: username_0 on 2012-05-24)
  
  I notice this on a regular basis while watching videos I've downloaded. The image will alternate pretty quickly between blurry and sharp and sometimes the effect is quite drastic. Below is an example image of a tree and the difference between two frames.
  
  ![Two frames less than a second apart](https://i.sstatic.net/peOzz.jpg)
  
  **What is this effect called and why does it happen**? I'm fairly certain it has to do with compression but what is going on?
  
  If you receive a video like this and there's nothing you can do with how it was rendered or processed, **is there anything you can do after the fact to minimize the effect**? Settings in your video player maybe?
  
  This particular screen shot was taken in Windows Media Player on Windows 7 playing an AVI file. The effect is still visible in VLC and I first noticed this while playing video through my PS3 off a harddrive. I can't say for sure, but I'm fairly certain that it's happened on multiple file types as well.
  
  **Tags:** video, video-quality
  
  > **Comments:**
  > **username_1**: You could help us work it out if you provide some more information. What player are you using? What quality are the videos you are downloading? What platform are you running these on?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2012-05-26. Score: 5 | Accepted answer
  
  The effect that you've seen is a side effect of the compression algorithm that was used to encode the video.
  
  The most common compression algorithms (MPEG-4 and MPEG-2 among them) compress different frames with different methods, and that is why two very close and relatively similar frames may look so different.
  
  The frame that looks pretty good is likely a *keyframe*. This is a frame that has all its pixels represented in the encoded stream. The compression introduces some loss of quality, but since the whole image is encoded the result typically looks good.
  
  The image that looks bad is a frame that is not fully represented in the encoded stream. To make videos smaller, for certain parts of the picture the encoder references parts of previous frames that the player/decoder keeps stored in memory, so only the parts that are different are stored for the frame. Because of this these frames end up being a sort of collage. If the bitrate is too low, then you end up with really washed up images like the one you show. But increasing the bitrate enough helps dissimulate this effect, to the point that it is barely or not noticeable. Consider that all the TV that you watch (digital over the air, satellite, FIOS, cable, etc.) is encoded in this way.
  
  For MPEG-2 it is common practice to insert a keyframe in the stream every half a second (15 frames for 29.97fps video, 12 frames for 25fps). For H.264 sometimes they go even longer than half a second.
  
  In general, the image quality of a compressed video is at its highest at the keyframe points, and then slowly starts to degrade, going up again with the next keyframe.
  
  For a more detailed explanation of frame types used in compression algorithms see the Wikipedia article [Video compression picture types](http://en.wikipedia.org/wiki/Video_compression_picture_types).
  
  Unfortunately a player cannot improve the quality of the video, since the problem is that the information to reproduce the frame with better quality isn't there. The only ways to address this is by increasing the bitrate when encoding and/or increase the number of keyframes.
  
  On the player side I think the only thing you can do is play the video in a smaller window, so then these artifacts will be less visible.
  
  
  ---
  
  