Package org.opensourcephysics.media.core
Interface VideoRecorder
- All Known Implementing Classes:
GifVideoRecorder
,ImageVideoRecorder
,ScratchVideoRecorder
,XuggleVideoRecorder
public interface VideoRecorder
This defines methods for creating a video from a series of images.
- Version:
- 1.0
- Author:
- Douglas Brown
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a video frame to the current video.void
Creates a new video to which frames can be added.void
createVideo
(String fileName) Creates a new video with the specified file name.void
createVideo
(String fileName, String trkPath) Creates a new video with the specified file name.getCodec()
Gets the current file name.getVideo()
Gets the current video.void
reset()
Discards the current video and resets the recorder to a ready state.Saves the video to the current file.Saves the video to the specified file.Saves the video to a file selected with a chooser.void
setFileName
(String path) Sets the file name.void
setFrameDuration
(double millis) Sets the time duration per frame for subsequent added frames.void
Sets the size of the video.
-
Method Details
-
createVideo
Creates a new video to which frames can be added.- Throws:
IOException
-
createVideo
Creates a new video with the specified file name.- Parameters:
fileName
- name of the file to which the video will be written- Throws:
IOException
-
createVideo
Creates a new video with the specified file name.- Parameters:
fileName
- name of the file to which the video will be written- Throws:
IOException
-
setSize
Sets the size of the video.- Parameters:
dimension
- the dimensions of the new video
-
setFrameDuration
void setFrameDuration(double millis) Sets the time duration per frame for subsequent added frames.- Parameters:
millis
- the duration per frame in milliseconds
-
addFrame
Adds a video frame to the current video.- Parameters:
image
- the image to be drawn on the video frame.- Throws:
IOException
-
getVideo
Gets the current video. Ends editing.- Returns:
- the active video as a Video object
- Throws:
IOException
-
saveVideo
Saves the video to the current file.- Returns:
- the full path of the saved file
- Throws:
IOException
-
saveVideo
Saves the video to the specified file.- Parameters:
fileName
- the file name to be saved- Returns:
- the full path of the saved file
- Throws:
IOException
-
saveVideoAs
Saves the video to a file selected with a chooser.- Returns:
- the full path of the saved file
- Throws:
IOException
-
getFileName
String getFileName()Gets the current file name. May be null.- Returns:
- the path of the current destination video file
-
setFileName
Sets the file name. May be null.- Parameters:
path
- the file name
-
reset
void reset()Discards the current video and resets the recorder to a ready state. -
getCodec
String getCodec()
-