If the goal is to record what goes on in a Java application, I made a
little program that ties into the RepaintManager so it only captures
the necessary part of the window. This dramatically speeds up the
performance.
In my limited testing, this appears to fail for tooltips and
comboboxes. (Apparently they don't get calls to repaint when they're
first made visible? Maybe the solution is to try listening for
ComponentEvent's to see when a component is shown?)
Also I often get 40-50 fps, so I'd want to put an upper limit on how
many frames I record in a given second.
So it still needs a little work, but here's the current copy (source
included):
http://homepage.mac.com/bricolage1/ScreenCapture.jar
Also I put an artificial cursor in the screenshots. A future version
might include two icons for the cursor: one for a normal mouse, and
one when the mouse is pressed.
Any feedback is encouraged. If people find it useful, I may write it
up and give it decent documentation. :)
Regards,
- Jeremy
P.S. Also I have some QTJ code that can capture the monitor without
using a Robot. At least on Mac. If anyone is interested in that I
could dust it off... but I think I prefer using the Robot for now.
On May 31, 2008, at 8:30 PM, Alessandro Borges wrote:
> Hi,
>
> This code snippet may lead you to wrong assumptions.
> As Robot always create a new Image it consumes a lot of memory. So
> you are measuring the frame capture and a lot of GC work.
> Give enough memory and it will work a little better.
>
> But you are right about the 20FPS question. I´m getting 17.5 - 18.0
> fps in an AMD 3800 dual core.
> As I'm saving it as 1/4 of original size, there is a substantial
> reduction in compression work.
>
> I put a QT movie sample of this running in the link below :
> http://paginas.terra.com.br/educacao/alessandroborges/Movie.html
>
> Regards,
> Alessandro
>
>
>
>
> ----- Mensagem original ----
> De: Alex Shaykevich <email@hidden>
> Para: Alessandro Borges <email@hidden>; email@hidden
> Enviadas: Sábado, 31 de Maio de 2008 15:36:56
> Assunto: Re: Recording the monitor content
>
> No need to be sorry. However, here is a test case I just wrote.
> The following code produced a capture rate of roughly 20fps
> capturing less than my fullscreen resolution running on a 2.2 GHz
> Core 2 Duo under WinXP SP2 and JDK1.5.
>
> That's only for image capture using Robot without any sort of
> compression to video. There's no way I would get 20fps on this
> reasonably fast machine including video compression and file IO
> using Robot.
>
> --Alex
>
>
> public class TestRobot {
>
> public static void main(String args[]) {
> try {
> Robot r = new Robot();
>
> long now = System.currentTimeMillis();
> int num = 1000;
> for (int i = 0; i < num; i++) {
> Image im = r.createScreenCapture(new Rectangle(1280,
> 1050));
> }
> System.out.println("FPS: " + num / ((double)
> (System.currentTimeMillis() - now) / 1000.0));
>
> } catch (AWTException ex) {
>
> Logger.getLogger(TestRobot.class.getName()).log(Level.SEVERE, null,
> ex);
> }
>
>
> }
> }
>
>
> Abra sua conta no Yahoo! Mail, o único sem limite de espaço para
> armazenamento! _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> QuickTime-java mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/quicktime-java/email@hidden
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-java mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-java/email@hidden
This email sent to email@hidden