/** * Get frame at a specified second as AWT image * * @param file * @param second * @return * @throws UnsupportedFormatException * @throws IOException */ public static BufferedImage getFrame(SeekableByteChannel file, double second) throws JCodecException, IOException { return ((AWTFrameGrab) createAWTFrameGrab(file).seekToSecondPrecise(second)).getFrame(); }
/** * Get frame at a specified frame number as AWT image * * @param file * @param second * @return * @throws IOException * @throws JCodecException */ public static BufferedImage getFrame(SeekableByteChannel file, int frameNumber) throws JCodecException, IOException { return ((AWTFrameGrab) createAWTFrameGrab(file).seekToFramePrecise(frameNumber)).getFrame(); }
/** * Get frame at a specified frame number as AWT image * * @param file * @param second * @return * @throws IOException * @throws JCodecException */ public static BufferedImage getFrame(File file, int frameNumber) throws IOException, JCodecException { FileChannelWrapper ch = null; try { ch = NIOUtils.readableChannel(file); return ((AWTFrameGrab) createAWTFrameGrab(ch).seekToFramePrecise(frameNumber)).getFrame(); } finally { NIOUtils.closeQuietly(ch); } }
/** * Get frame at a specified second as AWT image * * @param file * @param second * @return * @throws IOException * @throws JCodecException */ public static BufferedImage getFrame(File file, double second) throws IOException, JCodecException { FileChannelWrapper ch = null; try { ch = NIOUtils.readableChannel(file); return ((AWTFrameGrab) createAWTFrameGrab(ch).seekToSecondPrecise(second)).getFrameWithOrientation(); } finally { NIOUtils.closeQuietly(ch); } }