use of org.bytedeco.javacv.FrameFilter in project javacv by bytedeco.
the class DeinterlacedVideoPlayer method start.
public void start() {
FrameFilter filter = null;
try {
startFrameGrabber();
Frame frame = null;
while ((frame = grabber.grab()) != null) {
if (filter == null) {
filter = new FFmpegFrameFilter(ffmpegString, frame.imageWidth, frame.imageHeight);
filter.setPixelFormat(PIXEL_FORMAT);
filter.start();
}
filter.push(frame);
frame = filter.pull();
// do something with the filtered frame
}
} catch (Exception | org.bytedeco.javacv.FrameFilter.Exception e) {
throw new RuntimeException(e.getMessage(), e);
} finally {
releaseGrabberAndFilter(this.grabber, filter);
}
}
Aggregations