Xuggle: To encode, decode, and generally juggle audio and video files in any way that you want.


com.xuggle.ferry A collection of classes that ferry objects from Java to native code and back, and manage native memory.
com.xuggle.mediatool A simple API for to decoding, viewing and encoding media: tutorial here; start with ToolFactory.
com.xuggle.mediatool.demos MediaTool Demonstration applications used by the MediaTool tutorials.
com.xuggle.mediatool.event Events that can be fired by the com.xuggle.mediatool package.
com.xuggle.xuggler An advanced API for reading, decoding, re-sampling, encoding and writing of most media files.
com.xuggle.xuggler.demos A collection of demonstration applications for the Xuggler API.
com.xuggle.xuggler.io An API for extending Xuggler to read and write from arbitrary data sources.
com.xuggle.xuggler.video A collection of utilities for working with Video in the Xuggle libraries.


Xuggle: To encode, decode, and generally juggle audio and video files in any way that you want.

MediaTool: Decoding, Encoding and View Media Files the Easy Way

The MediaTool API is a simple API that uses Xuggler behind the scenes, but allows you to extract pictures and audio from media files without being a complete Xuggler expert.

How simple? Here's some code to open a MPEG video file, convert it to an Adobe Flash Video file:

IMediaReader reader = ToolFactory.newReader("input.mpg");
reader.addListener(ToolFactory.newWriter("output.flv", reader));
while (reader.readPacket() == null)

And if for some reason, you want access to the underlying Xuggler objects, it'll let you at them too.

See com.xuggle.mediatool for the Java doc or MediaTools Introduction for a full tutorial.

Xuggler: Decode, Encode and Experience Video

Sometimes you need to get at the raw bits and bytes. For that, there's Xuggler: A Java Library for encoding and decoding pretty much any Internet available audio or video file. See com.xuggle.xuggler

This Java library is a wrapper around the excellent FFMPEG libav* libraries. It allows Java developers (after installing the Xuggler native libraries) to encode and decode video files, but in a very Java-like way (i.e. automatic garbage collection, and fewer ways to cause bad crashes).

Read more about the details here or jump straight to the com.xuggle.xuggler.Converter program source code for an example of Xuggler converting a media file.

Xuggler IO: When you need your own IO

A Java Library for allowing people to plug in custom data sources for Xuggler to use. See com.xuggle.xuggler.io

Xuggler uses FFMPEG's libav libraries to do the encoding and decoding of fils. By default FFMPEG can read files, and some other protocols (like http), but it implements all IO itself.

Fortunately FFMPEG comes with a way to extend the data sources it can read; unfortunately it's a call back mechanism. Still, the Xuggler IO library allows you to implement IO callbacks for FFMPEG in the language of your choice (Java) as opposed to native C code.

See the FileProtocolHandler for a Java example of this (really just re-implements FFMPEG's file:// IO for illustration purposes).

Or better yet, check out the Xuggler Red5 Adapter for an example of a Xuggler IO plugin that allows the Red5 Open Source Media Server to decode and re-encode video files on the the fly (really).

Ferry: Bridging the Java / C++ Gap

A set of Java classes for ferrying data to and from native code. See com.xuggle.ferry

SWIG, an excellent utility for wrapping native code for other languages does a lot of great things. But sometimes it can use some help, and that's where this library comes in. This library implements the reference-counting memory scheme (used by the Xuggler package) to allow native code to pass objects in to other languages and relatively seamlessly integrate with their garbage collection systems. It also provides mechanism for allocating memory from the other language (instead of the C++ heap) to help that language keep track of memory, mechanisms for logging in the other language, and mechanisms for allowing the other language to directly modify C++/C memory (if possible). Most people won't use this outside of the Xuggler library, but if you're curious, go digging. It relies HEAVILY on SWIG for a lot of the heavy lifting.


Our intention in open sourcing these libraries is to break down the walls of communication between people. To that end, a lot of these libraries deal with getting at raw data for different systems, and for helping people to share and create cool stuff using that data.

That said, it is not our intent to encourage people to use these libraries for illegal purposes, and we explicitly encourage people to respect the rights of others when they use these libraries.

All Xuggle Open Source Libraries are released under the GNU Limited General Public License v3 (LGPL) . See the COPYING file in each library for details. However, depending on how you compile FFmpeg, Xuggler may become GPL (basically if you're making a GPL version of FFmpeg, then Xuggler is GPL as well).

Copyright © 2008, 2010 Xuggle