PDA

View Full Version : How to set 1 iframe per second?


Razorholt
14th March 2006, 05:14
Hello,

I need to encode my files with 3 b-frames and 1 i-frame per sec (or 1 frame every 23.98 frames in my case).

I guess I need to adjust these variables only:

Factor between I and P frame Quants: ?
Factor between P and B frame Quants: ?
Number of B-frames: 3


Thanks for your help.

- Dan

Audionut
14th March 2006, 06:28
In MeGui it's called "Keyframe interval", at the command prompt --keyint. Which is the maximum GOP size or the max distance between I frames.

Then you have the "minimum GOP size" --min-keyint, which is the minimum distance between I frames.

edit: "Factor between I and P frame Quants". It will make P-frames, the value you set times the I-frame quant.
eg: if you set it at 2.0, and you have an I-frame at quant 5, the resulting P-frames would be quant 10
The same goes for "Factor between P and B frame Quants".

If you must have 3 B-frames, then ensure you do not enable "adaptive b-frames", or at the command prompt, --no-b-adapt.
IMHO, it would be best to set B-frames at 3, with adaptive b-frames, and let x264 decide how many b-frames to code up to a maximum of 3.

Razorholt
14th March 2006, 07:48
Thank you very much Audionut for this very clear answer :)

- Dan

Selur
14th March 2006, 08:27
In MeGui it's called "Keyframe interval", at the command prompt --keyint. Which is the maximum GOP size or the max distance between I frames.
iirc setting min gop size to xy only provides a upper bound for the distance between two IDR-frames (=> also for i-frames) but it would not guarantee that there's only one i-frame in the time intervall. (not sure if there's a way to guarantee this in x264)

GodofaGap
14th March 2006, 09:42
There is also "--min-keyint" to set the minimum difference between IDR frames. Perhaps a better way is "--scenecut", which can also be used for this (I think it should be set to 0, to not add extra I-frames before maximum interval is reached).

So basic commandline should be:


--keyint 24 --scenecut 0 --bframes 3 --no-b-adapt

Razorholt
16th March 2006, 06:41
--keyint 24 --scenecut 0 --bframes 3 --no-b-adapt


Will try that :).

Thanks,
- Dan