如何在ffmpeg中更改关键帧间隔 [英] how to change keyframe interval in ffmpeg
本文介绍了如何在ffmpeg中更改关键帧间隔的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将输入视频的关键帧间隔设置为5秒。只有这样,我才能使用FFmpeg实现一个恒定的5秒HLS分割。如何使用FFmpeg将关键帧间隔设置为5秒? (FFmpeg提示行代码赞赏)
I wanted to set the keyframe interval of an input video to 5 seconds. Only then can I achieve a constant 5 second HLS segmentation using FFmpeg. How to set the keyframe interval to 5 seconds using FFmpeg? (FFmpeg prompt line code appreciated)
推荐答案
您需要重新编码。将x264的keyint参数设置为5 * fps,并禁用场景。如果你的fps是24,例如:
You'll need to reencode. Set x264's keyint parameter to 5*fps and disable scenecut. If your fps is 24 for example :
ffmpeg -i <input> -vcodec libx264 -x264-params keyint=120:no-scenecut -acodec copy out.mp4
显然不是最佳的质量,但它会匹配您的需求。
This is obviously not optimal for quality but it'll match your demand.
这篇关于如何在ffmpeg中更改关键帧间隔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文