5

We are considering writing a software in Java that records whats monitor for certain durations of time while it is running. Do you have any suggestions on how to efficiently capture the monitor output?

The less CPU it takes the more often we can capture the screen and the smoother a video we can generate without interfering with the other apps that are running.

An existing Open Source program in Java would work if it is not too difficult to copy out the screen capture section. I hope it won't require a call to another programming language. We will see.

Buhake Sindi
  • 87,898
  • 29
  • 167
  • 228
700 Software
  • 85,281
  • 83
  • 234
  • 341

4 Answers4

4

I'm not sure if you'll need a framework.

Check out the documentation for the java.awt.Robot class, specifically the createScreenCapture method.

http://java.sun.com/javase/6/docs/api/java/awt/Robot.html

700 Software
  • 85,281
  • 83
  • 234
  • 341
Umesh K
  • 13,436
  • 25
  • 87
  • 129
2

One of the best java frameworks is Monte Media Library, but first have a look to this to come up with the idea.

Let me know if it works :)

1

Well with OpenCV you can capture frames and put them in video (i did this for a motion tracking Senior Design project for school) there are a good amount of samples for OpenCV. however Im only familiar with it's C++ bindings, not Java (but there are C,Python libs too)

Does it HAVE to be java? cause using OpenCV to capture video is EXTREMELY easy (it's a matter of simply capturing frame buffers in a loop)

Sorry I wish I had a java related answer.....but figure i'd chime in anyways cause OpenCV is very very handy to use.

edit: http://code.google.com/p/javacv/

JavaCV contains wrappers to the C class ones? might be worth looking at.

  • What C++ syntax would be used to capture a screenshot? The author of JavaCV said he *"deliberately decided to keep as much of the original syntax as possible"*, so the C++ syntax may be useful. – 700 Software Mar 09 '11 at 22:15
0

Java has methods in the Robot class to take screenshots, but it is in no way optimized for creating video.

Is there any reason you cannot link to a platform specific screen capture program?

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
  • Performance is the primary concern. If we are going to develop this program, it will be in Java. And we want to know how well it can perform and how best to go about it. – 700 Software Mar 09 '11 at 19:22