11

Does anyone find this information useful in anyway?

I've been trying to compile this thing for a while now and I know of the numerous posts floating around the internet offering help. I have read and tried most of the suggestions and wanted to colate my success into this single post for others to benefit from.

Since I don't have a blog, I thought it wouldn't hurt to post on here instead.

I have managed to compile FFMPEG 0.10.3 (Freedom) on Windows 7 (32 bit) using NDK r5 and Cygwin. The steps:

1 - Download/install Cygwin in the root of your C drive. I'm not going to give instructions on this, it's simple enough and there are plenty of tutorials on this.

2 - Download NDK r5 from here and extract to the root of your C drive.

3 - Download FFMPEG 0.10.3 from here and extract to the root of your C drive.

4 - Open the file 'configure' in the root of the FFMPEG directory in a text editor.

5 - Comment out lines 2073, 2074 and 2075.

6 - Below 2075, add the following line:

TMPDIR=c:/cygwin/tmp

7 - Download this script (thankyou roman10) and place it inside your FFMPEG root directory. Rename the file to

build_android.sh

8 - Open the script in a text editor and edit line 17 to read

c:/android-ndk-r5

9 - Click start > run and type "bash" (without the speech marks) and press enter.

10 - Type the following and press enter:

cd /cygdrive/c/ffmpeg-0.10.3

11 - Type the following and press enter:

dos2unix build_andoird.sh

12 - Type the following and press enter:

./build_android.sh

13 - Sit back and wait... libffmpeg.so will soon appear in your "c:\ffmpeg-0.10.3\android\" directory (where is defined in the bottom of the script from roman10's blog). The default architecture is armv7-a.

The script from roman10's blog will actually compile quite a large shared object (.so) file. The compiler flags can be adjusted to suit your needs in the script from roman10's blog.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
protectedmember
  • 349
  • 5
  • 20
  • 1
    thanks protectedmember for a good technical guide. FWIW, video and media on mobile are going to be very lucrative areas for developers who can navigate the myriad, and imposing issues of codecs, players, and streaming protocols... I devour the threads on android/ffmpeg and have recently installed vmplayer on vista in pursuit of the same general goal that you have. – Robert Rowntree May 19 '12 at 14:40
  • 2
    Oli and talonmies - now it's a question ;) Robert - you are very welcome. Good luck! – protectedmember May 19 '12 at 15:18
  • Thanks it sure did help ..but should have been as an answer to this question http://stackoverflow.com/questions/4091800/the-same-bash-script-in-command-line-doesnt-work-when-run-from-a-file – Monica M Apr 10 '13 at 13:29
  • What about if I am using the latest version of NDK? I am trying to run the script and it fails with NDK R8e – PerracoLabs Jun 02 '13 at 11:31
  • Zhenya: I eventually found that taking the time to learn how to compile via the NDK on Linux (in my case Ubuntu) was far faster and easier than trying to munge a compilation on Windows. I haven't tried later versions of the NDK I'm afraid. – protectedmember Jun 12 '13 at 22:59
  • Acctually in Windows I'm getting error: "arm-linux-androideabi-gcc is unable to create an executable file. "C compiler test failed". And than I'm getting a lots of "No such file or directory" for Makefile's command. Really pain in the ass – Nativ Nov 10 '13 at 16:48
  • What are lines 2073, 2074 and 2075? – Nativ Nov 10 '13 at 18:32
  • @protectedmember I am also facing same issue as mentioned by powerX please let me know how to solve it actully i solved mostlly all the errors related to And than I'm getting a lots of "No such file or directory" – Khan Jan 21 '14 at 05:04
  • @protectedmember but now i am getting "arm-linux-androideabi-gcc is unable to create an executable file. "C compiler test failed" and Makefile:62: *** target pattern contains no `%'. Stop. D:\android-ndk-r8b\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin\arm-linux-androideabi-ld.exe: libavformat/libavformat.a: No such file: No such file or directory – Khan Jan 21 '14 at 05:04
  • @powerX did you get success in buidl ffmpeg or not me also facing issue same as you – Khan Jan 21 '14 at 05:05
  • Trust me it is far easier to compile on Ubuntu. Even if you have no experience with Linux, the learning curve there is much more pleasent than hacking around on Windows. Ubuntu is free, and I'd recommend a virtual machine running on Windows. This is what I resorted to and it's been a breeze ever since. – protectedmember Jan 22 '14 at 09:16
  • generating this type of error in cygwin---- ./build_android.sh ./build_android.sh: line 22: syntax error near unexpected token `--target-os=linux' ./build_android.sh: line 22: `function build_one{./configure --target-os=linux \' Please how to handle this type of error – Sanket990 Feb 11 '14 at 05:57
  • 2073, 2074 and 2075 plz some hint which line configure – Sanket990 Feb 11 '14 at 11:45
  • getting this type of error when compile --arm-linux-androideabi-gcc is unable to create an executable file – Sanket990 Feb 11 '14 at 11:48

0 Answers0