[swfmill] newbie: creating animation from a series of jpg files various timings

Mark Winterhalder mark13 at gmail.com
Mon Mar 5 05:00:00 EST 2007


> 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.

I don't know if you're familiar with the timeline in the Flash IDE,
but this is exactly how Flash would do it. Each image would be in a
keyframe, followed by frames until it's time for the next. There is
nothing wrong with that, except the loss of precision you already
mentioned.

A small improvement would be to always use the same depth. What's
currently happening is that the next image gets placed on top of the
previous one. If you use the same depth, it will replace it, so you
won't end up with 1000 images stacked on top of each other.
Another thing I would change is the library tag -- you don't need it,
unless you want to place the images by script.

Mark



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