-
Notifications
You must be signed in to change notification settings - Fork 416
Description
Hi,
I have been working on analyzing the impact of varying GOP sizes (15, 150 and 250) on the file sizes produced when encoding videos using H.264 and H.265 codecs. The primary focus was to observe how the choice of frame types (I-frames & P-frames vs. I-frames & interleaved P and B-frames) affects the overall file size at different CRF values.
Video Link: https://drive.google.com/file/d/1YixjRM_5eKefBvny4v1N1FVpzDw-X2Oo/view?usp=sharing
For each CRF value, I compared the file sizes generated under two scenarios:
Single I-frame with the rest being only P-frames.
Single I-frame with interleaved P and B-frames.
Below google drive link contains the findings for this particular video (in the form of histogram) for GOP=15, 150 and 250.(Python code is also present in the below document)
https://docs.google.com/document/d/1iyOrFD7i_R0ojGXgU9i3DSAs-4aD4eQj7Zx3UbrTiOs/edit?usp=sharing
I verified the encoding by checking the frame types with ffprobe. The command which i used in the Command prompt-
ffprobe -v error -select_streams v:0 -show_entries frame=pict_type -of csv=print_section=0 output_i_p_b_frames_crf_18.mp4 (for single I-frame with interleaved P and B-frames)
ffprobe -v error -select_streams v:0 -show_entries frame=pict_type -of csv=print_section=0 output_i_p_b_frames_crf_18.mp4 (for single I-frame with the rest being only P-frames)
Issue: Despite increasing the GOP size significantly, the reduction in file size when using I-frames with interleaved P and B-frames compared to I-frames with only P-frames is not as significant as expected. This behavior holds across both H.264 and H.265 and is consistent across all crf values. The file size for I & interleaved P,B frames remains quite close to the file size for I & P frames for each CRF setting.
In reality, increasing the GOP size should lead to more efficient compression and a larger reduction in file size when comparing I & interleaved P,B frames against I & P frames.
This behavior has caused some confusion, as it is not fully aligned with the expected advantages of using longer GOPs and interleaved P and B-frames.
Regards,
Prolay Shankar Mazumder