Package trackers
Class ScreenRecorder
java.lang.Object
trackers.ScreenRecorder
This class is the screen recorder.
-
Field Summary
Modifier and TypeFieldDescriptionprivate int
This variable indicates the current clip number.private com.opencsv.CSVWriter
private String
private int
This variable indicates the current frame number.(package private) int
This variable indicates the frame rate of the screen recorder.private org.bytedeco.javacv.FrameGrabber
private static ScreenRecorder
(package private) boolean
private org.bytedeco.javacv.FrameRecorder
(package private) int
This variable indicates the state of the screen recorder. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
Create the encoder usingFFmpegFrameGrabber
andFFmpegFrameRecorder
.static ScreenRecorder
void
Pause recording the screen.private void
Record the screen.void
Resume recording the screen.void
setDataOutputPath
(String dataOutputPath) Set the data output path.void
Start recording the screen.void
Stop recording the screen.
-
Field Details
-
state
int stateThis variable indicates the state of the screen recorder. 0: initial state; only startAction enabled 1: started, not paused; stopAction and pauseAction enabled 2: started, paused; only resumeAction enabled -
frameRate
int frameRateThis variable indicates the frame rate of the screen recorder. -
recorder
private org.bytedeco.javacv.FrameRecorder recorder -
grabber
private org.bytedeco.javacv.FrameGrabber grabber -
timeList
-
csvWriter
private com.opencsv.CSVWriter csvWriter -
isRecording
boolean isRecording -
clipNumber
private int clipNumberThis variable indicates the current clip number. -
frameNumber
private int frameNumberThis variable indicates the current frame number. -
dataOutputPath
-
instance
-
-
Constructor Details
-
ScreenRecorder
public ScreenRecorder()
-
-
Method Details
-
getInstance
-
createEncoder
Create the encoder usingFFmpegFrameGrabber
andFFmpegFrameRecorder
.- Throws:
IOException
-
startRecording
Start recording the screen. Reset the clip number and invokerecordScreen()
.- Throws:
IOException
-
stopRecording
Stop recording the screen. Write the time list to the CSV file.- Throws:
IOException
-
pauseRecording
Pause recording the screen. Write the time list to the CSV file and increment the clip number.- Throws:
IOException
-
resumeRecording
public void resumeRecording()Resume recording the screen. InvokerecordScreen()
. -
recordScreen
Record the screen. UseTimer
to schedule the recording with the given frame rate.- Throws:
AWTException
IOException
-
setDataOutputPath
Set the data output path.- Parameters:
dataOutputPath
- The data output path.
-