<br><br><div><span class="gmail_quote">On 1/10/07, <b class="gmail_sendername">Ingles, Raymond</b> <<a href="mailto:Raymond.Ingles@compuware.com">Raymond.Ingles@compuware.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>> From: Ken Siersma<br><br>> On 1/10/07, Ingles, Raymond <<a href="mailto:Raymond.Ingles@compuware.com">Raymond.Ingles@compuware.com</a>> wrote:<br><br>> I've also whipped up scripts to convert movies and DVDs to .avi files for
<br>> my Treo 650. (Don't use that much, but it's fun to play with.)<br><br>> Question for you on that one - what app do you use in the scripts to create<br>> the AVI file?<br><br> Mencoder, primarily.<br>
<br>> I've often found myself needing to convert GIF animations to AVI movies,<br>> but end up using Windows to do it.<br><br> Huh. I haven't really had call to do that. Mostly .mov, .vob (DVD video),<br>.asf, and suchlike. Let's see. I think you could use ImageMagick's 'convert'
<br>to extract the individual frames, and then run mencoder on the resulting<br>frames to make a movie. Something like this quick 'gif2avi' hack:<br><br>----------------------------<br>#!/bin/bash<br><br>#Usage: first arg is animated gif to convert. Second arg is fps.
<br># (I couldn't find a quick command-line way of determining this from the<br># GIF file. Ah, well.)<br><br>FRAMEPERSEC=$2<br><br># Strip the leading dirname (if any) and the ".gif" off the end of the<br># file to get the name of the movie we'll make. (Note: case-sensitive,
<br># won't handle ".GIF".)<br>AVINAME=`basename $1 .gif`<br><br>echo Converting '$1' with fps '${FRAMEPERSEC}' to '${AVINAME}'.<br><br># Make a temp dir to store the frames. ('$$' is our PID.)
<br>TEMPYDIR=/tmp/gif2avi-$$.dir<br>if [ -e ${TEMPYDIR} ]; then<br> echo Temp dir '${TEMPYDIR}' already exists, aborting!<br> exit -1<br>else<br> echo Creating temp dir ${TEMPYDIR}.<br>fi<br><br>mkdir /tmp/gif2avi-$$.dir
<br><br># Coalesce the gif file to make sure all the frames are of the same<br># size. (This can take quite a while.)<br>echo Coalescing gif...<br>convert $1 -coalesce ${TEMPYDIR}/coalesce.gif<br><br># Generates a bunch of 'frame####.jpg' files (at 100% quality so we don't
<br># lose any quality at this stage). Note: if you have more than 10,000<br># frames you'll need to up the "%04" to add more digits.<br>echo Extracting frames...<br>convert -quality 100 ${TEMPYDIR}/coalesce.gif ${TEMPYDIR}/frame%04.jpg
<br><br># Actually make the movie.<br>echo Generating movie...<br>mencoder "mf://${TEMPYDIR}/frame*.jpg" -mf fps=${FRAMEPERSEC} -o ${AVINAME}.avi -ovc lavc -lavcopts vcodec=mpeg4<br><br># Clean up after ourselves.
<br>echo Cleaning up tempdir...<br>rm -r ${TEMPYDIR}<br>----------------------------<br><br> That should be pretty close to what you want...<br><br> Sincerely,<br><br> Ray Ingles (313) 227-2317
<br><br> We were once willing to go nuclear to avoid secret prisons, torture,<br> and indefinite detention. What happened? - Malor<br>The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it.
<br>_______________________________________________<br>mdlug mailing list<br><a href="mailto:mdlug@mdlug.org">mdlug@mdlug.org</a><br><a href="http://mdlug.org/mailman/listinfo/mdlug">http://mdlug.org/mailman/listinfo/mdlug
</a></blockquote><div><br> </div><br></div>Thank you very much, I'll give that a shot.<br>