shinchiro / mpv-winbuild-cmake

CMake-based MinGW-w64 Cross Toolchain
659 stars 117 forks source link

LibMPV DLL with LGPL license #586

Open Dingo64 opened 10 months ago

Dingo64 commented 10 months ago

Can you make a DLL for Windows compiled with -Dgpl=false so it is LGPL and not GPL?

zhongfly commented 10 months ago

I'm full of questions about compatibility between licences, does lgpl mean no gpl dependencies?

I find someone said need to disable gpl dependencies like libx264 https://github.com/shinchiro/mpv-winbuild-cmake/issues/12#issuecomment-448716788 I have download lgpl ffmpeg from https://github.com/BtbN/FFmpeg-Builds, and find it still have libx264 encoder.But libx264 is GNU General Public License v2.0 or later

Dingo64 commented 10 months ago

But does it have --enable-libopenh264? Support for h264 is quite important nowadays

zhongfly commented 10 months ago

I have find https://www.gnu.org/licenses/gpl-faq.html#AllCompatibility Lgpl means no gpl dependencies.

It looks like this is very cumbersome needing to check all dependencies and disable them, which sometimes means having to find other lgpl packages to replace them or lose the ability to decode some formats.

Dingo64 commented 10 months ago

Seems ffmpeg compiled without gpl code supports pretty much everything. It doesn't have x264 but have other h264 decoders. And the list what should be disabled is already made: https://github.com/shinchiro/mpv-winbuild-cmake/issues/12

zhongfly commented 10 months ago

Seems ffmpeg compiled without gpl code supports pretty much everything. It doesn't have x264 but have other h264 decoders. And the list what should be disabled is already made: #12

I'm talking about this repo.For example,this repo only have x264.cmake (this).So if you want lgpl, you need disable x264 and create cmake files for other h264 encoders by yourself if ffmpeg need external libs to encode h264.

zhongfly commented 10 months ago

Made a patch to remove following packages incompatible with lgpl and set (lib)mpv as lgpl license: rubberband xvidcore x264 x265 libdvdcss libdvdread libdvdnav avisynth-headers libssh libsrt davs2 openal-soft https://gist.github.com/zhongfly/3b8335ebc0db52f061bec4692fd3efa0

Note:ffmpeg is LGPL3 and (lib)mpv is LGPL2.1+

Dingo64 commented 10 months ago

@zhongfly Sounds great, thanks! Will there be a LGPL DLL in your repo?

hooke007 commented 10 months ago

Seems ffmpeg compiled without gpl code supports pretty much everything. It doesn't have x264 but have other h264 decoders.

No one use x264 as a decoder.

zhongfly commented 10 months ago

Will there be a LGPL DLL in your repo?

The next daily build will have libmpv under the LGPL licence, but I can't guarantee that I've disabled all LGPL-incompatible packages, use at your own risk. You can find out which packages are disabled in this patch.

update: https://github.com/zhongfly/mpv-winbuild/releases provides LGPL libmpv now

hooke007 commented 10 months ago

https://github.com/zhongfly/mpv-winbuild/blob/84fdcd005745fea86da4b1a1475f4996dff9a9ee/compile-lgpl-libmpv.patch#L60

Are you sure it's compatible with lgpl2.1 of mpv?

zhongfly commented 10 months ago

https://github.com/zhongfly/mpv-winbuild/blob/84fdcd005745fea86da4b1a1475f4996dff9a9ee/compile-lgpl-libmpv.patch#L60

Are you sure it's compatible with lgpl2.1 of mpv?

https://www.gnu.org/licenses/gpl-faq.en.html#AllCompatibility When libmpv is LGPLv2.1+,it can use a library under LGPLv3.

Dingo64 commented 10 months ago

@zhongfly Thank you very much. This DLL is great thing for all non-C programmers.

adlerzei commented 6 months ago

@zhongfly you're a hero, many thanks.