使用ffmpeg -i INPUT_GIF
可以查看gif的一些元数据,如下
Input #0, gif, from '.\17319227.gif':
Duration: 00:00:01.59, start: 0.000000, bitrate: 3516 kb/s
Stream #0:0: Video: gif, bgra, 300x206, 12.08 fps, 100 tbr, 100 tbn, 100 tbc
我们主要关注Duration和下面的fps以及tbr
按照文档说明
tbn = the time base in AVStream that has come from the container
tbc = the time base in AVCodecContext for the codec used for a particular stream
tbr = tbr is guessed from the video stream and is the value users want to see when they look for the video frame rate
当使用如下命令,将GIF转为PNG帧的时候
ffmpeg -i .\17319227.gif xxoo\frame%04d.png
实际上ffmpeg是按照tbr参数来转换的。并不是我们猜想的FPS参数。所以上面将会转换成159张图片。
赞助一杯咖啡☕️
本文由 widdy 创作,采用 知识共享署名4.0 国际许可协议进行许可
本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名
最后编辑时间为: Apr 8, 2020 at 08:22 pm