gif动画的总持续时间

时间:2016-01-26 05:10:38

标签: animation imagemagick gif animated-gif

目前,我们使用秒表来确定gif横幅上动画的总持续时间。

已经提到了imagemagick解决方案 - How to determine the length of a .gif animation in milliseconds

示例gif横幅广告: http://i.stack.imgur.com/JTz79.gif

实际统计数据: -

迭代次数= 20

持续时间 - 第1帧= 0.5秒

持续时间 - 第2帧= 0.5秒

总时间= 20 *(0.5 + 0.5)= 20秒

ImageMagick提供的统计信息:

使用 - identify -verbose betsy.gif | grep -E 'Iterations|Elapsed'

迭代:19

经过时间:0:01.000

经过时间:0:01.040

总时间= 1.040 * 19 = 19.76秒

还有其他方式(使用物理秒表除外)以编程方式查找动画的确切持续时间吗?

1 个答案:

答案 0 :(得分:0)

像这样使用exiftool:

$ exiftool splash.gif 
ExifTool Version Number         : 11.76
File Name                       : splash.gif
Directory                       : .
File Size                       : 1062 kB
File Modification Date/Time     : 2020:06:18 10:04:16+02:00
File Access Date/Time           : 2020:06:18 09:51:54+02:00
File Inode Change Date/Time     : 2020:06:18 10:04:16+02:00
File Permissions                : rw-r--r--
File Type                       : GIF
File Type Extension             : gif
MIME Type                       : image/gif
GIF Version                     : 89a
Image Width                     : 950
Image Height                    : 140
Has Color Map                   : Yes
Color Resolution Depth          : 1
Bits Per Pixel                  : 1
Background Color                : 0
Animation Iterations            : Infinite
Frame Count                     : 149
Duration                        : 4.96 s
Image Size                      : 950x140
Megapixels                      : 0.133

您可以找到以秒为单位的持续时间。

相关问题