![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
|
Tutorials & Tips The place to find Ubuntu related Tips & Tricks. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
A Carafe of Ubuntu
![]() |
Howto: Create animated GIFs from movie files with free software in four easy steps
This was originally a blog post; see it in its original form here. The original post contains information that is not in this forum post because HTML is not allowed here.
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, but the problem with this is that the resultant GIF looks terrible.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 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 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: Code:
sudo apt-get install gimp mplayer Code:
mplayer -ao null -loop 0 -ss 0:11:22 -endpos 5 file.avi Step 3: Code:
mplayer -ao null -ss 0:11:22 -endpos 5 file.avi -vo jpeg:outdir=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 is an example of an 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. ![]() Last edited by nchase; April 5th, 2008 at 09:31 AM.. |
|
|
|
|
|
#2 |
|
Dark Roasted Ubuntu
![]() |
Re: Howto: Create animated GIFs from movie files with free software in four easy step
I LOVE Rumblefish, its one of my favourite films ever. That fight scene is one of the most gloriously outrageous ones in cinema history!
__________________
"The superior man understands what is right; the inferior man understands what will sell" --Confucius |
|
|
|
|
|
#3 |
|
A Carafe of Ubuntu
![]() |
Re: Howto: Create animated GIFs from movie files with free software in four easy step
Yes sir.
|
|
|
|
|
|
#4 |
|
Skinny Soy Caramel Ubuntu
![]() Join Date: Dec 2005
Beans: 658
Ubuntu 9.10 Karmic Koala
|
Re: Howto: Create animated GIFs from movie files with free software in four easy step
Thank you for the easy how to.
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|