Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

current opencv[ffmpeg] feature makes the whole opencv library to be GPL licensed? #19334

Closed
ivanshilo opened this issue Aug 3, 2021 · 3 comments · Fixed by #19358
Closed
Assignees
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist

Comments

@ivanshilo
Copy link

FFmpeg uses LGPL license by default which is pretty permissive when it comes to building a commercial software that uses ffmpeg as its part.
This gives a good summary:
https://www.ffmpeg.org/legal.html
This is helpfull for whoever is going to take care of this issue, it provides a list of parts in ffmpeg which require GPL license:
https://chromium.googlesource.com/chromium/third_party/ffmpeg/+/refs/heads/master/LICENSE.md

Unfortunately when one builds opencv[ffmpeg], ffmpeg package by default is configured to be with GPL license. I am pretty sure it is because with --enable-gpl more filters are included which makes ffmpeg more usable.
But here it comes:
https://www.gnu.org/licenses/gpl-faq.html#IfLibraryIsGPL
Anything linked against GPL becomes itself a GPL. And so on till the user's code itself. Which is absolutely not the thing that commercial developer wants to have. And being sure that opencv itself has always BSD or Apache2.0 license could be quite an illusion as we see from the case above.

I suggest changing ffmpeg configuration when user does vcpkg install opencv[ffmpeg] to be non-GPL by default.
How can I manually change ffmpeg package configuration that opencv defines?

I would say there could be a nice feature to check resulting licensing for every package installed based on individual licenses of dependant packages.

@PhoebeHui PhoebeHui added the category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist label Aug 4, 2021
@PhoebeHui
Copy link
Contributor

It seems that opencv4 only requires feature ffmpeg[avcodec,avdevice,avformat,swresample,swscale] by default, see https://github.com/opencv/opencv/blob/master/CMakeLists.txt#L1369, so we can update opencv4 to depend on these features instead. cc @cenit

However, ffmpeg default feature 'postproc' depends on ffmpeg[gpl], so the gpl would be installed(Related issue##11602 ).
May remove the 'postproc' from ffmpeg default feature. cc @Sibras @mcmtroffaes

    "ffmpeg": {
      "description": "ffmpeg support for opencv",
      "dependencies": [
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "avcodec",
            "avformat",
            "swresample",
            "swscale"
          ]
        }
      ]
    }


PS E:\vcpkg\clean\vcpkg> ./vcpkg install opencv4[ffmpeg]
Computing installation plan...
The following packages will be built and installed:
  * ffmpeg[avcodec,avdevice,avfilter,avformat,core,gpl,postproc,swresample,swscale]:x86-windows -> 4.4#12
    opencv4[core,ffmpeg]:x86-windows -> 4.5.2

@mcmtroffaes
Copy link
Contributor

I agree that the way to go forward for opencv is to specify ffmpeg only with the required features and with default-features equal to false as suggested.

Regardless, I think it would make sense to remove postproc from the ffmpeg default features, to get the most flexible license by default, and only use the more restrictive licensing if the user explicitly asks for it. Currently the only way to get a non-GPL build is to specify the core feature explicitly to avoid postproc, and thereby gpl, from being pulled in (see for instance issue #18803).

@PhoebeHui
Copy link
Contributor

Thanks @mcmtroffaes for confirming this! I have submitted a PR to update it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist
Projects
None yet
3 participants