The next task is to monitor the screen, record the event (the measurement text field turns green) and record all the events leading to it, creating a “movie” of the events leading to it. Unfortunately, the entire screen needs to be recorded. I have so far fulfilled the role in which recognition takes part. However, I barely get two frames per second. I would like to have about 25 to 30 fps .
My idea was to write and read in two separate streams. Because a recording event is rare and can be performed in the background , a recording event may take longer and run faster. Unfortunately, all this seems too slow. I would like to be able to write a screen to disk at intervals of 10 to 20 seconds before .
Edit: If possible, I would like to remain as platform independent as possible.
Edit 2: it seems that for Xuggler there is a platform-independent jar file. Unfortunately, I really don't understand how I can use it for my purpose: recording 20 seconds until the moment when isarecord starts.
Here is what I have done so far:
package fragrecord; import java.awt.AWTException; import java.awt.Color; import java.awt.Dimension; import java.awt.Rectangle; import java.awt.Robot; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import javax.imageio.ImageIO; public class Main { public static void main(String[] args) {
source share