MASON-INTEREST-L Archives

November 2005

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Sean Luke <[log in to unmask]>
Reply To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Date:
Thu, 3 Nov 2005 10:26:20 -0500
Content-Type:
multipart/mixed
Parts/Attachments:
text/plain (854 bytes) , MovieEncoder.java (19 kB) , text/plain (19 kB)
On Nov 3, 2005, at 8:50 AM, Anja Colgan wrote:

> I'm trying to write BufferedImages to a videofile and came across the
> MovieEncoder.  It works brilliantly, except that the last of the
> images does not appear in the movie file.

Good catch, Anja!  I believe the problem is that the underlying
MovieDataStream thread spin-waits for 25ms and on read it first
checks to see if we've told it to finish, at which time it shuts down
and cleans up.  Which means if you added an image and called stop(),
all within 25ms, it may not bother grabbing the last image and
instead will just clean up.  We never see this problem in MASON
because the simulation drawing time generally exceeds that.

I think I've fixed it -- before we check for finishing we first see
if there's anything in the buffer left to write.  Tell me if you find
any problems with the following code revision:




Sean

ATOM RSS1 RSS2