Search in sources :

Example 1 with FrameFilter

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);
    }
}
Also used : Frame(org.bytedeco.javacv.Frame) FFmpegFrameFilter(org.bytedeco.javacv.FFmpegFrameFilter) FFmpegFrameFilter(org.bytedeco.javacv.FFmpegFrameFilter) FrameFilter(org.bytedeco.javacv.FrameFilter) Exception(org.bytedeco.javacv.FrameGrabber.Exception)

Aggregations

FFmpegFrameFilter (org.bytedeco.javacv.FFmpegFrameFilter)1 Frame (org.bytedeco.javacv.Frame)1 FrameFilter (org.bytedeco.javacv.FrameFilter)1 Exception (org.bytedeco.javacv.FrameGrabber.Exception)1