JAVE2
August 14, 2026 · View on GitHub
The JAVE2 (Java Audio Video Encoder) library is Java wrapper on the ffmpeg project. Developers can take take advantage of JAVE2 to transcode audio and video files from a format to another. In example you can transcode an AVI file to a MPEG one, you can change a DivX video stream into a (youtube like) Flash FLV one, you can convert a WAV audio file to a MP3 or a Ogg Vorbis one, you can separate and transcode audio and video tracks, you can resize videos, changing their sizes and proportions and so on.
Many other formats, containers and operations are supported by JAVE2.
Supported Operating Systems + Requirements
JAVE requires Java 8 or higher
JAVE can also be easily ported to other OS and hardware configurations, see the JAVE manual for details.
| Operating System | Windows x32,x64 | MacOS intel x64 | MacOS m1 | Linux x32,x64 | Linux arm32,arm64 |
|---|---|---|---|---|---|
| Supported? | Partial,YES | YES | YES | YES | Partial,YES |
Please note that the arm+win 32 bit versions are still on 4.4.0 and will be removed in a future release The win32 binaries will be removed in the next release
Projects using Jave2
Usage Example
For the documentation, please have a look at the project wiki pages here
or at this file DefaultFFMPEGLocatorTest.java
Maven Repository URL -> https://mvnrepository.com/artifact/ws.schild/jave-all-deps
Use with Maven
It includes all binaries for the supported platforms
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-all-deps</artifactId>
<version>3.5.0</version>
</dependency>
You can use maven dependencies to include the libraries in your projects. Include the following in your pom files.
[ Remember always to check the latest release here ]
Generally if you want to use for one platform or more what you have to do is add the jave-core:
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-core</artifactId>
<version>3.5.0</version>
</dependency>
and then the specific jar(s) for your platform(s) :
For one platform only (Linux 64Bit amd/intel in this case)
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux64</artifactId>
<version>3.5.0</version>
</dependency>
For one platform only (Linux 64Bit arm in this case)
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux-arm64</artifactId>
<version>3.5.0</version>
</dependency>
For one platform only (Linux 32Bit arm in this case)
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux-arm32</artifactId>
<version>3.5.0</version>
</dependency>
For one platform only (Windows 64Bit in this case)
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-win64</artifactId>
<version>3.5.0</version>
</dependency>
For one platform only (MACOS 64Bit in this case)
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-osx64</artifactId>
<version>3.5.0</version>
</dependency>
Use with Gradle
It includes all binaries for the supported platforms
compile group: 'ws.schild', name: 'jave-all-deps', version: '3.5.0'
For one platform only (Linux 64Bit in this case)
compile group: 'ws.schild', name: 'jave-core', version: '3.5.0'
compile group: 'ws.schild', name: 'jave-nativebin-linux64', version: '3.5.0'
Main Components of Jave2
Jave2 consists of two main components:
- The
jave-coredependency, which includes all the java code, which is platform independent - The
jave-nativebin-<platform>dependencies, which include the binary executables per platform
There exists a jave-all-deps project, which includes core and all windows und linux binaries.
Examples
Converting any audio to mp3
boolean succeeded;
try {
File source = new File("file path");
File target = new File("file path");
//Audio Attributes
AudioAttributes audio = new AudioAttributes();
audio.setCodec("libmp3lame");
audio.setBitRate(128000);
audio.setChannels(2);
audio.setSamplingRate(44100);
//Encoding attributes
EncodingAttributes attrs = new EncodingAttributes();
attrs.setOutputFormat("mp3");
attrs.setAudioAttributes(audio);
//Encode
Encoder encoder = new Encoder();
encoder.encode(new MultimediaObject(source), target, attrs);
} catch (Exception ex) {
ex.printStackTrace();
succeeded = false;
}
More advanced examples
Can be found here
Reacting to the end of an encoding
EncoderProgressListener gained a done() method that is called once the
encoding has finished successfully. It is a default method, so listeners written
against earlier versions keep compiling unchanged.
encoder.encode(new MultimediaObject(source), target, attrs, new EncoderProgressListener() {
public void sourceInfo(MultimediaInfo info) { }
public void progress(int permil) { }
public void message(String message) { }
@Override
public void done() {
System.out.println("Encoding finished");
}
});
Videos recorded in a different orientation
Phones store the orientation as stream metadata instead of rotating the picture.
MultimediaInfo.getRotate() reports that angle in degrees, clockwise, and is 0
when the file carries no rotation.
MultimediaInfo info = new MultimediaObject(source).getInfo();
if (info.getRotate() == 90 || info.getRotate() == 270) {
// width and height of info.getVideo().getSize() are swapped on playback
}
Changelog
Can be found here
Using snapshot builds
Snapshots of the develop branch are published to the Sonatype Central Portal
snapshot repository. To consume them, add the repository to your build:
<repositories>
<repository>
<id>central-snapshots</id>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
Publishing (maintainers)
Artifacts are published to Maven Central through the
Sonatype Central Portal using the
central-publishing-maven-plugin. The old OSSRH service (oss.sonatype.org)
that this project used previously has been retired by Sonatype.
Publishing runs from the Publish to Maven Central GitHub Actions workflow:
- a push to
developpublishes a snapshot, but only while the poms carry a-SNAPSHOTversion - creating a GitHub release publishes the release, which is auto-released by
the plugin (
autoPublish=true)
The workflow needs these repository secrets:
| Secret | Meaning |
|---|---|
MAVEN_CENTRAL_USERNAME | Central Portal user token name (Account → Generate User Token) |
MAVEN_CENTRAL_PASSWORD | Central Portal user token value |
MAVEN_GPG_PRIVATE_KEY | ASCII armored private key, gpg --armor --export-secret-keys <KEYID> |
MAVEN_GPG_PASSPHRASE | Passphrase of that key |
To publish by hand, put the same token in a central server entry in your
~/.m2/settings.xml and run mvn deploy.
License
JAVE2 is Free Software and it is licensed under GPL3 LICENSE
You will find a copy of the license bundled into the downloadable software distribution.
Feedback
You can send comments to andre@schild.ws For bug reports use the github site https://github.com/a-schild/jave2/issues
Credits
Jave is based on the jave version from Carlo Pelliccia
The original project page with source code can be found here: