[swfmill] newbie: creating animation from a series of jpg files various timings
Ian Thomas
ian at eirias.net
Mon Mar 5 03:45:29 EST 2007
As a sideways thought - not that I want to put you off swfmill! - you
might want to take a look at ffmpeg, which can take a sequence of
stills as input and produce a flash video (or nearly any other kind of
video) as output. Don't know if it can handle your odd timings, but I
think it's worth a look. If only to save your users the pain of
loading 1000 jpegs!
http://ffmpeg.mplayerhq.hu/
Ian
On 3/5/07, Seth Markowitz <seth.markowitz at gmail.com> wrote:
> Hi,
>
> I'm a newbie to swfmill, but I did get it working for my purposes... I'm
> just trying to figure out how to make it more efficient. Here is my
> situation:
>
> Here's my inventory:
> 1. I have 1000 jpg images taken from a vga frame grabber - NOT in frames per
> second... the timing is variable. For example, file1.jpg was grabbed at
> 30ms, file2.jpg was grabbed at 400ms, file3.jpg at 410ms, an so on. The time
> starts from Time == 0ms when the frame grabber was turned on.
>
> 2. I have an XML file called capture.xml that contains the timestamp in
> milliseconds for when each jpg was captured:
>
> <Capture>
> <FileName>Slide_0020.jpg</FileName>
> <SlideNumber>20</SlideNumber>
> <CaptureTime>64174</CaptureTime>
> </Capture>
> <Capture>
> <FileName>Slide_0021.jpg</FileName>
> <SlideNumber>21</SlideNumber>
> <CaptureTime>64869</CaptureTime>
> </Capture>
>
> So....
> By putting all the jpg files together into a SWF via swfmill, I should have
> a fairly descent "flipbook" type animation. I've created a perl script to
> parse the capture.xml file and creates a swfml file that looks like this:
>
> <?xml version="1.0" encoding="iso-8859-1" ?>
> <movie width="640" height="480" framerate="15">
> <background color="#ffffff"/>
> <frame>
> <!-- frame:0 ptime:54 -->
> <library>
> <clip id="image1"
> import="Slide_0001_Full_resize.jpg" />
> </library>
> <place id="image1" name="myImage1" x="0" y="0" depth="1" />
> </frame>
> <frame/><frame/><frame/><frame/><frame/><frame/><frame>
> <!-- frame:6 ptime:408 -->
> <library>
> <clip id="image2"
> import="Slide_0002_Full_resize.jpg" />
> </library>
> <place id="image2" name="myImage2" x="0" y="0" depth="2" />
> </frame>
> <frame/><frame/><frame/><frame/><frame/><frame>
> <!-- frame:11 ptime:752 -->
> <library>
> <clip id="image3"
> import="Slide_0003_Full_resize.jpg" />
> </library>
> <place id="image3" name="myImage3" x="0" y="0" depth="3" />
> </frame>
>
> .....
>
> Right now this is klunky because I'm trying to convert the millisecond
> timestamp into frames per second. For example, if I want to run this
> animation at 10fps, I know that the jpg captured at 100ms will appear in
> frame 1 and so on (is that right??). So what happens in between each
> frame... if file1.jpg is captures at 10seconds before file2.jpg, I just
> stick (10x10) 100 <frame /> tags as filler in between the two images. There
> must be a better way than this. Also, since I'm converting from
> milliseconds to frames per second... I think I'm losing a lot of precision.
>
> How could I create this "flipbook" effect, given the inventory above using
> swfmill simple?
>
> I think this is a pretty interesting problem and I really wanted to thank
> the creators of swfmill... it's a great solution to this type of thing. I
> was orginally trying to create an AVI file from this series of jpg files,
> but it got way too complicated for me.
>
> Looking forward to some suggestions!!
>
> Seth
>
>
>
>
> _______________________________________________
> swfmill mailing list
> swfmill at osflash.org
> http://osflash.org/mailman/listinfo/swfmill_osflash.org
>
>
More information about the swfmill
mailing list