Source code Downloads Documentation Blog

Welcome to JCodec!

JCodec is an open source pure java implementation of video and audio codecs and formats.

Features Roadmap
H.264 ( AVC ) Main profile decoder MP3 decoder/encoder
Apple ProRes decoder and encoder AAC encoder
H264 Baseline profile encoder GPU acceleration on Android and desktop
Matroska ( MKV ) demuxer and muxer
MP4 ( ISO BMF, QuickTime ) demuxer/muxer and tools
MPEG 1/2 decoder ( supports interlace )
MPEG PS/TS demuxer
Java player applet
VP8 encoder
MXF demuxer

Get a single frame ( supports only AVC, H.264 in MP4, ISO BMF, Quicktime container ):

int frameNumber = 150;
BufferedImage frame = FrameGrab.getFrame(new File("filename.mp4"), frameNumber);
ImageIO.write(frame, "png", new File("frame_150.png"));

Get a sequence of frames ( supports only AVC, H.264 in MP4, ISO BMF, Quicktime container ):

double startSec = 51.632;
FrameGrab grab = new FrameGrab(new File("filename.mp4"));;
for (int i = 0; i < 100; i++) {
  ImageIO.write(grab.getFrame(), "png",
    new File(System.getProperty("user.home"), String.format("Desktop/frame_%08d.png", i)));

Encode a sequence of images into MP4 file (h.264 encoder will be used)

import org.jcodec.api.awt.SequenceEncoder;
SequenceEncoder enc = new SequenceEncoder(new File("filename"));
// GOP size will be supported in 0.2
// enc.getEncoder().setKeyInterval(25);
for(...) {
	BufferedImage image = ... // Obtain an image to encode

View full sample >>

Source code:

git clone git://



Download (get both jars to access JavaSE image functions)

jcodec-0.1.9.jar Jar 10/24/2014
jcodec-javase-0.1.9.jar Jar 10/24/2014
jcodec-0.1.9.pom POM 10/24/2014
jcodec-javase-0.1.9.pom POM 10/24/2014

Android Downloads JCodec for Android 09/14/2013 Sample application source code 09/14/2013
jcodec-samples-0.1.7.apk Sample application binary 09/14/2013

August 8 2015.Basic P-frame support in H.264 encoder

September 14 2013.Android version

September 09 2013.Live clip/cat of AVC

August 29 2013.All new JPEG decoder

July 16 2013.VP8 encoder

July 08 2013.MXF container support

June 19 2013.HTML5 streaming framework

May 20 2013.JCodec without dependencies

Apr 01 2013.All new H.264 decoder with Main Profile support

Feb 01 2013. H.264 encoder

Nov 01 2012. MPEG 1/2 decoder

Jul 01 2012. MPEG PS/TS demuxer

Jan 01 2012. MOV muxer/demuxer

Nov 01 2011. ProRes encoder

Oct 01 2011. ProRes decoder

Apr 28 2010. H264 baseline profile

Last updated: August 26 2015