Project Description

jvp8 is a dual-licensed commercial/GPL native wrapper which allows Java applications to easily use the VP8 video codec, a high quality, royalty free, open source codec. For more information about VP8, visit www.webmproject.org. To contact the jvp8 team, visit www.frozenmountain.com.

Compatibility

  • Windows x86/x64
  • Linux x86/x64

Pending Compatibility

  • Android arm (upload libvpx.so to "lib/armeabi")
  • Mac OS X x86/x64/PPC (upload libvpx.dylib to "lib/darwin_universal")
  • Solaris x86 (upload vpx.so to "lib/sunos_x86")

Usage

jvp8 provides two classes: Encoder and Decoder. Create an Encoder to convert bitmaps into VP8 frames, or create a Decoder to convert VP8 frames into bitmaps.

Encoding

class EncodingSession
{
    private Encoder encoder;
    
    public EncodingSession(int width, int height, int fps) throws Exception
    {
        encoder = new Encoder(width, height, fps);
    }
    
    public Byte[] encode(VideoFrame image) throws Exception
    {
        return encoder.Encode(image.rgb);
    }
}

Decoding

class DecodingSession
{
    private Decoder decoder;
    private int width;
    private int height;
    
    public DecodingSession(int width, int height) throws Exception
    {
        decoder = new Decoder(width, height);
        this.width = width;
        this.height = height;
    }
    
    public VideoFrame decode(Byte[] encodedData) throws Exception
    {
        VideoFrame image = new VideoFrame(width, height, new int[width * height]);
        decoder.Decode(encodedData, image.rgb);
        return image;
    }
}

Credits

jvp8 is developed and maintained by Frozen Mountain Software. If you are interested in using jvp8 in a commercial application, please let us know.

jvp8 uses bridj (BSD-licensed) for Java/native interoperability.

The source code example uses the JUV Webcam SDK to access raw camera frames. For licensing information, visit www.smaxe.com.

Last edited Nov 19, 2012 at 11:13 PM by antonvenema, version 13