I've compiled ffmpeg for Android with the NDK and transferred the compiled binary to /data/local, but when I try to execute the binary, even as su, the terminal returns 'Permission denied.'

The configure script I use for ffmpeg is:

NDK=/home/adam/ndk/android-ndk-r9c PLATFORM=$NDK/platforms/android-19/arch-arm PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64

./configure --target-os=linux --arch=arm --enable-cross-compile --cross-prefix=$PREBUILT/bin/arm-linux-androideabi- --sysroot=$PLATFORM --enable-pic --enable-runtime-cpudetect

ls -l ffmpeg outputs: -rw-rw-rw- root root 10338136 2013-12-30 15:54 ffmpeg

  • 1
    Hmm... Are you sure that the binary has executable permissions (even for root)? Could you edit your question to include the current permissions for the compiled binary? An ls -l output for the file will probably do the trick.
    – dotVezz
    Commented Dec 30, 2013 at 16:33
  • @dotVezz Added 'ls -l ffmpeg' output Commented Dec 30, 2013 at 16:46
  • There's your problem. Try chmod +x ffmpeg and see if that fixes it. (You may need to run that as root)
    – dotVezz
    Commented Dec 30, 2013 at 16:52
  • @dotVezz 'chmox +x ffmpeg' returns 'Bad mode' Commented Dec 30, 2013 at 16:56
  • Still returned 'Bad mode'. Manually setting permissions in ES File Explorer fixed the issue and the binary executed successfully. Commented Dec 30, 2013 at 17:08

1 Answer 1


Looking at your file permissions, it looks like a simple permissions problem. The file does not have execution permissions for any users.

You can use many different options to set permissions:

  • chmod should work on most cases.
  • You can also use many file managers to set file permissions individually. The option you wound up using, ES File Explorer, is an excellent example of such.

You should also read up on Unix Permissions if you're not already familiar with the subject. It'll be a great help in the future.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .