tags:

views:

81

answers:

2

I'm looking to write a screen recording application for both Mac and Windows. It doesn't necessarily need to be the same app written for both, it can be two different applications written for each.

What is the best language to write one in? I want to achieve at least 12 FPS. Thanks!

+1  A: 

I would use Java. You can then use the same code for Mac and Windows, which should save you effort in the long run, and avoid the necessity to write code for two platform APIs.

You don't mention the type of hardware you are running on, or the screen resolution, but I profiled Java's screen capture, and got 25fps running on a 3GHz cpu on Windows at 1920x1440 32-bit. (It was a 4-core machine, but the test used only 1 core.)

In Java, you capture the scren like this:

BufferedImage screencapture = new Robot().createScreenCapture(
           new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()) );

You may want to consider how you deal with the uncompressed data. It's a fairly large data throughput - 12 ftps is ca 100MB/s at 1920x1440. You'll need some pretty decent hardware to maintain a steady rate of 100MB/s. Of course, compressing the screen captures is one option, e.g. using a video encoder.

mdma
The author will have to implement more operations besides pure screen capture like IO and maybe other algorithms. Author should also be concerned about how performance will be affected with all needed aspects of such an application, and whether the language chosen will still hold up under those additional circumstances. Sounds like byte code is already nearing the line with just screen capture operation.
John K
That's an uncorroborated statement about performance. I won't take the full argument here, but will mention that bytecode can execute as fast as native code (I have written a MP3 player in java which was comparible with native perfomance and that was 10 years ago - jvm technology has improved considerably in the meantime), For the really heavy lifting, java drops down to native code. The scren capture is in native code, and direct I/O is available that minimizes data copies. The java media framework also offers native encoding of video. All considered, 12 fps is clearly feasible in java.
mdma
The problem I've had with Java is that I'm only able to get 2-3 FPS on a Windows XP machine with 512mb RAM. Do you guys have any thoughts/tips about that?
James Skidmore
No idea about your Java performace without knowing more details - could be java, could be drivers/hardware. If I were in your position, I'd code up a little screen capture test in all your potential languages/frameworks (Java, Qt, direct Windows/mac OS calls etc.) Not only will you then get a rough idea about performance (and some indication by comparison between them if it's the hardware or the language that is slowing it down), but also a feel for the coding side of things. "Suck it and see", as they say in England! Then you'll really know what you're getting.
mdma
+1  A: 

You might want to look into Qt framework. It's based on C++ but has python (and other) bindings for it as well.

P.S.: Oh, forgot to mention that it works on Mac, Windows, Linux and even some phone OS's.

Pilgrim