Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

From rendering 2D Java to Flash

Tags:

java

video

Is there a way to render 2d graphics to flash. And if not directly to flash, is there a way to render 2d graphics to a some video format in Java?

Ideally, I don't want to do motion capture the swing application, I want to use the Java libraries to render the video.

The graphics might include something simple, a colored rectangle moving across the screen.

What are the key technologies for doing this?

like image 844
Berlin Brown Avatar asked May 29 '11 21:05

Berlin Brown


1 Answers

In answer to a similar earlier question Xuggler was mentioned as a way of encoding video from a sequence of images. I haven't seen anything in Java to actually capture graphics as a video stream.

I've just found the QuickTimeWriter class used in Werner Randelshofer's CubeTwister application. The example code in the Javadoc doesn't quite work out of the box, but I did manage to hack together some code to generate a movie from one of my existing Swing demo applications by "printing" my JComponent to a BufferedImage at regular intervals. There may be a better way but it works as a proof of principle.

You should check the conditions if reusing the code, but if I understand correctly he is making the it available under a Creative Commons Attribution licence.

like image 62
Ben Avatar answered Oct 18 '22 04:10

Ben