[mdlug] DRM

Ken Siersma siersmak at gmail.com
Wed Jan 10 12:48:36 EST 2007


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




Thank you very much, I'll give that a shot.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mdlug.org/pipermail/mdlug/attachments/20070110/7f9f9856/attachment-0001.html>


More information about the mdlug mailing list