I am trying to convert a audio (mp3) file to a video file (ideally flv or anything that youtube will accept). Looking around on here I thought that JAVE might be able to do the job and have been playing around with it but most of the support is about extracting the audio from a video rather than the other way around. I was guessing that I might need a blank image or something to form the pictures part of the video but can't seem to work it out. Thanks for any and all help!
My current code looks like :
File source = new File("voicetomstest.mp3");
File target = new File("target.flv");
AudioAttributes audio = new AudioAttributes();
audio.setCodec("libmp3lame");
audio.setBitRate(new Integer(64000));
audio.setChannels(new Integer(1));
audio.setSamplingRate(new Integer(22050));
VideoAttributes video = new VideoAttributes();
video.setCodec("flv");
video.setBitRate(new Integer(160000));
video.setFrameRate(new Integer(15));
video.setSize(new VideoSize(400, 300));
EncodingAttributes attrs = new EncodingAttributes();
attrs.setFormat("flv");
attrs.setAudioAttributes(audio);
attrs.setVideoAttributes(video);
Encoder encoder = new Encoder();
encoder.encode(source, target, attrs);
And currently has the following error
Apr 01, 2018 3:13:34 PM testvoice2video.TestVoice2Video main
SEVERE: null
it.sauronsoftware.jave.InputFormatException
at it.sauronsoftware.jave.Encoder.parseMultimediaInfo(Encoder.java:659)
at it.sauronsoftware.jave.Encoder.encode(Encoder.java:840)
at it.sauronsoftware.jave.Encoder.encode(Encoder.java:713)
at testvoice2video.TestVoice2Video.main(TestVoice2Video.java:74)
where line 74 is "encoder.encode(source, target, attrs);"