FFMPEG: How to encode for seekable video at high key frame interval

心已入冬 提交于 2019-12-08 16:20:08

问题


I'm looking for an ffmpeg comand that's best used if I'm controlling a video to mouse control on "requestAnimationFrame". Basically, it needs to be fast-seeking and encoded at a high key frame interval. I can't seem to nail down what parameters aid in fast-seeking and high key frames.

thanks! Johnny


回答1:


If you're encoding x264 (mp4), try (docs):

ffmpeg -i file -c:v libx264 -x264opts keyint:25 [preset/rate control options] out.mp4

If you're encoding vp9 (webm), try (docs):

ffmpeg -i file -c:v libvpx-vp9 -g 25 [speed/rate control options] out.webm

Both commands will place a new keyframe every 25 frames. If you want more than that (e.g. one keyframe every frame), then perhaps you don't care about compression as much as you care about speed, and it may be worth looking into intra-only codecs such as FFv1.



来源:https://stackoverflow.com/questions/33854390/ffmpeg-how-to-encode-for-seekable-video-at-high-key-frame-interval

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!