animation - gif 动画的总持续时间

标签 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 秒

有没有其他方法(除了使用物理秒表)以编程方式找到动画的确切持续时间?

最佳答案

使用 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

您可以在几秒钟内找到持续时间。

关于animation - gif 动画的总持续时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35007390/

相关文章:

java - 在 Java 中执行之前让单个 if 语句等待?

optimization - 动画 GIF 比源图像大

ruby - 带重心的 mini_magick 缩略图

c++ - ruby 中使用 C++ .so 库的未解析符号

ios - 如何在 Swift 中缩放动画 GIF?

android - 使用 Glide 显示 GIF 文件(图像加载和缓存库)

css - CSS3 动画会造成内存泄漏吗?

javascript - ngFor 中组件的无效动画

java - 在 ImageView 之上显示动画

c# - 在 C# 中编辑 GIF