Log in

View Full Version : How to force I-frames during x264 encoding?


alexVS
21st March 2019, 14:22
I encode to h264 using megui, avisynth, avs-script.

Is it possible to encode definite frames as I-frames? For example, frames N 15123, 17234, 30123 must be encoded as I-frames.
I want to make chapters start exact at these frames.
This was discussed in 2008 year, but there was no solution for the problem. May be now it's possible?

I also wander how to view type of frames in h264 (how to find I-frames). For avi-xvid there is virtualdub, where I can jump on keyframes holding shift key.

:thanks:

sneaker_ger
21st March 2019, 15:12
You can specify a qpfile (https://en.wikibooks.org/wiki/MeGUI/x264_Settings#qpfile) via the advanced x264 settings ("Misc" tab).

For example to make the 3 frames you listed into IDR frames create a text file as follows:
15123 I
17234 I
30123 I
(counting starts from 0)

alexVS
22nd March 2019, 17:38
Thanks! It works fine! :)