使用以下命令:
ffmpeg -i test.mp4 -vf "select='not(mod(n,2000))',setpts=N/3/TB" -r 3 output.gif
我在3fps的GIF文件中每2000帧写一帧。
但是当我看到ffmpeg的输出时,有一些令人困惑的事情:
speed=0.00997frame= 1 fps=0.7 q=-0.0 size= 1kB time=00:00:00.01
speed=0.00498frame= 1 fps=0.4 q=-0.0 size= 1kB time=00:00:00.01
speed=0.00332frame= 2 fps=0.6 q=-0.0 size= 2kB time=00:00:00.34
speed=0.0847xframe= 2 fps=0.4 q=-0.0 size= 2kB time=00:00:00.34
speed=0.0678xframe= 2 fps=0.4 q=-0.0 size= 2kB time=00:00:00.34
speed=0.0565xframe= 2 fps=0.3 q=-0.0 size= 2kB time=00:00:00.34
speed=0.0968xframe= 3 fps=0.4 q=-0.0 size= 20kB time=00:00:00.68
speed=0.0847xframe= 3 fps=0.4 q=-0.0 size= 20kB time=00:00:00.68
speed=0.0753xframe= 3 fps=0.3 q=-0.0 size= 20kB time=00:00:00.68
speed=0.0678xframe= 4 fps=0.4 q=-0.0 size= 41kB time=00:00:01.01
speed=0.0915xframe= 4 fps=0.3 q=-0.0 size= 41kB time=00:00:01.01
speed=0.0839xframe= 4 fps=0.3 q=-0.0 size= 41kB time=00:00:01.01
speed=0.0774xframe= 4 fps=0.3 q=-0.0 size= 41kB time=00:00:01.01
speed=0.0954xframe= 5 fps=0.3 q=-0.0 size= 66kB time=00:00:01.34
speed=0.089x frame= 5 fps=0.3 q=-0.0 size= 66kB time=00:00:01.34
speed=0.0834xframe= 5 fps=0.3 q=-0.0 size= 66kB time=00:00:01.34
speed=0.0785xframe= 6 fps=0.3 q=-0.0 size= 90kB time=00:00:01.68
speed=0.093x frame= 6 fps=0.3 q=-0.0 size= 90kB time=00:00:01.68
speed=0.0881xframe= 6 fps=0.3 q=-0.0 size= 90kB time=00:00:01.68
speed=0.0837xframe= 6 fps=0.3 q=-0.0 size= 90kB time=00:00:01.68
看起来每个目标帧都会重建多次。 我希望这样的事情:
speed=0.00997frame= 1 fps=0.7 q=-0.0 size= 1kB time=00:00:00.01
speed=0.00332frame= 2 fps=0.6 q=-0.0 size= 2kB time=00:00:00.34
speed=0.0968xframe= 3 fps=0.4 q=-0.0 size= 20kB time=00:00:00.68
speed=0.0678xframe= 4 fps=0.4 q=-0.0 size= 41kB time=00:00:01.01
speed=0.0954xframe= 5 fps=0.3 q=-0.0 size= 66kB time=00:00:01.34
speed=0.0785xframe= 6 fps=0.3 q=-0.0 size= 90kB time=00:00:01.68
我错过了什么吗?
的后续内容答案 0 :(得分:0)
那只是进度报告。每次刷新报告时,如果尚未对新帧进行编码,它将显示相同的数字。 fps速度1.0
表示每秒编码1帧。因此,如果进度报告在一秒钟内有两次刷新,则第二次刷新将显示相同的帧数。