FFMPEG: How to Encode for Searchable Video with High Keyframe Interval

I am looking for a ffmpeg comand which is best used if I control the mouse control video on "requestAnimationFrame". Basically, it should be quickly distorted and encoded with a high keyframe interval. I canโ€™t cover what parameters help in fast and high key frames.

thanks! Johnny

+5
source share
1 answer

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 .

+8
source

Source: https://habr.com/ru/post/1236546/


All Articles