How do I convert an animated GIF to a YouTube friendly video format?

96,469

Solution 1

Try this Open Source software http://www.virtualdub.org

Open your .gif as a video file... then save as .avi

Solution 2

The ImageMagick convert program can split up animated GIFs. e.g. given the existence of a file 'foo.gif', I can run:

convert foo.gif foo.png

and it will create files foo-0.png, foo-1.png, etc, one for each frame. If you have more digits, then use the following syntax, for example with 4 digits:

convert foo.gif foo%04d.png

You could then use FFmpeg to build those into a movie.

ffmpeg -f image2 -r framerate -i foo-%d.png -c:v libx264 -pix_fmt yuv420p output.mp4

To change the quality of the resulting video, add the -crf option, e.g. -crf 23, where lower means better quality. Sane values are between 18 and 28, but since the GIF quality shouldn't be too good in the first place, you probably won't need this option.

As of 2013, recent versions of ffmpeg can accept animated gifs as input directly.

ffmpeg -r framerate -i input.gif -c:v libx264 -pix_fmt yuv420p output.mp4

Solution 3

Just

ffmpeg -i input.gif output.mp4

(taken from @framp's comment on @John Fouhy's answer above)

Don't know about YouTube, but the codec can be specified with the -c:v options (see ffmpeg -codecs for the list of codecs).

This codec for example imports well into Final Cut:

ffmpeg -i input.gif -c:v qtrle output.mov

Solution 4

If you have the older Windows Movie Maker for XP, etc., you can easily load your animated GIF and convert it to a movie file. So, if you have an older computer, you can set it up this way.

For some reasons, animated GIFs show up as still shots in windows Movie Maker Live. Don't know why.

Here is a FREE way to change this. Download CAMSTUDIO (The free open source version) (or go to CNET and find a download).

  • Once you've set it up, you can open Pivot in the project pivot mode (not the animated gif).
  • Set Camstudio so you can just grab around the screen of the pivot picture itself.
  • Play your pivot and it will record it like a movie in AVI format.
  • Then you can use Zamzar (or other online video converter sites) to convert for YouTube.

I teach Pivot in my class and sometimes students projects won't convert to animated gifs so that's how I fix the problem.

Solution 5

You can try AviSynth. It has several encoding options for images. You may also want to ask this on VideoHelp.com.

Share:
96,469

Related videos on Youtube

Garik
Author by

Garik

Updated on September 17, 2022

Comments

  • Garik
    Garik almost 2 years

    My son has made some animations with Pivot Stickfigure Animator which we'd like to upload to YouTube. The problem is Pivot saves as animated GIFs which I can't upload to YouTube.

    The Wikipedia article recommends using Windows Movie Maker to convert GIF to WMV, but unfortunately I'm using Windows 7 for which you can get the new Windows Live Movie Maker which doesn't seem to support GIFs.

    I Googled and found an article which said to use Beneton Movie GIF to convert animated GIF to AVI, but this seemed to rely on a 3rd Party application which wasn't installed and so failed. Installing the missing application - pjBmp2Avi - by hand and adding it to the path still didn't allow Beneton to do the conversion.

    I hoped FFmpeg might do the trick but this only outputs to animated GIFs, it won't read from then.

    Further Googling found lots of applications with 30 day trials and so on but I was hoping for something free.

    So any suggestions on how I can convert an animated GIF to a movie file on Windows using free (as in beer) software?

    • MT.
      MT. almost 15 years
      superuser.com/questions/5730/… should work if you write a small batch script that asks for the file name as input and then performs those steps. Really, it's not that scary if you have it echo a little box with some text in it to indicate what you're supposed to do...
  • Garik
    Garik almost 15 years
    I've had a quick look and to use animated GIFs with AviSynth I'll need to install AviSynth, the Immaavs plug-in and ImageMagick, and something like VirtualDub to actually see and save the converted GIF. Oh and write an AviSynth script for each GIF I want to convert. So it's a possibility, but I was hoping for something a little less convoluted, ideally a simple GUI that my son could use himself.
  • Ascherer
    Ascherer almost 15 years
    Bah. Throwing $30 dollars at a problem instead of 2 weeks of hard mental labor to create a partial solution? Where's the fun in that? ;-)
  • Garik
    Garik almost 15 years
    This worked OK but was a pain to line up with the window. Jing - jingproject.com - seems to do the lining up automatically but thankfully some people have posted some tools which do the conversion more directly.
  • Garik
    Garik almost 15 years
    This works a treat. If I could split bounty 50/50 I'd have given you half.
  • Garik
    Garik almost 15 years
    Thankfully my bounty has got some other people to do the work for me and have found me some good free solutions. :-)
  • Garik
    Garik almost 15 years
    Works great, thanks. And as a bonus I think we can use the same tool to add voices to to the stick men.
  • Garik
    Garik about 14 years
    Unfortunately I'm using Window 7 for which you can get only the new Windows Live Movie Maker which doesn't seem to support GIFs.
  • framp
    framp about 10 years
    ffmpeg is smart enough to infer most of those options: ffmpeg -i input.gif output.mp4