Serg
Serg

Reputation: 14098

Streaming Java Swing animation as video

I have a desktop Java Swing application. It consists from a single window and visualizes some animation. I fully control the animation in public void paintComponent(final Graphics g);

How to make it possible to watch it remotely from a web browser as a video steaming? What third party software do I need to create a video stream, transmit it, and view it?

Upvotes: 2

Views: 324

Answers (1)

Sage
Sage

Reputation: 15408

  1. draw the painting of the paintComponent(g) into an BufferedImage
  2. Write the image using ImageIO in sequence, one after another
  3. use FFMPEG to generate video from the image. I don't think you can stream online; writing image and streaming at the same time.

Upvotes: 2

Related Questions