ffmpeg -i irregular_keyframe_distance.mpeg -an -r 25 -vcodec mpeg1video -qscale 5 -g 5 -keyint_min 5 outfile.mpeg outfile.mpeg as keyframes at frames (obtained with tool VirtualDub on windows XP) : 0, 5, 6, 9, 12, 17, 22, 27, 32, 37, 42, 47, 52, 57, 62, 67, 72, 77, 82, 87, 92, 97, 99, 102, 105, 108, 113, 118, 123, 128, 133, 138, 143, 148, 153, 158, 163, 168, 173, 178, 183, 188, 193, 198, 203, 208, 213, 218, 223, 228, 233, 238, 243, 248, 253, 258, 263, 268, 273, 278, 283, 288, 293, 298, 303, 308, 313, 318, 323, 328, 333, 338, 343, 348, 353, 358, 363, 368, 373, 377 But I was expecting keyframes every 5 frames only, in fact when there are fading in the movie, keyframes interval is less than 5 frames.