Ask questions via twitter! Message any question to @answers on twitter. We'll publish the question and send you a reply each time there's a new answer.
Next Question

Answered Question

 
M$3.25 February 23, 2009 08:53 PM

How can I use VirtualDub, or any other program, to batch command line convert AVI files to animated GIFs?

Interesting Question?  Yes (0)   No (0)   
RSS
 
 

Best Answer  Chosen by Asker

 
February 27, 2009 02:24 AM
ffmpeg is linux based software that is a bit of a swiss army knife for processing video.

Using PHP to take care of the animated gif assembly, you could easily add in a bit of logic to read a directory and compile gif's from all of the flv's found.

Here is a php code snip for you:
$oMovie = new ffmpeg_movie($inputFile);
$oAnimatedGif = new ffmpeg_animated_gif($outputFile, $width, $height,
$frameRate, $loopCount);
$frame = $oMovie->getNextKeyFrame();
if ($frame) {
$oAnimatedGif->addFrame($frame);
}

Basically, we're using PHP to run ffmpeg, extract a few frames and build the animated gif. Note that ffmpeg must be installed and compiled into php.

PHP can be easily run from the command line.
Asker's Rating:


Helpful Answer?  (0)   (0)    Tip robbrown for this answer
Permalink | Report
   Reply  
 
 
 
February 27, 2009 03:35 PM
I didn't even think to add that i needed it to be for Windows only, but i might be able to use this anyway. great answer, thanks!

Report
 
 
 
February 27, 2009 04:58 PM
Yes, you could do this under Windows. If installing PHP & compiling ffmpeg is a bit tough, consider loading up VMware and using an ubuntu distribution.

Although, really, if it was me, I'd just purchase some $5 per month hosting account with shell access that had ffmpeg enabled. Then, as long as you don't mind FTP'ing (or using rsync) to move your videos around, you could do all of your conversions there.

Well, that is if you don't already have a server. Chances are if you're batch processing animated gif's that you're thumbnailing videos for display on the web.

Report
 
 

Other Answers (2)

Sort By
 
February 23, 2009 11:04 PM
I posted a tutorial on how to do this with Virtual Dub below.
I found it really helpful for making avatars for myself and others on various forums.
Source(s):
http://www.starcraft2forum.org/forums/showthread.php?t=1827
Experience.


Helpful Answer?  (0)   (0)    Tip pirate for this answer
Permalink | Report
   Reply  
 
 
 
February 23, 2009 11:07 PM
This is not a solution that can be done via command line, or in a batch situation.

Report
 
 
 
February 23, 2009 11:15 PM
http://dubman.sourceforge.net/ to screate your script. Then /s < script > in the VD Command Line to start the script.

Report
 
 
 
February 23, 2009 11:59 PM
I have tried Dubman before. I do not see an option anywhere in Dubman to export to an Animated GIF. Dubman is simply an easy way to create scripts. I can create scripts just fine, but there does not seem to be any commands in VirtualDub to actually export an animated GIF. VirtualDub.SaveImageSequence gets close, saving a series of pngs tgas or jpgs. Can you show me exactly how you were able to get Dubman to save a script that converts an AVI to an animated GIF?

Report
 
 
 
February 24, 2009 01:18 AM
That's as close as you can get it with Virtual Dub as far as I know. Then you use a batch images to Animated Gif compiler which you can probably google.

Report
 
 
 
February 25, 2009 04:13 PM
I still need a unified, single program solution that can accomplish this. it does not need to be VirtualDub.

Report
 
 
 
August 25, 2009 01:04 PM
  1. Download FFmpeg Win32 Binaries via the links:&nbsp; http://ffmpeg.arrozcru.org/builds/static/ffmpeg-r16537-gpl-static-win32.tar.bz2 or http://ffmpeg.arrozcru.org/builds/shared/ffmpeg-r16537-gpl-shared-win32.tar.bz2.
  2. Invoke "ffmpeg -i video.avi -pix_fmt rgb24 video.gif" to convert AVI to animated GIF.

Source(s):
http://ffmpeg.arrozcru.org/builds/
http://www.uoregon.edu/~noeckel/MakeMovie.html


Helpful Answer?  (0)   (0)    Tip porter for this answer
Permalink | Report
   Reply  
 
 
 
August 25, 2009 07:16 PM
that is fantastic, thanks!

Report
 
 

Answer this Question

How tips and payments work

This question has already been resolved. You may add an answer to it but you will not be eligible to win best answer or any associated tips.

Ask a Question


140 characters left
Top of Page
Buy Mahalo Dollars with Credit Card or PayPal

Top Members

This Week All Time
  • cfinke
    cfinke
    2nd Degree Black Belt
    26630 Points
    M$29.75 Earned
  • opher
    opher
    Purple Belt with a Brown Tip
    5555 Points
    M$221.89 Earned
  • thisjustme
    thisjustme
    Green Belt
    1143 Points
    M$76.05 Earned
   See All
 

Most Popular Tags

mahalo(1741)
music(492)
iphone(479)
google(379)
online(333)
food(333)
beer(282)
money(279)
movies(275)
apple(257)
aotd(235)
health(226)
free(221)
video(219)
dog(209)
   See All
 

Categories

Welcome New Members


 
 
Mahalo Dollars are the currency of Mahalo Answers.

Each Mahalo Dollar costs $1.

Once you earn more than 40 Mahalo Dollars, you can request to be paid via PayPal. Each Mahalo Dollar is currently worth $0.75 when paid out via PayPal. Learn More

 
 

Please log in to use this function.