Answers.Body: <p>Intra frames (I-frames, keyframes) are <em>independent of other frames</em> - they contain the complete information for reconstructing the frame's image. There is no need for reading other frames and computing from them.</p>
  
  <p>So it's about a <em>speed</em>, not about a quality. On the other hand, more intra frames, grater size of the file. (Known tradeoff speed for space.)</p>
  
  <p>Intra frames are preferably used in most media players for so called <em>fast seek</em> (fast because of skipping the necessity of reading other frames and computing from them) - see for example </p>
  
  <pre><code>View -&gt; Options -&gt; Tweaks -&gt; Fast seek (on keyframe)
  </code></pre>
  
  <p>in Media Player Classic (from <a href="https://www.codecguide.com/" rel="nofollow noreferrer">K-Lite Codec Pack</a>):</p>
  
  <p><a href="https://i.sstatic.net/TgXAh.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/TgXAh.png" alt="enter image description here"></a></p>
  
  <p>Adding more intra frames is important for relatively slow devices (e. g. smartphones) because after jump to non-intra frame <em>they played back ugly colored and broken video</em> while they meet the next intra frame - so for common density of 1 intra frame for 250 frames and the 25 fps the user may wait almost 10 second for restoring the image.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-05T15:29:57.817Z
Answers.Text: Good piece of info. Thanks.
Answers.UserDisplayName: angel_30
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-05T14:53:51.503Z
Answers.LastActivityDate: 2019-06-05T15:07:45.320Z
Answers.LastEditDate: 2019-06-05T15:07:45.320Z
Answers.UserDisplayName: MarianD
Answers.Body: <p>I-frames are uncompressed frames and are what p and b frames reference to for compression. Yes I frames are higher quality. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-12T04:39:41.187Z
Answers.Text: I-frames aren't uncompressed - they simply rely on intra prediction.
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-12T16:24:27.107Z
Answers.Text: Sorry, tried to answer that with out getting too technical. Yes I-frames are compressed to a degree, but to answer your question Tina they are higher is quality when compared to P and B frames.
Answers.UserDisplayName: user23155
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-11T23:45:30.597Z
Answers.LastActivityDate: 2018-09-11T23:45:30.597Z
Answers.UserDisplayName: user23155
Answers.Body: <p>"I, B and P" don't refer to the viewed frames, they refer to the encoded, stored forms of the frames. However the frame is encoded in the file or stream, when it appears on the screen or is extracted as a still it is a complete frame, reconstructed from the IBP information as needed.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-30T00:42:02.450Z
Answers.LastActivityDate: 2018-09-30T00:42:02.450Z
Answers.UserDisplayName: Jim Mack
Body: <p>I'm trying to capture various frames within a x264-encoded video files into <code>png</code> files (in <code>python</code>), and then compare the quality of them:</p>
  
  <pre><code>cap = cv2.VideoCapture(filename);
  //get frame_number for saving, and save the frame
  cap.set(cv2.CAP_PROP_POS_FRAMES,frame_no);
  ret, frame = cap.read()
  
  cv2.imwrite(dir_path+'uniform_frame_'+str(frame_no)+".png", frame);
  </code></pre>
  
  <p>Now I was wondering if I fetch an <strong>I-Frame</strong>, does it mean that it has a higher quality than other frames, e.g. <strong>P-frames</strong> and <strong>B-Frames</strong>? (inherently, keyframes are not compressed, so they must have higher quality and less noise).</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-09-12T04:39:09.370Z
Comments.Text: Please don't crosspost Qs.
Comments.UserDisplayName: Gyan
Tags: <video><video-quality><video-capture><keyframes><gop>
Title: Frame capture from videos: I-frame vs P-frames
UserDisplayName: angel_30
ThreadText: # Frame capture from videos: I-frame vs P-frames
  
  (Asked by: username_0 on 2018-09-11)
  
  I'm trying to capture various frames within a x264-encoded video files into `png` files (in `python`), and then compare the quality of them:
  
  ```
  cap = cv2.VideoCapture(filename);
  //get frame_number for saving, and save the frame
  cap.set(cv2.CAP_PROP_POS_FRAMES,frame_no);
  ret, frame = cap.read()
  
  cv2.imwrite(dir_path+'uniform_frame_'+str(frame_no)+".png", frame);
  
  ```
  
  Now I was wondering if I fetch an **I-Frame**, does it mean that it has a higher quality than other frames, e.g. **P-frames** and **B-Frames**? (inherently, keyframes are not compressed, so they must have higher quality and less noise).
  
  **Tags:** video, video-quality, video-capture, keyframes, gop
  
  > **Comments:**
  > **username_1**: Please don't crosspost Qs.  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_4 on 2018-09-30. Score: 3 | Accepted answer
  
  "I, B and P" don't refer to the viewed frames, they refer to the encoded, stored forms of the frames. However the frame is encoded in the file or stream, when it appears on the screen or is extracted as a still it is a complete frame, reconstructed from the IBP information as needed.
  
  
  ---
  
  ### Answer by username_2 on 2019-06-05. Score: 1
  
  Intra frames (I-frames, keyframes) are *independent of other frames* - they contain the complete information for reconstructing the frame's image. There is no need for reading other frames and computing from them.
  
  So it's about a *speed*, not about a quality. On the other hand, more intra frames, grater size of the file. (Known tradeoff speed for space.)
  
  Intra frames are preferably used in most media players for so called *fast seek* (fast because of skipping the necessity of reading other frames and computing from them) - see for example
  
  ```
  View -> Options -> Tweaks -> Fast seek (on keyframe)
  
  ```
  
  in Media Player Classic (from [K-Lite Codec Pack](https://www.codecguide.com/)):
  
  [![enter image description here](https://i.sstatic.net/TgXAh.png)](https://i.sstatic.net/TgXAh.png)
  
  Adding more intra frames is important for relatively slow devices (e. g. smartphones) because after jump to non-intra frame *they played back ugly colored and broken video* while they meet the next intra frame - so for common density of 1 intra frame for 250 frames and the 25 fps the user may wait almost 10 second for restoring the image.
  
  > **Comments:**
  > **username_0**: Good piece of info. Thanks.  
  
  ---
  
  ### Answer by username_3 on 2018-09-11. Score: -1
  
  I-frames are uncompressed frames and are what p and b frames reference to for compression. Yes I frames are higher quality.
  
  > **Comments:**
  > **username_1**: I-frames aren't uncompressed - they simply rely on intra prediction.  
  > **username_3**: Sorry, tried to answer that with out getting too technical. Yes I-frames are compressed to a degree, but to answer your question Tina they are higher is quality when compared to P and B frames.  
  
  ---
  
  