2

I'm trying to capture a video of a currently running swing application from within the application (the user presses a record button to start recording). I'm not sure how to go about creating a video that records "live." I've looked into using Xuggler, but that isn't available for 64-bit windows (on a 64-bit jvm), and that is important for this application. I don't think it would be feasible to save each screen off as images and then stitch them together because the video could run for several minutes resulting in a very large number of images.

Does anyone have any experience with this and can point me to some ideas on how to do this?

thanks, Jeff

Jeff Storey
  • 56,312
  • 72
  • 233
  • 406
  • I found an interesting link related to a live screen capture MOV file using Java. Source is bundled together in the jar file. I haven't tested it in 64-bit Windows yet http://javagraphics.blogspot.com/2008/06/screen-capture-recording-java-apps.html – eee Apr 19 '11 at 01:18

1 Answers1

0

I was also going to suggest using Robot to take screenshots, but as you said, you would need a way of limiting what is captured. Detecting input events like keys and mouse movement could hint at when is a good time to take another screenshot, and perhaps limiting it to 2 frames per second. When stitching the images back together, the only way you could determine the timing is if you named the files using a timestamp format (with milliseconds).

BoffinBrain
  • 6,337
  • 6
  • 33
  • 59
  • "the only way you could determine the timing is if you named the files using a timestamp format" While that may be easy, it is not the **only** way the times can be stored. "I was also going to suggest using Robot to take screenshots, but as you said, you would need a way of limiting what is captured." By 'limit' do you mean the area of the screen, the time, ..what? – Andrew Thompson Apr 19 '11 at 00:51
  • I guess you could also check the file's timestamp, but explicitly naming the files with a formatted date or the milliseconds since the epoch would also be stable. By limit, I meant putting an upper limit on the number of frames captured per second by the robot, so as not to take screenshots until something actually changes. You might need to tap into the main AWT event queue to listen in all mouse and key events to do that. There's also this answer which might help: http://stackoverflow.com/questions/2059309/java-applet-screen-capture-to-a-video – BoffinBrain Apr 19 '11 at 09:28