Package trackers
Class ScreenRecorder
java.lang.Object
trackers.ScreenRecorder
This class is the screen recorder.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intThis variable indicates the current clip number.private com.opencsv.CSVWriterprivate Stringprivate intThis variable indicates the current frame number.(package private) intThis variable indicates the frame rate of the screen recorder.private org.bytedeco.javacv.FrameGrabberprivate static ScreenRecorder(package private) booleanprivate org.bytedeco.javacv.FrameRecorder(package private) intThis variable indicates the state of the screen recorder. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidCreate the encoder usingFFmpegFrameGrabberandFFmpegFrameRecorder.static ScreenRecordervoidPause recording the screen.private voidRecord the screen.voidResume recording the screen.voidsetDataOutputPath(String dataOutputPath) Set the data output path.voidStart recording the screen.voidStop 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 usingFFmpegFrameGrabberandFFmpegFrameRecorder.- 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. UseTimerto schedule the recording with the given frame rate.- Throws:
AWTExceptionIOException
-
setDataOutputPath
Set the data output path.- Parameters:
dataOutputPath- The data output path.
-