If you are encoding x264 (mp4) try ( docs ):
ffmpeg -i file -c:v libx264 -x264opts keyint:25 [preset/rate control options] out.mp4
If you are encoding vp9 (webm), try ( docs ):
ffmpeg -i file -c:v libvpx-vp9 -g 25 [speed/rate control options] out.webm
Both teams will post a new keyframe every 25 frames. If you want more than that (for example, one keyframe in each frame), then you probably donโt need compression, how much you care about speed, and maybe you should look at codecs only inside one type, such as FFv1 .
source share