Video: What are I-frames and why do they affect the size of the video? Videos usually are described by a set of parameters including: bit rate, frame rate, width &amp; height.

But I came to realize that there are more parameters including B-frames and I frames (or I guess they are the KEY-FRAMES).

Now I noticed that they exist when I was working on a custom video capturing technique in which I have the ability to control how often they appear in terms of seconds, so they are either 1 sec away from each other or 2 sec away or 3.....

But some weird things happened when I tried to change the appearance of these frames.

First case:

When I encoded a video with (2 sec or 1 between I Frames) I got a video that doesn't seek well.

Now If I try to merge the encoded video with an equal length audio file for some reason when I seek forward or backward I see black screen before I seek to the requested frame.

Second case:

When I encoded a video with (0 sec between I frames) I got a video that seeks fine, but for some reason the size increased.

Now if I try to merge the encoded video with audio of equal length I get a video mixed with audio that works well and seeks well with no black screen on seeking.

Question:

What are I frames?

Why do they affect seek behavior?

Why do they affect the merging of video with audio?

Why do they affect the size of the video?

Thanks.
You should do some research about GOPs ( Group of Pictures ) to find the definition of I frames.

This will answer the second and fourth question as well.

In generall, the more I frames a GOP has:


the better is the seeking qualitiy. (If the seek lands to a non I frame, it takes ressources to calculate the frame. To avoid this, sometimes seeking is only possible from one I frame to another)
the bigger is the video ( as I frames are saved as full frames )


The GOP has usually no effect on sound, but the codec does.