landtore.blogg.se

Imagemagick or gifsicle
Imagemagick or gifsicle














Why is the final GIF larger than the video? The additional parameters -vf "fps10" tell ffmpeg to use 10 frames per second and -loop 0 creates an infinite "play" of the GIF.īut something is bothering: The file size of the ~ $ du -h /tmp/output3.gif The hidden secret is that ffmpeg automatically detects that it should create a GIF from the file suffix (.gif). Most modern video codecs and JPEG pictures use a compression level (which can be adjusted). The Graphics Interchange Format (GIF) however was never made for photos/pictures. GIF was created for graphics, as the name says.

IMAGEMAGICK OR GIFSICLE SERIES

GIF also only allows 256 colors per still image - this means that additional colours (coming from a video file, which is basically a series of jpeg pictures) need to be coped with more gif images (adding the additional colours) in between.Īnother method of creating a GIF is by extracting a "colour palette" of the video first (see this excellent blog post from Cassidy K for more detailed information). The created file is very small, simply containing color ~ $ du -h /tmp/palette.png This should greatly reduce the resulting GIF size.įirst to create a palette ~ $ ffmpeg -i /tmp/Video.mp4 -vf "fps=15,palettegen=stats_mode=diff" /tmp/palette.png The goal with this method is to create a base image and all the changes (movements) are applied as layers on top of the base image.














Imagemagick or gifsicle