T
- Type of Image
public abstract class VideoWriter<T extends Image<?,T>> extends VideoProcessor<T>
The addFrame(Image)
method must be overridden by implementing
subclasses to actually perform the encoding and writing of the video frame.
The class is an extension of a video processor which allows the writer
to act in a processing chain. The implementation of the VideoProcessor
interface calls the addFrame(Image)
method for every frame that
is passed in the processor.
Modifier and Type | Field and Description |
---|---|
protected double |
frameRate
The frame rate at which written videos will be replayed
|
protected int |
height
The height of the video frames in pixels
|
protected int |
width
The width of the video frames in pixels
|
Constructor and Description |
---|
VideoWriter(int width,
int height,
double frameRate)
Default constructor that takes the frame rate at which the written
video will be replayed.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
addFrame(T frame)
Add a frame to the video stream.
|
double |
getFPS()
Get the frame rate
|
long |
getTimeStamp()
Get the timestamp of the current frame in milliseconds
|
T |
processFrame(T frame)
Process a frame in this video.
|
countFrames, getCurrentFrame, getHeight, getNextFrame, getWidth, hasNextFrame, process, process, processingComplete, reset
close, getCurrentFrameIndex, iterator, seek, setCurrentFrameIndex
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
protected double frameRate
protected int width
protected int height
public VideoWriter(int width, int height, double frameRate)
width
- The width of the video frames in pixelsheight
- The height of the video frames in pixelsframeRate
- The frame rate in frames per secondpublic abstract void addFrame(T frame)
frame
- The frame to add to the video streampublic T processFrame(T frame)
processFrame
in class VideoProcessor<T extends Image<?,T>>
frame
- The frame to process.VideoProcessor.processFrame(org.openimaj.image.Image)
public long getTimeStamp()
getTimeStamp
in class VideoProcessor<T extends Image<?,T>>
Video.getTimeStamp()
public double getFPS()
getFPS
in class VideoProcessor<T extends Image<?,T>>
Video.getFPS()