Animated gif to avi on linux

前端 未结 5 1760
情歌与酒
情歌与酒 2020-12-24 12:35

Is there any way to convert an animated gif to a video format (e.g. .avi) on Linux?

I have already tried

ffmpeg -i thegif.gif thevideo.a         


        
相关标签:
5条回答
  • 2020-12-24 13:14

    If you like to have a loop as output

    ffmpeg -loop 1 -t x -i some%05d.png some.avi
    

    where x is the time the video should run in seconds.

    Source

    0 讨论(0)
  • 2020-12-24 13:19

    I can suggest combination of imagemagick and ffmpeg

    do this to extract each frame as png/jpeg

    $magick> convert 'images.gif[0]' image.png
    

    Do this to convert images to movie sequence

    ffmpeg -f image2 -i image%d.jpg video.mpg
    

    More help on commands

    http://www.imagemagick.org/script/command-line-processing.php

    http://www.catswhocode.com/blog/19-ffmpeg-commands-for-all-needs

    http://electron.mit.edu/~gsteele/ffmpeg/

    0 讨论(0)
  • 2020-12-24 13:29

    ffmpeg's gif input doesn't work too well. It's usually easier to unpack the gif frames with convert (from ImageMagick) and process these with ffmpeg:

    convert some.gif some%05d.png  
    ffmpeg -i some%05d.png some.avi  
    rm some*.png
    
    0 讨论(0)
  • 2020-12-24 13:34

    If you dont want temporary files, you can try mencoder:

    mencoder myfile.gif -mf fps=25 -o myfile.avi -ovc lavc -lavcopts vcodec=mpeg4
    
    0 讨论(0)
  • 2020-12-24 13:35

    If you like to have a certain framerate as input because the resulting video is to fast or to slow

    ffmpeg -r 'xx' -i some%05d.png some.avi  
    

    where xx is the input framerate.

    0 讨论(0)
提交回复
热议问题