shahen94 / react-native-video-processing

Native Video editing/trimming/compressing :movie_camera: library for React-Native
https://shahen94.github.io/react-native-video-processing/
MIT License
1.25k stars 327 forks source link

Licensing #78

Closed mannol closed 7 years ago

mannol commented 7 years ago

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.

mannol commented 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!

kesha-antonov commented 7 years ago

@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.

mannol commented 7 years ago

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.

kesha-antonov commented 7 years ago

Oh come on! Are you sure?

This way I can use what I've built for ffmpeg-android-java 👍

mannol commented 7 years ago

Yup, I'm positive!

kesha-antonov commented 7 years ago

@mannol Cool! That's good news. Then I'll do implementation with old builds of ffmpeg 👍

mannol commented 7 years ago

@kesha-antonov Great! Hope to see it in master soon!

kesha-antonov commented 7 years ago

@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?

mannol commented 7 years ago

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.

kesha-antonov commented 7 years ago

@mannol Thanks. That's good.

kesha-antonov commented 7 years ago

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

mannol commented 7 years ago

@kesha-antonov Glad to hear that. Yes you can use ProcessBuilder, it does the same as exec().

kesha-antonov commented 7 years ago

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

kesha-antonov commented 7 years ago

And second. I included only ffmpeg build for armeabi-v7a. Do we need to include x86 build or it's a legacy?

mannol commented 7 years ago

@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.

mradzinski commented 6 years ago

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.

screen shot 2017-10-02 at 2 17 19 am

Shouldn't libopenh264.so be next to ffmpeg under the files folder?

kesha-antonov commented 6 years ago

No, I did not include binary for x86

mradzinski commented 6 years ago

@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?

kesha-antonov commented 6 years ago

I don't use emulators on android so can't help here. On real device it works OK

mradzinski commented 6 years ago

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.

kesha-antonov commented 6 years ago

You sure you use code from master?

kesha-antonov commented 6 years ago

Also did you checked how to setup Android from README? How to setup Library