/** * Get frame at a specified frame number as JCodec image * * @param file * @param second * @return * @throws IOException * @throws JCodecException */ public static Picture getFrameFromChannel(SeekableByteChannel file, int frameNumber) throws JCodecException, IOException { return createFrameGrab(file).seekToFramePrecise(frameNumber).getNativeFrame(); }
/** * Get frame at a specified second as JCodec image * * @param file * @param second * @return * @throws IOException * @throws JCodecException */ public static Picture getFrameFromChannelAtSec(SeekableByteChannel file, double second) throws JCodecException, IOException { return createFrameGrab(file).seekToSecondPrecise(second).getNativeFrame(); }
public static AWTFrameGrab createAWTFrameGrab(SeekableByteChannel _in) throws IOException, JCodecException { FrameGrab fg = FrameGrab.createFrameGrab(_in); return new AWTFrameGrab(fg.getVideoTrack(), fg.getDecoder()); }
/** * Get frame at a specified second as JCodec image * * @param file * @param second * @return * @throws IOException * @throws JCodecException */ public static Picture getFrameAtSec(File file, double second) throws IOException, JCodecException { FileChannelWrapper ch = null; try { ch = NIOUtils.readableChannel(file); return createFrameGrab(ch).seekToSecondPrecise(second).getNativeFrame(); } finally { NIOUtils.closeQuietly(ch); } }
/** * Get frame at a specified frame number as JCodec image * * @param file * @param second * @return * @throws IOException * @throws JCodecException */ public static Picture getFrameFromFile(File file, int frameNumber) throws IOException, JCodecException { FileChannelWrapper ch = null; try { ch = NIOUtils.readableChannel(file); return createFrameGrab(ch).seekToFramePrecise(frameNumber).getNativeFrame(); } finally { NIOUtils.closeQuietly(ch); } }