JAVE Library for Mac

366 views Asked by At

I'm actually trying to launch my Unix code on my Mac. I know that I have to build ffmpeg on my Mac.

I used a Github script for that :

Script

My code :

package test1;
import it.sauronsoftware.jave.*;
import test1.MyFFMPEGExecutableLocator;

import java.io.*;
public class Test1 {
    public static void main (String[] zero) throws IllegalArgumentException, InputFormatException, EncoderException{
        File source = new File("/Users/Mokeight/Desktop/Test2.mp3");

        File target = new File("/Users/Mokeight/Desktop/target2.wav");

        System.out.println("START");

        AudioAttributes audio = new AudioAttributes();
        EncodingAttributes attrs = new EncodingAttributes();

        //codec de wav

        audio.setCodec("pcm_s16le");
        attrs.setFormat("wav");
        attrs.setAudioAttributes(audio);

        //System.out.println(new MyFFMPEGExecutableLocator().toString());
        Encoder encoder = new Encoder(new MyFFMPEGExecutableLocator());


        encoder.encode(source, target, attrs);


        System.out.println("END");


    }
}

My second class is :

package test1;

import it.sauronsoftware.jave.FFMPEGLocator;

public class MyFFMPEGExecutableLocator extends FFMPEGLocator{
    @Override
    protected String getFFMPEGExecutablePath() {
        // TODO Auto-generated method stub
        String path = "/Users/Mokeight/Desktop/ffmpeg_mac/ffmpeg-build/workspace/bin/ffmpeg" ;  
        return path;

    }
}

When i'm running that , i have this error :

START
Exception in thread "main" it.sauronsoftware.jave.EncoderException:   Metadata:
    at it.sauronsoftware.jave.Encoder.encode(Encoder.java:863)
    at it.sauronsoftware.jave.Encoder.encode(Encoder.java:713)
    at test1.Test1.main(Test1.java:27)

Please, help

Thanks !!

0

There are 0 answers