2016-05-12 60 views
5

Uygulamada WritingMinds/ffmpeg-android-java kullanıyorum. İstisna ise: burada java.io.IOException: exec() Çalışırken hata oluştu Çalışma Dizini: null Ortam: null

kodum

loadFFmpeg(); 
String cmd="ffmpeg -i /storage/emulated/0/media/audio/a.mp3 -i /storage/emulated/0/recording.3gp -filter_complex \"[0:a][1:a]amerge=inputs=2[aout]\" -map \"[aout]\" " + outputFile; 
executeFFmpeg(cmd.split(" ")); 

ve

private void loadFFmpeg() { 
    FFmpeg ffmpeg = FFmpeg.getInstance(MainActivity.this.getApplicationContext()); 
    try { 
     ffmpeg.loadBinary(new LoadBinaryResponseHandler() { 

      @Override 
      public void onStart() {} 

      @Override 
      public void onFailure() {} 

      @Override 
      public void onSuccess() {} 

      @Override 
      public void onFinish() {} 
     }); 
    } catch (FFmpegNotSupportedException e) { 
     // Handle if FFmpeg is not supported by device 
    } 
} 

private void executeFFmpeg(String[] cmd) 
{ 
    /*String workFolder = getApplicationContext().getFilesDir() + "/ffmpeg"; 
    String environment = Environment.getExternalStorageDirectory().getAbsolutePath(); 
    Map<String, String> map = new HashMap<String, String>(); 
    map.put("Working Directory", workFolder); 
    map.put("Environment",environment);*/ 
    FFmpeg ffmpeg = FFmpeg.getInstance(MainActivity.this.getApplicationContext()); 
    try { 
     // to execute "ffmpeg -version" command you just need to pass "-version" 
     ffmpeg.execute(cmd, new ExecuteBinaryResponseHandler() { 

      @Override 
      public void onStart() {} 

      @Override 
      public void onProgress(String message) {} 

      @Override 
      public void onFailure(String message) {} 

      @Override 
      public void onSuccess(String message) {} 

      @Override 
      public void onFinish() { 
       stop.setEnabled(false); 
       play.setEnabled(true); 
      } 
     }); 
    } catch (FFmpegCommandAlreadyRunningException e) { 
     // Handle if FFmpeg is already running 
    } 
} 

ama aşağıdaki alıyorum hata

6784-6962/com.flipartstudio.playandrecord E/FFmpeg olduğunu Çalışmaya çalışıyorum: [Ljava.lang.String; @ 41803270 java.io.IOException: exec() çalıştırılırken hata oluştu. Komut: [/data/data/com.flipartstudio.playandrecord/files/ffmpeg,/system/bin/ls, -l, /data/data/com.example.foo/files/ffmpeg] Çalışma Dizini: null Ortam: null Java.lang.ProcessManager.exec adresinden (ProcessManager.java:211) java.lang.Runtime.exec adresinden (Runtime.java:168) java.lang.Runtime.exec adresinden (Runtime.java:123) com.github.hiteshsondhi88.libffmpeg.ShellCommand.run (ShellCommand.java:10) com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground (FFmpegExecuteAsyncTask.java:38) en com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask de . doInBackground (FFmpegExecuteAsyncTask.java:10) android.os.AsyncTask $ 2.call (AsyncTask.java:287) java.util.concurrent.FutureTask.run adresinden (FutureTask.java:234) at android.os.AsyncTask $ SerialExecutor $ 1.run (AsyncTask.java:230) java.util.concurrent adresinde .ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1080) java.util.concurrent.ThreadPoolExecutor adresinden (ThreadPoolExecutor.java:573) java.lang.Thread.run adresindeki (Thread.java:856) Nedeniyle java.io.IOException: java.lang.ProcessManager.exec (Yerel Yöntem) (java.lang.ProcessManager.exec adresinden böyle bir dosya veya dizin yok) (ProcessManager.java:209) java.lang.Runtime.exec adresinde yok (Runtime.java:168) com.github.hiteshsondhi88 adresinde, com.hub.hiteshsondhi88.libffmpeg.ShellCommand.run (ShellCommand.java:10) adresindeki java.lang.Runtime.exec (Runtime.java:123) adresinden . libffmpeg.FFmpegExecuteAsyncTask.doInBackground (FFmpegExecuteAsyncTask.java:38) android.os.AsyncTask $ 2.call de com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground (FFmpegExecuteAsyncTask.java:10) de (AsyncTask.java:287) java.util.concurrent.FutureTask.run adresinde (FutureTask.java:234) at android.os.AsyncTask $ SerialExecutor $ 1.run (AsyncTask.java:230) java.util.concurrent.ThreadPoolExecutor adresinde java.lang.Thread.run (Thread.java: 856)

Ben de senin sorunun() yöntem ve bir kez executeFFmpeg() içinde kez loadFFmpeg FFmpeg declear olmasıdır

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> 
<uses-permission android:name="android.permission.STORAGE" /> 

cevap