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
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).

  • Please don't crosspost Qs. – Gyan Sep 12 '18 at 4:39

"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.


I-frames are uncompressed frames and are what p and b frames reference to for compression. Yes I frames are higher quality.

  • 3
    I-frames aren't uncompressed - they simply rely on intra prediction. – Gyan Sep 12 '18 at 4:39
  • 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. – user23155 Sep 12 '18 at 16:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.