Posted by methius
on April 18, 2009 at 12:12 PM PDT
Since it's my first post on this forum, I'll try to avoid one of the most common pitfalls and state that:
Yes, I've (intensely) searched through as many forums / sites I could find.
To record a steady 25fps movie, with audio of a Java Application encoded in Xvid.
For the recording and encoding I am succesfully using JMF.
What's the problem then?
The recording of (eg. Taking snapshots of the program) is far too slow.
In my current best solution I use a custom RepaintManager to only take snapshots of the "dirty" regions of the screen.
But the process is too slow when I go to resolutions beyond 800x600 and the entire program becomes "dirty".
Take entire snapshot of program
- Java.AWT.Robot, constant time, time is dependant on resolution.
- paintComponent(Graphics g) using BufferedImage, depending on complexity of component, faster than Robot, no problem of increased resolution on simple applications
- printComponent(Graphics g) using BufferdImage, sometimes faster than paint, depends on component complexity
- paint/printComponent(Graphics g) using VolatileImage, extremely fast (0-1ms), as expected as you are copying from another volatileimage (backbuffer). Drawback: going from VolatileImage to BufferedImage is slow (3x as slow as Java.AWT.Robot)
- Take snapshot of dirty region using Java.AWT.Robot, drawback that it's too slow if a full repaint is called
+ You get inconsistencies if using a scrollpanel.
Can I directly hook into the VolatileImage / BufferedImage of the BackBufferStrategy, a feature which was to be implemented according to this post: http://forums.java.net/jive/message.jspa?messageID=41182#41182 , dating back to 2003. (Haven't found anything in the BackbufferStrategy API)
Is there a fast(er) way to transform a VI into a BI besides VI.getSnapshot() or BI.getGraphics.drawImage(VI)?
Can I adapt the RepaintManager to use the paint/print function and still only print a small part of the program? print and paint seem to ignore the Graphics.setClip()
Are there any other solutions to this problem?
Any help would be greatly appreciated because I am at the end of my latin.
Screen capture, Screen recording, Screenshot, java.awt.Robot, paint, paintComponent, print, printComponent, BufferedImage, VolatileImage, RepaintManager