例如: 如果我像这样转换视频:
ffmpeg -i demo.avi -ss 00:00:05 -t 00:00:15 test.flv
很快
ffmpeg -i demo.avi -ss 00:45:05 -t 00:00:15 test.flv
我必须等待很长时间才真正有效。
有什么方法可以解决这个问题吗?
答案 0 :(得分:8)
-ss
的行为取决于它在命令中的位置:作为输入或输出选项。正如ffmpeg文档所述:
-ss position (input/output)
When used as an input option (before "-i"), seeks in this input file to position.
When used as an output option (before an outputfilename), decodes but discards
input until the timestamps reach position. This is slower, but more accurate.
position may be either in seconds or in "hh:mm:ss[.xxx]" form.
您还可以使用-ss
作为输入选项和输出选项,它可以提供速度和(可能提高的)准确度。有关更多示例和详细信息,请参阅[FFmpeg-user] Reducing seek time when start time offset (-ss) is large和Enhancing -ss option上的评论。