Quick Way to Create a .GIF Animated Picture in Linux from a Video File

Quick Way to Create a .GIF Animated Picture in Linux from a Video File:

Prerequisite/s:

Be able to use Terminal
Install FFMPEG
Install ImageMagick


Using FFMPEG, we shall extract pictures from a desired video clip, to use for creating the .GIF animated
picture file

$ ffmpeg -i inputfile.avi -r 1 -s sqcif -f image2 image-%3d.jpg

You can also define the image size of the extracted images using the -s flag. The default option is to use the image size same as the video resolution. you can use different video formats just change the file name/extension of the video input in this example we use a .avi video file.

sqcif option stands for the frame size. You can use other options to change sizes:


sqcif 128x96

qcif 176x144

cif 352x288

4cif 704x576

qqvga 160x120

qvga 320x240

vga 640x480

svga 800x600

xga 1024x768

uxga 1600x1200

qxga 2048x1536

sxga 1280x1024

qsxga 2560x2048

hsxga 5120x4096

wvga 852x480

wxga 1366x768

wsxga 1600x1024

wuxga 1920x1200

woxga 2560x1600

wqsxga 3200x2048

wquxga 3840x2400

whsxga 6400x4096

whuxga 7680x4800

cga 320x200

hd480 852x480

hd720 1280x720

hd1080 1920x1080




To create the .GIF issue command below:

$ convert -delay 20 -loop 0 image*.jpg animation.gif

0 comments:

Post a Comment