[ubuntu-in] Making Gif animation in Ubuntu and a question regarding image transition speed in other relatef software

K Ramnarayan ramnarayan.k at gmail.com
Thu Apr 22 17:09:24 BST 2010


Hi

Have been experimenting in trying to make gif animation. Initially thought it 
was very difficult and needed some complicated knowledge of software and stuff. 

But hey not so

all it requires is some creativity and gimp.(hooray for GIMP)

Found this tutorial http://blog.ahfr.org/2008/03/making-animated-gifs-with-
free-software.html

which is posted below (without all the fancy stuff)
Making Animated GIFs With Free Software in Four Steps

Note: this is not Linux-specific. the commands are essentially the same on the 
windows version of mplayer. The GIMP is also cross platform. see the comments 
for more details.

MPlayer is a pretty powerful tool for processing video files. It has a built-in 
command line option that will export specified movie frames to a GIF. Such a 
feature seems like it would make the guide I'm presenting here obsolete, but 
the problem with the feature is that the resultant GIF looks terrible: too few 
colors. As far as I've seen, the best way to get good quality animated GIFs 
using only free software involves using a combination of MPlayer's command 
line tools and a little bit of elbow grease in The GIMP. We will export the 
desired segment of video to a series of JPEG files, then use The GIMP to 
combine those files into a nicely animating GIF that should look nearly as good 
as the original video. I believe that it is possible to get MPlayer and The 
GIMP together in a script that will allow the end user to simply point the 
script to the desired movie file and the desired segment and the script will do 
all the "dirty work" and create the GIF. This is my end goal, but I have not 
taken the time necessary to learn any of GIMP's scripting language. If there 
is a pre-existing solution that allows one to do what I am trying to show 
here, I'd love to know about it, so please let me know.

Step 1 (for Debian or Ubuntu users):

sudo apt-get install gimp mplayer


Step 2:

mplayer -ao null -loop 0 -ss 0:11:22 -endpos 5 file.avi


This command will display the segment of file.avi on your screen that runs from 
11:22 to five seconds later (11:27). It will loop infinitely until you close the 
window or send a ctrl+c to the terminal window. This command is useful for 
figuring out what your GIF will look like before you make it. The audio output 
will not be heard (is set to null)

Step 3:

mplayer -ao null -ss 0:11:22 -endpos 5 file.avi -vo jpeg:outdir=moviedirectory


This command actually creates the jpeg files you will need to make your 
animated gif. It is similar to the other command, but nothing is displayed on 
screen, and the command will not loop forever. The command will output the 
segment to a series of jpeg files in a directory called "moviedirectory".

Step 4:

Now that we have our directory full of jpegs, we should open the first of these 
files in The GIMP. Then, open the remainder of the images in the directory as 
layers (File -> Open As Layers). Every image in that directory should now be a 
layer. Now save the file as a .gif and choose to "save as animation" as opposed 
to "flatten image." Click export. Lastly, it is important to make sure "loop 
forever" is checked if you want a GIF that loops forever. The other options 
here can drastically change the effect of your gif because they change the 
speed that the gif is displayed at. A relatively fast gif will have a 15 
millisecond delay between frames. The default delay of 100 ms is a bit slow in 
my opinion. Under frame disposal where unspecified I select "one frame per 
layer." I check "Use delay entered above for all frames" and "Use disposal 
entered above for all frames." Here are examples of the end result:

If you find that your image is too large, it is often helpful to resize it to 
be a bit smaller. This can help with the image's performance.

As Firefox is often the platform where people will be viewing your animated 
gif files, it is also a good tool to use to test them to see what the final 
product looks like.


If you liked this or thought it was cool, you should read my guide on using 
FFmpeg.
**
In combination with my own need for gif visuals, and gimp and openclipart i 
managed to make some pretty good gif stuff and am really thrilled. 

Hope you enjoy this tutorial and the results as much as as i do, esp because 
its really easy

***
however following this my quest for that piece of software is still on, One 
which allows me more control to make a video from still images, in which i 
have control over the exact millisecond transition time from each image. 

 
Who knows it may mean even getting my hands into figuring out how to make the 
changes in software. What i would like is a software that can take a series of 
images and make it in movie. Am using imagination and it restricts the image 
transition to 1 per second (minimum) which is not good enough.

Gif does the job but its too jerky and needs more time if you want to do a 
good job and then its not so easy to add a sound track.

Have tried alternatives for imagination like 
1. mistleix
2. videoporama

similar to imagination but with the same problem that the transition speed 
cannot be less than 1 second. 

So any ideas, or should i jst begn learning how to hack into imagination and 
make the changes (if possible) my self -

regards
ram



More information about the ubuntu-in mailing list