Find your next open-source project

Search by name, purpose, or keyword — or paste a GitHub repository URL

a-schild/jave2

Media & Design

Java wrapper around ffmpeg for transcoding audio and video files from Java applications.

1,378
261
Java
GPL-3.0
13 years old

What it does

JAVE2 (Java Audio Video Encoder) is a Java wrapper over ffmpeg. Instead of assembling ffmpeg command lines by hand, Java code builds typed audio and video attributes and calls an encoder to transcode files, change codecs, extract or resize video, and handle common container conversions. It is aimed at Java applications that need media processing inside the JVM process.

The project is split into jave-core, which contains platform-independent Java code, and per-platform jave-nativebin-* artifacts that carry the ffmpeg executables. jave-all-deps bundles core plus every supported platform; jave-bom lets you pin versions when selecting platform packages yourself README lines 113–145.

Quick start

Add the dependency to your Maven build. This example includes all platform binaries:

<dependency>
  <groupId>ws.schild</groupId>
  <artifactId>jave-all-deps</artifactId>
  <version>4.2.0</version>
</dependency>

To ship only one platform, add jave-core plus the matching native package, for example jave-nativebin-linux64, and manage versions with jave-bom README lines 119–142. Then encode a file:

File source = new File("source.wav");
File target = new File("target.mp3");

AudioAttributes audio = new AudioAttributes();
audio.setCodec("libmp3lame");
audio.setBitRate(128000);
audio.setChannels(2);
audio.setSamplingRate(44100);

EncodingAttributes attrs = new EncodingAttributes();
attrs.setOutputFormat("mp3");
attrs.setAudioAttributes(audio);

new Encoder().encode(new MultimediaObject(source), target, attrs);

encode() blocks until transcoding finishes and throws EncoderException on failure or InputFormatException when the source cannot be read. A runnable sample is in DefaultFFMPEGLocatorTest.java README lines 245–266. The project wiki covers usage, examples, encoding attributes, custom ffmpeg arguments and supported formats.

Platform support and constraints

JAVE requires Java 8 or higher. Supported packages cover Windows x64 and ARM 64, Linux x64, ARM 64 and ARM 32, and macOS Apple silicon. macOS Intel is deprecated and will be removed in a later release README lines 36–54. The 32-bit Windows and Linux x86 packages were removed in 4.0.0; projects that need them must stay on 3.6.0 README lines 62–68.

Bundled binaries carry ffmpeg 9.0.x. The Linux builds are compiled against musl and statically linked, so they run on musl-based images such as Alpine as well as older distributions README lines 69–75. GraalVM native images are supported from 4.2.0; depend on only the platform package you build for rather than jave-all-deps, otherwise every binary is embedded README lines 76–84.

The library invokes the ffmpeg executable and gives Java a typed way to build its command line. The boundary between the library and the calling application, including what must not be done with user input, is discussed in SECURITY.md README lines 327–337. JAVE2 is licensed under GPL-3.0.

HotRepo's take

JAVE2 is a long-lived Java binding: the repository dates to 2013 and has accumulated 1,378 stars and 261 forks. Its package layout reflects a practical concern for Java deployments — separating the pure-Java core from per-platform ffmpeg binaries and offering a BOM so versions do not drift. The project has also made deliberate platform decisions, dropping 32-bit x86 in 4.0.0 and deprecating macOS Intel as Apple winds down that hardware. There is no HotRepo ranking or growth record for this repository, so the observation here rests on the project structure and documented constraints rather than trending data.

Written by AI from the project's README, updated . The project's own docs are the source of truth.