0

Videos usually are described by a set of parameters including: bit rate, frame rate, width & 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.

1 Answer 1

0

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.

16
  • why is it that when I merge an audio file with a video file that was encoded with 1 sec between i -intervals I get black frames when I fast seek? But It doesn't happen when i-frames are set to 0.
    – database
    Commented May 17, 2018 at 12:08
  • If you video only contains I-frames, there's less decoding necessary and therefore frames can be shown. For non I frames the decoding is much mor time-consuming and abviously not fast enough to show the frames during seeking.
    – user21266
    Commented May 17, 2018 at 12:31
  • Then what can I do to fix that?
    – database
    Commented May 17, 2018 at 12:37
  • Use I frames only, or use at least only B frames in addition and no P frames, or use another codec.
    – user21266
    Commented May 17, 2018 at 12:41
  • Yes I am doing this but the file is getting too large? In your opinion what do you suggest( frame rate, bitrate, length, width ) should I use with a (0 sec i - interval video) to get a video of almost length 2:00 minutes and doesn't exceed 8-7 mb?
    – database
    Commented May 17, 2018 at 12:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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