0

I struggle to find the error in my code.

I've tried several things I found online, but can't get any of them working.

Error

javax.media.NoProcessorException: Cannot find a Processor for: com.ibm.media.protocol.MergingPullDataSource@14514713 That should mean the data type of the merged source cannot be used, but I cannot find out why

I've already tried several formats also converting my audio file to .mov.

If someone could help me I would be very thankful.

Code

public static void main(String args[]){ 

    //Creating the files with my path
    File audio = new File("C:\\ffmpeg\\bin\\light.wav");
    File video = new File("C:\\ffmpeg\\bin\\output.mov");

    try {

        //Create the sources
        DataSource audioSource = Manager.createDataSource(audio.toURI().toURL());
        DataSource videoSource = Manager.createDataSource(video.toURI().toURL());

        //Merge them
        DataSource[] vidAud = new DataSource[2];
        vidAud[0] = videoSource;
        vidAud[1] = audioSource;
        DataSource finalVideo = Manager.createMergingDataSource(vidAud);

        //Choose the destination to put it
        MediaLocator dest = new MediaLocator("file:c:\\ffmpeg\\bin\\plsWork.mov");

        VideoFormat videoF = new VideoFormat(VideoFormat.INDEO50);
        AudioFormat audioF = new AudioFormat(AudioFormat.GSM_MS);

        Format outputFormat[] = new Format[2];
        outputFormat[0] = videoF;
        outputFormat[1] = audioF;

        FileTypeDescriptor outputType = new FileTypeDescriptor(FileTypeDescriptor.AIFF);

        ProcessorModel procModel = new ProcessorModel(finalVideo, outputFormat, outputType);
        Processor proc = null;

        proc = Manager.createRealizedProcessor(procModel);

        DataSource source = proc.getDataOutput();

        DataSink sink = Manager.createDataSink(source, dest);
        sink.open();

    } catch(Exception e) {
        e.printStackTrace();
    }
}

Best regards

Tim Hutchison
  • 3,483
  • 9
  • 40
  • 76
Ammasic
  • 13
  • 3
  • Can you show us some of the code you have tried? – Tim Hutchison May 25 '17 at 20:33
  • https://stackoverflow.com/questions/14013874/combine-audio-with-videowithout-ffmpeg-java this one for example ;) But it worked now with the help of this one: http://java.worldbestlearningcenter.com/2013/05/merge-audio-and-video.html Also tried it with ffmpeg afterwards, also worked :) – Ammasic May 28 '17 at 19:18

0 Answers0