/** * Get a specified frame by number from an already open demuxer track * * @param vt * @param decoder * @param frameNumber * @return * @throws IOException * @throws JCodecException */ public static BufferedImage getFrame(SeekableDemuxerTrack vt, ContainerAdaptor decoder, int frameNumber) throws IOException, JCodecException { return ((AWTFrameGrab) new AWTFrameGrab(vt, decoder).seekToFramePrecise(frameNumber)).getFrame(); }
/** * Get a specified frame by number from an already open demuxer track ( * sloppy mode, i.e. nearest keyframe ) * * @param vt * @param decoder * @param frameNumber * @return * @throws IOException * @throws JCodecException */ public static BufferedImage getFrameSloppy(SeekableDemuxerTrack vt, ContainerAdaptor decoder, int frameNumber) throws IOException, JCodecException { return ((AWTFrameGrab) new AWTFrameGrab(vt, decoder).seekToFrameSloppy(frameNumber)).getFrame(); }
/** * Get a specified frame by second from an already open demuxer track * * @param vt * @param decoder * @param frameNumber * @return * @throws IOException * @throws JCodecException */ public static BufferedImage getFrame(SeekableDemuxerTrack vt, ContainerAdaptor decoder, double second) throws IOException, JCodecException { return ((AWTFrameGrab) new AWTFrameGrab(vt, decoder).seekToSecondPrecise(second)).getFrame(); }
/** * Get a specified frame by second from an already open demuxer track ( * sloppy mode, i.e. nearest keyframe ) * * @param vt * @param decoder * @param frameNumber * @return * @throws IOException * @throws JCodecException */ public static BufferedImage getFrameSloppy(SeekableDemuxerTrack vt, ContainerAdaptor decoder, double second) throws IOException, JCodecException { return ((AWTFrameGrab) new AWTFrameGrab(vt, decoder).seekToSecondSloppy(second)).getFrame(); }
public static AWTFrameGrab createAWTFrameGrab(SeekableByteChannel _in) throws IOException, JCodecException { FrameGrab fg = FrameGrab.createFrameGrab(_in); return new AWTFrameGrab(fg.getVideoTrack(), fg.getDecoder()); }