Create an animated gif image from still images on the cli using imagemagick

Written by - 0 comments

Published on May 2nd 2019 - Listed in Linux Multimedia Surveillance


My surveillance system (Zoneminder) "records" movements by capturing screenshots. Putting these screenshots together in order and running through them gives the same effect as watching a recorded video.

When a Zoneminder event is exported, you basically get a folder with these screenshots:

For archiving purposes this is OK, but not if you want to send this to someone. So I needed to find a way to create a video file or an animated image/gif from these images.

Luckily there's ImageMagick's convert command:

$ convert --help|grep delay
  -delay value         display the next image after pausing

I agree, the description "display the next image" does not immediately make you think of an animated gif, yet that's exactly what an animated image is.

I can now tell convert to create an animated image using the delay parameter:

$ convert -delay 0.2 *.jpg recording.gif

Additional parameters also allow an infinite loop (0 = infinite) and resizing of the animated image:

$ convert -delay 0.2 -loop 0 -resize 800x600 *.jpg recording.gif



Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.