I
- The type of video frames to be cachedpublic class VideoCache<I extends Image<?,I>> extends VideoWriter<I>
frameRate, height, width
Constructor and Description |
---|
VideoCache(int width,
int height,
double frameRate)
Create a video cache for frames of the given size and for a video
of the given frame rate.
|
Modifier and Type | Method and Description |
---|---|
void |
addFrame(I frame)
Add a frame to the video stream.
|
static <I extends Image<?,I>> |
cacheVideo(Video<I> video)
Cache the whole of the given video.
|
static <I extends Image<?,I>> |
cacheVideo(Video<I> video,
VideoTimecode start,
VideoTimecode end)
Cache the given time range from the given video.
|
ArrayBackedVideo<I> |
getArrayBackedVideo()
Returns an
ArrayBackedVideo for the frames in this cache. |
I |
getFrame(int i)
Returns the frame at the given index.
|
int |
getNumberOfFrames()
Returns the number of frames that have been cached.
|
void |
reset()
Clears the cache.
|
getFPS, getTimeStamp, processFrame
countFrames, getCurrentFrame, getHeight, getNextFrame, getWidth, hasNextFrame, process, process, processingComplete
close, getCurrentFrameIndex, iterator, seek, setCurrentFrameIndex
public VideoCache(int width, int height, double frameRate)
width
- The width of the video framesheight
- The height of the video framesframeRate
- The frame rate of the videopublic void addFrame(I frame)
addFrame
in class VideoWriter<I extends Image<?,I>>
frame
- The frame to add to the video streamVideoWriter.addFrame(org.openimaj.image.Image)
public ArrayBackedVideo<I> getArrayBackedVideo()
ArrayBackedVideo
for the frames in this cache.ArrayBackedVideo
public int getNumberOfFrames()
public I getFrame(int i)
i
- The index to get the frame frompublic void reset()
reset
in class VideoProcessor<I extends Image<?,I>>
VideoProcessor.reset()
public static <I extends Image<?,I>> VideoCache<I> cacheVideo(Video<I> video)
I
- Type of Image
video
- The video to cacheVideoCache
public static <I extends Image<?,I>> VideoCache<I> cacheVideo(Video<I> video, VideoTimecode start, VideoTimecode end)
I
- The type of the video framesvideo
- The video to cachestart
- The start of the video to cacheend
- The end of the video to cacheVideoCache