Friday, June 25, 2010

Animated gif to video

This little recipe worked for the basic job of converting the giv to an avi.


mplayer animated.gif -vo yuv4mpeg
ffmpeg -i stream.yuv -an -r 24 -b 640 -s vga -aspect 4:3 test.avi


However I wanted to loop the gif, but ffmpeg's -loop_input and -loop_ouput had no affect. Decided to make a copy and cat a few times...but this didn't work as expected. (Save yourself time and don't copy this section!)


mencoder -oac copy -ovc copy -forceidx test.avi test2.avi -o test.avi
mencoder -oac copy -ovc copy -forceidx test.avi test2.avi -o test.avi
mencoder -oac copy -ovc copy -forceidx test.avi test2.avi -o test.avi


Tried this with no luck:


mplayer -loop 10 test.avi -vo yuv4mpeg


Finally found a good way:


avimerge -i test.avi test2.avi test3.avi - o mergedfile.avi


Sweet!

3 comments:

吳思 said...
This comment has been removed by a blog administrator.
子帆子帆 said...
This comment has been removed by a blog administrator.
政儒 said...
This comment has been removed by a blog administrator.