'Java JAVE - InputFormatException: Permission Denied
I'm trying to convert a .webm to a .mp4 file, but when I run the code, I get a InputFormatException: Permission Denied. I tried this in different directories, too.
File source = new File(src);
File target = new File(dest);
AudioAttributes audio = new AudioAttributes();
VideoAttributes video = new VideoAttributes();
EncodingAttributes attrs = new EncodingAttributes();
attrs.setAudioAttributes(audio);
attrs.setVideoAttributes(video);
audio.setCodec("libvorbis");
audio.setBitRate(64000);
audio.setSamplingRate(44100);
audio.setChannels(2);
audio.setBitRate(192000);
video.setCodec("libvpx");
video.setBitRate(250000);
video.setFrameRate(25);
attrs.setOutputFormat("webm");
Encoder instance = new Encoder();
try {
instance.encode(new MultimediaObject(source), target, attrs, null);
} catch (EncoderException e) {
MessageHandler.error500(comp);
e.printStackTrace();
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|