本文介绍了FFMPEG:如何以高关键帧间隔对可搜索视频进行编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果要在"requestAnimationFrame"上将视频控制为鼠标控制,我正在寻找最适合使用的ffmpeg命令.基本上,它需要快速查找并以较高的关键帧间隔进行编码.我似乎无法确定哪些参数有助于快速搜索和高关键帧.

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.

谢谢!约翰尼

推荐答案

如果您要编码x264(mp4),请尝试(文档):

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

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

如果您要编码vp9(webm),请尝试(文档 ):

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

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

这两个命令将每25帧放置一个新的关键帧.如果您想要的还不止于此(例如,每帧一个关键帧),那么也许您不关心压缩,而是关心速度,也许值得研究诸如#a href ="https"之类的内部编解码器. ://trac.ffmpeg.org/wiki/Encode/FFV1"rel =" nofollow noreferrer> FFv1 .

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.

这篇关于FFMPEG:如何以高关键帧间隔对可搜索视频进行编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-09 17:42