/** * 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(); }
/** * 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 Picture getNativeFrameAtSec(SeekableDemuxerTrack vt, ContainerAdaptor decoder, double second) throws IOException, JCodecException { return new FrameGrab(vt, decoder).seekToSecondPrecise(second).getNativeFrame(); }
/** * 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); } }