I'm using JAVE (Java Audio Video Encoder) library and the developed application is on windows.
On windows the conversion of an .mp3
file is working fine but when I deployed on linux (CentOS 7) an exception is thrown.
As I understand JAVE has also a wrapper around an ffmpeg
executable.
Here is my code:
try {
File source = new File(sourceFile);
File target = new File(targetFile);
final AudioAttributes audio = new AudioAttributes();
audio.setCodec("libmp3lame");
audio.setBitRate(88000);
audio.setChannels(2);
audio.setSamplingRate(44100);
EncodingAttributes attrs = new EncodingAttributes();
attrs.setFormat("mp3");
attrs.setAudioAttributes(audio);
Encoder encoder = new Encoder();
encoder.encode(source, target, attrs);
} catch (EncoderException ex) {
throw ex;
}
Exception:
...
Caused by: it.sauronsoftware.jave.EncoderException: Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height
at it.sauronsoftware.jave.Encoder.encode(Encoder.java:926)
at it.sauronsoftware.jave.Encoder.encode(Encoder.java:713)
at com.hft2.ejb.util.Mp3JaveEncoder.encode(Mp3JaveEncoder.java:36)
... 206 more
Update
Here is the official page: http://www.sauronsoftware.it/projects/jave/
Full exception log: https://jpst.it/1678l
Does anyone have any idea?