MASON-INTEREST-L Archives

March 2013

MASON-INTEREST-L@LISTSERV.GMU.EDU

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

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

Print Reply
Mime-Version:
1.0
Sender:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Subject:
From:
"Jose V. Trigueros" <[log in to unmask]>
Date:
Thu, 14 Mar 2013 16:00:25 -0400
Content-Transfer-Encoding:
8bit
Content-Type:
text/plain; charset="ISO-8859-1"
Reply-To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Parts/Attachments:
text/plain (29 lines)
Right, I was going to follow up and say that ImageToBuffer in
MovieEncoderDataStream.write creates an int array out of the image data. So
using any other format that is not raw RGB will break the QuickTimeMux.

I presume this is the reason why you can only play output videos on a Mac.
QuickTime is the only player that can understand the raw RGB format. 

Doing the following in MovieEncoderDataStream.write, converts the Image to a
byte[]

        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        Buffer b = new Buffer();
        try
        {
            ImageIO.write((BufferedImage) i,"JPG",stream);
            stream.flush();
            b.setData(stream.toByteArray());
            b.setLength(((byte[]) b.getData()).length);
        } catch (IOException e)
        {
            e.printStackTrace();
        }

This is very specific to converting to using a byte[] only, but I guess some
logic could be added to figure out what encodeFormat is using (
Format.byteArray or Format.intArray ).

Does that make sense?

ATOM RSS1 RSS2