avpkit-core
MediaTool: Decoding, Encoding and View Media Files the Easy Way
The MediaTool API is a simple API that uses AVPKit behind the scenes, but allows you to extract pictures and audio from media files without being a complete AVPKit 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 AVPKit objects, it'll let you at them too.
See com.avpkit.mediatool for the Javadoc
AVPKit: Decode, Encode and Experience Video
Sometimes you need to get at the raw bits and bytes. For that, there's AVPKit: A Java Library for processing (decoding, encoding, filtering) pretty much any Internet available audio or video file. Seecom.avpkit.core
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.avpkit.core.Converter program source code for an example of
AVPKit converting a media file.
AVPKit IO: When you need your own IO
A Java Library for allowing people to plug in custom data sources for AVPKit to use. Seecom.avpkit.core.io
AVPJit 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 AVPKit 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).
Ferry: Bridging the Java / C++ Gap
A set of Java classes for ferrying data to and from native code. Seecom.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 AVPKit 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 AVPKit library, but if you're curious, go digging. It
relies HEAVILY on SWIG for a lot of the heavy lifting.
Licensing
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 AVPKit Open Source Libraries are released under the GNU Lesser General Public License v3 (LGPL) . See the COPYING file in each library for details. However, depending on how you compile FFmpeg, AVPKit may become GPL (basically if you're making a GPL version of FFmpeg, then AVPKit is GPL as well).
| Package | Description |
|---|---|
| com.avpkit.core |
An advanced API for reading, decoding, re-sampling, encoding and writing
of most media files.
|
| com.avpkit.core.demos |
A collection of demonstration applications for the AVPKit API.
|
| com.avpkit.core.io |
An API for extending AVPKit to read and write from arbitrary data sources.
|
| com.avpkit.core.video |
A collection of utilities for working with Video in the AVPKit libraries.
|
| com.avpkit.ferry |
A collection of classes that ferry objects from Java to native code and back,
and manage native memory.
|
| com.avpkit.mediatool |
A simple API for to decoding, viewing and encoding media:
tutorial here; start with
ToolFactory. |
| com.avpkit.mediatool.demos |
MediaTool Demonstration applications
used by the MediaTool tutorials.
|
| com.avpkit.mediatool.event |
Events that can be fired by the
com.avpkit.mediatool package. |