Forum     

Go Back   Digit Technology Discussion Forum > Community > Tutorials
Register FAQ Calendar Mark Forums Read

Tutorials This section offers tutorials and How to's on just about anything related to computers and IT. Note: All tutorials are courtesy the posters and not verified by Digit


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 08-04-2008, 01:51 PM   #1 (permalink)
S60 rocks
 
rajhot's Avatar
 
Join Date: Aug 2006
Location: bangalore
Posts: 316
Default Making Animated GIFs With Free Software in Four Steps


Note: apparently you do not need to use Linux to do this. There's a version of MPlayer that runs on Windows in the command line and The GIMP is also cross platform. Has anyone has success with this? I imagine all of the commands would be the same.

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 jpegutdir=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.

d/l links:

Mplayer : http://www.mplayerhq.hu/

Gimp: http://www.gimp.org/

source: http://blog.ahfr.org/2008/03/making-...-software.html

Last edited by rajhot; 08-04-2008 at 05:04 PM.
rajhot is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 08-04-2008, 03:23 PM   #2 (permalink)
The Smaller Bang
 
MetalheadGautham's Avatar
 
Join Date: Sep 2007
Location: Gautham City
Posts: 7,492
Default Re: Making Animated GIFs With Free Software in Four Steps

isn't it better to output the images as PNG files instead of JPEG files in MPlayer ? And have you thought of trying to create a script that pipes these images to some commandline image editor ? I heard there is one, but I forgot its name.

Anyway, what you described is a rather simple and basic operation set, but its sadly overlooked by many who try to google endlessly for "video to gif converor" without success. So congratulations on a job well done by this tut.

PS: disable smilies to make symbol go away
__________________
http://TheSmallerBang.wordpress.com
eMachines E725 - T4400 2.2GHz, 1GB, 160GB
Nokia 5130XM * T-Sonic 610 2GB
Nokia 2323C * Samsung Galaxy Y
Apple iPad 2 16GB WiFi
MetalheadGautham is offline  
Old 08-04-2008, 05:05 PM   #3 (permalink)
S60 rocks
 
rajhot's Avatar
 
Join Date: Aug 2006
Location: bangalore
Posts: 316
Unhappy Re: Making Animated GIFs With Free Software in Four Steps

Quote:
Originally Posted by MetalheadGautham View Post

PS: disable smilies to make symbol go away
how to do that?
rajhot is offline  
Old 08-04-2008, 08:36 PM   #4 (permalink)
PhotonAttack
 
DigitalDude's Avatar
 
Join Date: Oct 2007
Location: Chennai
Posts: 1,285
Default Re: Making Animated GIFs With Free Software in Four Steps

^^^
see in the new thread/reply page:




_
__________________
In a time of universal deceit, telling the truth is a revolutionary act - George Orwell

|| तमसो मा ज्योतिर्गमय ||
DigitalDude is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Software for applying animated wallpapers... Manshahia Software Q&A 18 29-05-2007 05:38 PM
Making Money from Free & Open Source Software praka123 Open Source 2 30-04-2007 02:11 PM
Need tutorial:Making animated bmps Chetan1991 Tutorials 2 28-01-2007 02:08 PM
Animated .gifs??? infohardik QnA (read only) 4 13-11-2005 02:03 PM
Animated GIFs don't animate in Firefox tuxfan Internet & WWW 4 13-05-2005 11:11 AM

 
Latest Threads
- by chris
- by icebags
- by Tenida

Advertisement




All times are GMT +5.5. The time now is 01:36 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2