[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New idea for converting an avi to a flash file -- Was Re: [Swftools-

From: Amartyo Banerjee
Subject: Re: New idea for converting an avi to a flash file -- Was Re: [Swftools-common] Problems with avi2swf
Date: Mon, 17 Nov 2003 08:55:24 -0800 (PST)

> > Any ideas what I need to do ? Would the output of 'swfdump' be useful ?
> Yes, please post post the output of swfdump. Does it include more than
> one frame?

Ok, I think I found some more information. It seems the '-r' parameter is 
working differently than
I understood/expected. As a test I created an swf by combining two jpegs which 
are slightly
different (the object in it moves slightly sideways).
When I used the parameter '-r 100' and play the file using gflashplayer, the 
frame change happens
every 1 second.
When I used the parameter '-r 2500', the framechange happens every 25 seconds. 
If this is what
happened to the original swf file (750 jpegs combined together), that would 
explain why it would
seem like nothing is moving.

Ok, I just got it to work after reading what I just wrote. I changed the 
parameter to '-r 4' and
everything works fine. With this parameter each successive jpeg is shown after 
0.04 seconds, so 25
jpegs are shown in 1 second, exactly the framerate at which the original avi 
file was encoded.
D'oh !

Anyway, I'll summarize how to convert an avi file captured with ffmpeg to a 
flashfile, assuming
one has ffmpeg, transcode, ImageMagick and swftools installed. 
1. ffmpeg -t 30 -an -s cif 30sec.avi
This will record for 30 seconds from a Video4Linux device like a webcam, 
disabling audio recording
and setting the video size to 352x288 and save the output to the file 
'30sec.avi'. The default
framerate is 25 frames per second.
2. transcode -i 30sec.avi -k -z -x ffmpeg -y ppm
This will read from the file '30sec.avi' and convert each frame into a ppm file 
'frame000001.ppm', frame000002.ppm etc. 
I found the '-k' flag necessary because otherwise the colours come out all 
wierd, and the '-z'
option because otherwise the pictures are inverted.
3. for I in frame*.ppm;do J=`basename $I .ppm`;convert $I $J.jpg; done
This is a bash command line to turn each ppm file into a corresponding jpeg 
4. jpeg2swf -m -r 4 *.jpg -o 30sec.swf
This is self explanatory :)
Of course, audio is not handled in this example.
Once avi2swf works properly, this can all be dispensed with, I hope.

Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

reply via email to

[Prev in Thread] Current Thread [Next in Thread]