在Java中是否有使用CoreAVC的绑定,或者更具体地说,在Java WebStart中有没有绑定?我需要在Java Webstart中解码h.264/AVC。
发布于 2012-12-30 10:23:20
您可以使用http://jcodec.org/。它是纯Java的,因此可以在webstart环境中运行。
发布于 2013-05-17 03:33:26
使用JCodec ( http://jcodec.org )很简单:
FileChannelWrapper ch = null;
try {
ch = NIOUtils.readableFileChannel(new File("path to mp4"));
FrameGrab frameGrab = new FrameGrab(ch);
frameGrab.seek(351.); // important to pass double for a second
BufferedImage frame;
for (int i = 0; (frame = frameGrab.getFrame()) != null && i < 200; i++) {
ImageIO.write(frame, "jpg", new File(String.format("frame%08d.png", i)));
}
} finally {
NIOUtils.closeQuietly(ch);
}https://stackoverflow.com/questions/9904103
复制相似问题