Animated GIFS from ANY video file (Windows/Linux/MacOSX).

Art tutorials only please. Anything else will be moved into Art & Signatures

Animated GIFS from ANY video file (Windows/Linux/MacOSX).

Postby Xerxes on Fri Jan 09, 2009 4:49 pm

This tutorial can be used on either Windows or Linux, as it uses platform independant free software.

Software needed:
  • VLC (VideoLAN player).
  • Image editing software (only for cropping) if desired.
  • ImageMagick.

Installing Imagemagick:

Go here and scroll down to "Windows Binaries". Select the installer you want (probably the top one) and download/install. Don't worry about the other options at install, just click through unless you wish to use the development options. Make sure that "Update the exectuble search path" is selected otherwise the rest of this will not work.

Much simpler than windows, open a terminal and type "sudo apt-get update && sudo apt-get install imagemagick". Follow the instructions on screen, it should set itself up automatically. Additionally, you can use the link above and download the RPM version and use alien to convert to a *.Deb file, and install that way. Only use the second option if your repositories do not have the software. :)

Go here and download the MacOSX binary. Copy across to your favourite location and it's installed. :)

Installing VideoLAN player:

Go here and select your platform. For Windows, download the exe and run it. For linux, use "apt-get" as above, or download a binary from the distribution list. For MacOSX, download the binary and drag it into your favourite folder and it's installed.

Right, onto the fun part. :)

  1. Find the file you want to make a GIF of. It can be of any type that VLC supports, or from a DVD, etc.
  2. This step is IMPORTANT. You are going to change your output type from the default (X11/Directx etc) into one which outputs frames of the video to separate files on your hard disk. You will want to work out the section of time that you want to use BEFORE you change the output, as you will not see anything when it is changed.
  3. Go to Tools--> Preferences. (note, this is for the windows version, although it's the same process effectively for the other platforms.)
  4. Select "All" at the bottom of the "Show settings" pane. The menu on the left will change.
  5. Expand "Video", then expand "Output Modules". Click on "Output Modules" and change the output to "Image Video Output".
  6. If you wish to change options, then select "Image File" from the "Output Modules" menu. I would advise not changing any options except for "Ratio" as this will change the number of frames saved. A ratio value of 3 means that only every third image is saved to the disk.
  7. Now you have your video output changed, open the video you want to make a gif of, and then IMMEDIATELY stop it, if it begins to play. This is as soon as the video starts playing, it is saving images to your disk. Drag the slider to the section that you want to begin at, hit play, and hit stop as soon as you have finished at the section you want to end at. I would advise using no longer than 5 seconds or so, as GIF files take a large amount of space, and for use in the forum, the physical size for animated sigs is 1.5Mb.
  8. Now repeat steps 3-5 but select "default" as the output, so that next time you can view the video when you use VLC. :)
  9. In the same directory that the video file is (for video files on disk) or in the VLC directory (for non-writable locations like DVDs) you will find a lot of images which constitute the video, frame by frame. The number of images is proportional to the "Ratio" setting, and also the length of time that you have recorded over.
  10. Select only the frames you want (I would imagine there to be frames you don't want in there still) and copy to your "C:\" drive or somewhere easy to find.
  11. At this point, you can edit the files to crop them, or add in whatever you want to the sequence. Bear in mind you will have to make the same changes to EVERY image or it will look like a flash when you have made the gif. :)
  12. Now, open up a terminal (Start-->Run--->"cmd", Linux/MacOSX users should be able to find terminal easily).
  13. On Windows, type "cd C:\" to change directory C:\ or alternately use the same command to get to the one that the images are in. Again, Linux/MacOSX users should navigate to the folder with all their images in. :)
  14. Now, you will create your GIF!

    Code: Select all
    convert -enhance -delay 4 -loop 0 *.png MyVideoGIF.gif

    The parts are:
    "convert" - The command called.
    "enhance" - Makes each frame look better.
    "-delay X" - Defines how quickly each frame is displayed relative to the last. 4 = 4ms between frames, which is relevant for 25fps video. If your video looks too fast or slow when converted, change the value to reflect this.
    "-loop X" - Makes the GIF file loop indefinitely. Change this number to allow for a certain number of loops.
    "*.jpg" - Tells the program to use EVERY image file sequentially in the directory. Ensure that only files you want to use are in the directory, or use wildcards. Ie, if you have all the files as "img-1111.png" or similar, "img-*.png" will select only files that start like that.
    "MyVideoGIF.gif"- The filename to output to.
  15. Congratulations! You have converted your video file to a gif! If your file is too large after this, have a look at my resizing GIFs tutorial and read section 6 onwards.

Enjoy! :)

"I forgot about unspec" - ApacheFlame 05/02/15
User avatar
UKCS Vice President
UKCS iSeries Attendee
Player: Xerxes
Posts: 10573
Joined: Wed Jul 09, 2008 10:30 pm

Return to Art Tutorials

Who is online

Users browsing this forum: CommonCrawl [Bot] and 0 guests