4

I've spent almost a week on this now, trying to get FFmpeg "Angel"/"Happiness" to build for Android. I've tried build scripts from all over the internet to no avail. I got closest was using this. As the author himself says the script doesn't work for newer versions of FFmpeg due to this bug, which has been dismissed on that ticket saying "I found a Makefile that does it." This was dis-heartening, being the only post on all of the vast Google world that was anywhere close to my problem. So, question time:

Is there a way to get around the above bug? I'm trying to use the newest ffmpeg API, and "Love" is just giving me "undefined reference" errors while trying to use av_encode_video2(), and av_free_frame(). The code I was working on the lines of is at the ffmpeg git repo, under /doc/examples/decoding_encoding.c (the function starting on line 338).

Update: So they've done away with codec_names.sh in "Angel". Sorry didn't notice that before, but the problem persists in a different avatar now. With every build attempt the compiler throws a certain

start ndk-building...
/home/<user>/android-ndk/build/core/build-binary.mk:41: *** target file `clean' has both : and :: entries.  Stop.

Say whatnow!?

varevarao
  • 2,186
  • 13
  • 26

1 Answers1

8

Given the lack of any response at all, I'm assuming people who know their shit in this topic are really busy putting their skills to use with whatever they managed to compile. For the ones like me who scraped each corner of the web for an answer that makes any little sense, I have a.. more than decent workaround.

The Guardian Project, an awesome resource on github, has the perfect project set up for building an ffmpeg binary with all the settings of your choice. But just the one big problem of getting it to successfully build sans the "Unable to create executables" error.

So.. there's a way out there too. Less flexible, but it saves you from losing any more hair than I'm sure you (like me) already have. Head out here and profit. From running the file command I noticed this binary was dynamically linked, that seemed weird, but it works.

Also, you'll have to run the chmod command before using it on the device (being a binary file and all). So pop it into your res/raw/ folder, load it up when needed and edit those videos like there's no tomorrow!

varevarao
  • 2,186
  • 13
  • 26
  • @Pratik +1 from me but can you please tell me how the hell build this ffmpeg using The guardian project?I want to build it on windows...is it possible?I know there r solutions for linux but not for windows:( – TheFlash Jun 17 '13 at 11:17
  • Sorry @Pratik can't help you there. Firstly, as I made it clear in my post, I'm no master at this myself. Secondly, I very rarely (actually almost never) have used Windows in 2 years now. – varevarao Jun 21 '13 at 04:55
  • thanks for reply...i have tried on ubuntu also but no luck....i couldn't build it...:( – TheFlash Jun 21 '13 at 04:57
  • It would help if you could tell me what error you were getting. I'd noticed that my build kept breaking during the freetype2 build. SO I removed all the freetype2 dependencies (involves commenting out lines from around 3 of the .sh files) and everything went just as expected. – varevarao Jun 22 '13 at 06:10
  • one of the developers in my company has successfully built ffmpeg on windows7,but it's version is lower..he followed roman10 tutorial...http://www.roman10.net/how-to-build-ffmpeg-for-android/..Unfortunately he couldn't run the latest version 1.2.1(magic).We will shortly post the solution on SO or may be on some blog. – TheFlash Jun 22 '13 at 06:17
  • Please, could you upload compiled binary file?? I am very very interested on it – BamsBamx Jun 23 '13 at 01:18
  • The `Unable to create executable error` usually means that your gcc compiler is probably not found. See [this answer](http://stackoverflow.com/a/17864671/748517) – Stefan Anca Dec 03 '13 at 10:28
  • And to use it : http://stackoverflow.com/questions/19355423/documentation-on-guardian-project-ffmpeg-android/21553337 – Taiko Feb 04 '14 at 13:09