File source = new File(“E:\mntn\inch\upload\mprry\upload_resource\travelImprint\2021\1101\4488001\1635738370857.mp4”);
AudioAttributes audio = new AudioAttributes();
audio.setCodec("aac");
audio.setBitRate(128000);
audio.setSamplingRate(44100);
audio.setChannels(2);
VideoAttributes video = new VideoAttributes();
video.setCodec("h264");
video.setBitRate(160000);
video.setFrameRate(30);
video.setSize(new VideoSize(1280,597));
EncodingAttributes attrs = new EncodingAttributes();
attrs.setOutputFormat("mp4");
attrs.setAudioAttributes(audio);
attrs.setVideoAttributes(video);
String newVideoPath = “E:\mntn\inch\upload\mprry\upload_resource\travelImprint\2021\1101\4488001\VID18.mp4”;
File target = new File(newVideoPath);
Encoder encoder = new Encoder();
try {
encoder.encode(new MultimediaObject(source), target, attrs);
} catch (EncoderException e) {
e.printStackTrace();
}
The following is the error message
log4j:WARN No appenders could be found for logger (ws.schild.jave.FFMPEGExecutor).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" ws.schild.jave.EncoderException: Exit code of ffmpeg encoding run is 1
at ws.schild.jave.Encoder.encode(Encoder.java:582)
at ws.schild.jave.Encoder.encode(Encoder.java:357)
at com.mp.utils.VideoUtil.catVideo(VideoUtil.java:77)
at com.mp.utils.VideoUtil.main(VideoUtil.java:25)
Disconnected from the target VM, address: '127.0.0.1:56565', transport: 'socket'
I have tried to set the height to 596 and 598 without any problem. Is this a bug
The following is the error message log4j:WARN No appenders could be found for logger (ws.schild.jave.FFMPEGExecutor). log4j:WARN Please initialize the log4j system properly. Exception in thread "main" ws.schild.jave.EncoderException: Exit code of ffmpeg encoding run is 1 at ws.schild.jave.Encoder.encode(Encoder.java:582) at ws.schild.jave.Encoder.encode(Encoder.java:357) at com.mp.utils.VideoUtil.catVideo(VideoUtil.java:77) at com.mp.utils.VideoUtil.main(VideoUtil.java:25) Disconnected from the target VM, address: '127.0.0.1:56565', transport: 'socket'
I have tried to set the height to 596 and 598 without any problem. Is this a bug