On 1/18/2011 8:43 PM, Chris Marshall wrote:
> On 1/13/2011 5:52 AM, Mathieu Alorent wrote:
>> Le mercredi 12 janvier 2011 à 20:45 -0500, Chris Marshall a écrit :
>>> There is also wmpeg which allows you to generate an MPEG
>>> video from a pdl.
>>
>> Thanks I've also saw this option in the doc but it's not really what I
>> need ;)
>
> The update of wmpeg to use the ffmpeg encoder potentially
> can support all the file formats that ffmpeg, the utility, can.
> It turns out if you name your output file with a .gif file
> extension then wmpeg will output an uncompressed GIF anim
> file.  gifsicle could then be used to optimize the animation
> for size.

Here's the output from the wmpeg.pl program in
PDL/Example/IO with the output filename changed
from 'bounce.mpg' to 'bounce.gif':

> ~/pdl/git/pdl/Example/IO $ perl wgif.pl
> Writing frame 0, PDL: Byte D [384,80]
> Writing frame 1, PDL: Byte D [384,80]
> Writing frame 2, PDL: Byte D [384,80]
> FFmpeg version git-09a5c24, Copyright (c) 2000-2011 the FFmpeg developers
>   built on Jan 18 2011 20:56:47 with gcc 4.3.4 20090804 (release) 1
>   configuration:
>   libavutil     50.36. 0 / 50.36. 0
>   libavcore      0.16. 1 /  0.16. 1
>   libavcodec    52.108. 0 / 52.108. 0
>   libavformat   52.94. 0 / 52.94. 0
>   libavdevice   52. 2. 3 / 52. 2. 3
>   libavfilter    1.74. 0 /  1.74. 0
>   libswscale     0.12. 0 /  0.12. 0
> Writing frame 3, PDL: Byte D [384,80]
> Writing frame 4, PDL: Byte D [384,80]
> Writing frame 5, PDL: Byte D [384,80]
> Writing frame 6, PDL: Byte D [384,80]
> Writing frame 7, PDL: Byte D [384,80]
> Writing frame 8, PDL: Byte D [384,80]
> Writing frame 9, PDL: Byte D [384,80]
> Writing frame 10, PDL: Byte D [384,80]
> Writing frame 11, PDL: Byte D [384,80]
> Writing frame 12, PDL: Byte D [384,80]
> Writing frame 13, PDL: Byte D [384,80]
> Writing frame 14, PDL: Byte D [384,80]
> Writing frame 15, PDL: Byte D [384,80]
> Writing frame 16, PDL: Byte D [384,80]
> Writing frame 17, PDL: Byte D [384,80]
> Writing frame 18, PDL: Byte D [384,80]
> Writing frame 19, PDL: Byte D [384,80]
> Writing frame 20, PDL: Byte D [384,80]
> Writing frame 21, PDL: Byte D [384,80]
> Writing frame 22, PDL: Byte D [384,80]
> Writing frame 23, PDL: Byte D [384,80]
> Writing frame 24, PDL: Byte D [384,80]
> Writing frame 25, PDL: Byte D [384,80]
> Writing frame 26, PDL: Byte D [384,80]
> Writing frame 27, PDL: Byte D [384,80]
> Writing frame 28, PDL: Byte D [384,80]
> Writing frame 29, PDL: Byte D [384,80]
> [image2pipe @ 0xfc9810] Estimating duration from bitrate, this may be 
> inaccurate
> Input #0, image2pipe, from 'pipe:':
>   Duration: N/A, bitrate: N/A
>     Stream #0.0: Video: ppm, rgb24, 128x80, 25 fps, 25 tbr, 25 tbn, 25 tbc
> [buffer @ 0xfd6f90] w:128 h:80 pixfmt:rgb24
> Output #0, gif, to 'bounce.gif':
>   Metadata:
>     encoder         : Lavf52.94.0
>     Stream #0.0: Video: rawvideo, rgb24, 128x80, q=2-31, 200 kb/s, 90k tbn, 
> 25 tbc
> Stream mapping:
>   Stream #0.0 -> #0.0
> frame=   30 fps=  0 q=0.0 Lsize=     345kB time=1.20 bitrate=2357.2kbits/s
> video:900kB audio:0kB global headers:0kB muxing overhead -61.633898%
>
> $ ls -l bounce.gif
> -rw-r--r-- 1 chm None 353582 Jan 18 21:09 bounce.gif

Now I process it with gifsicle to optimize the memory
usage of the animation:

> ~/pdl/git/pdl/Example/IO $ gifsicle -b -O2 bounce.gif
>
> ~/pdl/git/pdl/Example/IO $ ls -l bounce.gif
> -rw-r--r-- 1 chm None 1516 Jan 18 21:11 bounce.gif

Et voila!  A size reduction by more than 233X!  It
would be nice to see this folded in to the command
itself eventually.  It works on cygwin/*ix systems.
I don't know about MSWindows or Mac OS X.  You would
need both ffmpeg and gifsicle on the platforms at
the least.

Cheers,
Chris


_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to