mp4 to animated gif using ImageMagick
mp4 to animated gif using ImageMagick
Hi friends, have any of you encountered this use case? Using Rails 5 on a project to do this and wasn't able to find anything on StackOverflow. Hoping to convert an mp4 to an animated gif using ImageMagick. Any help is greatly appreciated, or just a point to a tutorial or the right direction. Many thanks!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: mp4 to animated gif using ImageMagick
I believe to be able to convert mp4, you need ffmpeg loaded where ImageMagick could find it. If that is available, then the following should work in the command line. Sorry I do not know Rails.
If that does not work, then try
Where X is the desired frame delay in ticks (1/100 s)
See also https://www.imagemagick.org/Usage/video/
Please, always provide your IM version and platform when asking questions, since syntax may differ. Also provide your exact command line and if possible your images.
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620
If using Imagemagick 7, then see http://imagemagick.org/script/porting.php#cli
For novices, see
http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
Code: Select all
convert -delay X image.mp4 -loop 0 animation.gif
Code: Select all
convert -delay X image.mp4 -coalesce -layers optimize -loop 0 animation.gif
See also https://www.imagemagick.org/Usage/video/
Please, always provide your IM version and platform when asking questions, since syntax may differ. Also provide your exact command line and if possible your images.
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620
If using Imagemagick 7, then see http://imagemagick.org/script/porting.php#cli
For novices, see
http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown