Closed mannol closed 7 years ago
Getting back to this issue: I solved it by using these prebuilt binaries for ffmpeg. Just place the armeabi-v7a ffmpeg binary in assets/ directory and you will be able to run it on your android device (to make it work on emulator, choose x86 binary instead). Now, the remaining part was to just code binary execution. There are a bunch of examples online on how to accomplish that.
Sorry I can't supply any code but, I hope I helped!
@mannol but these ffmpeg binaries compiled with flag --enable-gpl
And these guys https://www.ffmpeg.org/legal.html suggest to not use this flag
What do you think?
That was main point for me to start recompiling binaries.
It's ok, using a binary executable is not the same as linking to a library. More info can be found here. Please note the GPL part:
If the program uses fork and exec to invoke plug-ins, then the plug-ins are separate programs, so the license for the main program makes no requirements for them.
Oh come on! Are you sure?
This way I can use what I've built for ffmpeg-android-java 👍
Yup, I'm positive!
@mannol Cool! That's good news. Then I'll do implementation with old builds of ffmpeg 👍
@kesha-antonov Great! Hope to see it in master soon!
@mannol What do you think about using libx264? I think it's not free for commercial use, right? https://licensing.x264.org/en/
So if I'll include that old builds of ffmpeg in this lib, then some people should buy license from x264, right?
Buying licence for libx264 is required only if the user wants to use non-GPL version of the library. The code for libx264 as used in ffmpeg is covered by GPL as you can see in their official git repository here.
@mannol Thanks. That's good.
Hello @mannol Almost done.
What do you think, can we use ProcessBuilder
instead of Runtime.getRuntime().exec
It seams easier to use
https://stackoverflow.com/questions/10723346/why-should-avoid-using-runtime-exec-in-java
@kesha-antonov Glad to hear that. Yes you can use ProcessBuilder, it does the same as exec().
Ok. Got it working.
Last thing. What of these https://www.ffmpeg.org/legal.html we should do (and include in README) to safely use ffmpeg? @mannol @shahen94
And second. I included only ffmpeg
build for armeabi-v7a
. Do we need to include x86
build or it's a legacy?
@kesha-antonov Great news! README should say that this project is using ffmpeg and point to the ffmpeg legal page. I think that's about it concerning legality of using ffmpeg.
I included only ffmpeg build for armeabi-v7a. Do we need to include x86 build or it's a legacy?
x86 is required, for example, android emulators running x86 android build. It is not necessary to be included in the build but maybe it would be nice to point out that the build cannot be used on x86 android emulators in the README.
Sorry to bump this, but I'm still getting CANNOT LINK EXECUTABLE "xxx": library "libopenh264.so" not found
. @kesha-antonov, did you include libopenh264.so
for x86 builds after all? I actually see it under the lib
folder of my project when running it on an emulator, but for some reason the app keeps complaining it's not there.
Shouldn't libopenh264.so
be next to ffmpeg
under the files folder?
No, I did not include binary for x86
@kesha-antonov, I've also been trying on two ARM physical devices and I get the same exception, so I guess it's not a binary architecture issue but something related to the location of the libopenh264.so
file. Any idea what that might be?
I don't use emulators on android so can't help here. On real device it works OK
I actually just tested it on a Nexus 6 and on a Samsung Galaxy 7 (both real devices, one sporting Android N and the other Android O) and it failed on both to locate libopenh264.so
.
You sure you use code from master?
Also did you checked how to setup Android from README?
How to setup Library
AFAIK this library is using: https://github.com/kesha-antonov/ffmpeg-android-java which is licensed under GPLv3. There should be a notice in the README about the limitations of using this library.