0

I want to use command line facility in android to use ffmpeg library.But i am getting IO Exception while trying that,I have stored ffmpeg.exe in /files folder.This is the code:

public class MainActivity extends Activity {

    Process p;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Process p = Runtime.getRuntime().exec("/data/data/com.example.ffmpegnew/files/ffmpeg",null, new File("/data/data/com.example.ffmpegnew/files"));

        }
        catch(Exception e)
        {
            System.out.println("exception"+e);
        }

    }

}

This is the error :

09-16 16:24:38.751: I/System.out(2209): exceptionjava.io.IOException: Error running exec(). Commands: [/data/data/com.example.ffmpegnew] Working Directory: /data/data Environment: null

Please tell me what is the problem.Thanks in advance.

user1662334
  • 609
  • 2
  • 9
  • 20

1 Answers1

0

I dont think .exe files run on linux, not to mention probably x86 compiled binary executable .

Further even if you get a arm compiled ffmpeg, you will have to make it executable through chmod

nandeesh
  • 24,272
  • 6
  • 65
  • 74
  • Can you please give me some example sir – user1662334 Sep 16 '12 at 11:50
  • have never worked on ffmpeg, but i think you are trying to run a windows program on Android. which is not possible – nandeesh Sep 16 '12 at 11:53
  • like i said, windows executables do not work on Android. Android needs an executable that runs on Linux. And most of the phones run on Arm chipset, so you need the executable to be cross compiled for arm – nandeesh Sep 16 '12 at 12:02
  • Can you please tell me how to do it sir – user1662334 Sep 16 '12 at 12:04
  • there are just too many posts on stackoverflow which have questions related to this. do search them. Here's [one](http://stackoverflow.com/questions/4725773/ffmpeg-on-android) – nandeesh Sep 16 '12 at 12:06