title: Getting exception while trying to run ffmpeg via command line in android
body: <p>I want to use ffmpeg via command line arguments in android application.For this purpose:</p>
  
  <ol>
  <li>I have cross-compiled the ffmpeg lib and got the libffmpeg.so</li>
  <li>I have stored libffmpeg.so in files directory of the app.</li>
  </ol>
  
  <p>This is the code i am using:</p>
  
  <pre><code>public class MainActivity extends Activity {
  
      Process p;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
              String[] cmd =new String[4];
          cmd[0]="/data/data/com.example.ffmpegnew/files/libffmpeg";
          cmd[1]="-i";
          cmd[2]="mnt/sdcard/music/baba.mp4";
          cmd[3]="mnt/sdcard/music/outfile.mp4";
  
          p = Runtime.getRuntime().exec(cmd,null, new File("/data/data/com.example.ffmpegnew/files"));
  
          }
          catch(Exception e)
          {
              System.out.println("exception"+e);
          }
  
      }
  
  }
  </code></pre>
  
  <p>This is the exception i am getting:</p>
  
  <pre><code>09-17 13:47:01.679: I/System.out(3752): exceptionjava.io.IOException: Error running exec(). Command: [/data/data/com.example.ffmpegnew/files/libffmpeg.so, -i, mnt/sdcard/music/baba.mp4, mnt/sdcard/music/outfile.mp4] Working Directory: /data/data/com.example.ffmpegnew/files Environment: null
  </code></pre>
  
  <p>Please tell me how to solve this problem.Thanks in advance.</p>