title: Android ffmpeg command shows java.io.IOException: Error running exec()
body: <p>I would like to use <code>ffmpeg</code> binary executable in my Android project.for this purpose I have used pre built ffmpeg Android binary from this(<a href="https://github.com/hiteshsondhi88/ffmpeg-android/releases/download/v0.3.3/prebuilt-binaries.zip" rel="nofollow">https://github.com/hiteshsondhi88/ffmpeg-android/releases/download/v0.3.3/prebuilt-binaries.zip</a>) link.</p>
  
  <p>As per procedure I have to place the <code>executable</code> file into <code>/data/data/com.example.rampedsample</code> directory, here <code>com.example.rampedsample</code> is my project packageName.I couldn't find this location in my device as it is un rooted.So I pasted that executable into <code>Android emulator</code>'s <code>com.example.rampedsample</code> directory using <code>DDMS</code> perspective.</p>
  
  <p>In my Activity used the below code</p>
  
  <pre><code> try {
              Process p = Runtime.getRuntime().exec("/data/data/com.example.rampedsample/ffmpeg "+Environment.getExternalStorageDirectory()+"/Movies/ramp_video.mp4"
                      +" -map 0:v -codec copy "+Environment.getExternalStorageDirectory()+"/Movies/ramp_video2.mp4");
  
  
          } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  </code></pre>
  
  <p><strong>AndroidManifest permission</strong></p>
  
  <pre><code>&lt;uses-permission 
      android:name="android.permission.WRITE_EXTERNAL_STORAGE"         
      /&gt;
  </code></pre>
  
  <p><strong>error</strong></p>
  
  <pre><code>04-13 16:59:55.314: W/System.err(11387): java.io.IOException: Error running exec(). Command: [/data/data/com.example.rampedsample/ffmpeg, /mnt/sdcard/Movies/ramp_video.mp4, -map, 0:v, -codec, copy, /mnt/sdcard/Movies/ramp_video2.mp4] Working Directory: null Environment: null
  04-13 16:59:55.314: W/System.err(11387):    at java.lang.ProcessManager.exec(ProcessManager.java:211)
  04-13 16:59:55.355: W/System.err(11387):    at java.lang.Runtime.exec(Runtime.java:168)
  04-13 16:59:55.355: W/System.err(11387):    at java.lang.Runtime.exec(Runtime.java:241)
  04-13 16:59:55.355: W/System.err(11387):    at java.lang.Runtime.exec(Runtime.java:184)
  04-13 16:59:55.355: W/System.err(11387):    at com.example.rampedsample.MainActivity.onCreate(MainActivity.java:18)
  04-13 16:59:55.355: W/System.err(11387):    at android.app.Activity.performCreate(Activity.java:5008)
  04-13 16:59:55.355: W/System.err(11387):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
  </code></pre>