ws.schild.jave.progress.EncoderProgressAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jave-core Show documentation
Show all versions of jave-core Show documentation
The JAVE (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.
package ws.schild.jave.progress;
import ws.schild.jave.info.MultimediaInfo;
public class EncoderProgressAdapter implements EncoderProgressListener {
private VideoProgressListener listener;
public EncoderProgressAdapter(VideoProgressListener listener) {
this.listener = listener;
}
@Override
public void sourceInfo(MultimediaInfo info) {
if (info != null) {
listener.onMessage(info.toString());
}
}
@Override
public void progress(int permil) {
listener.onProgress(new Double(permil) / 100);
}
@Override
public void message(String message) {
listener.onMessage(message);
}
}