opencv / opencv-python

Automated CI toolchain to produce precompiled opencv-python, opencv-python-headless, opencv-contrib-python and opencv-contrib-python-headless packages.
https://pypi.org/project/opencv-python/
MIT License
4.5k stars 843 forks source link

[Suggestions] Add a gpl binaries of opencv-python include ffmpeg x264, x265 #469

Open talregev opened 3 years ago

talregev commented 3 years ago

Add a gpl binaries of opencv-python include ffmpeg x264, x265.

talregev commented 3 years ago

I was able to create a opencv python binding with static build with ffmpeg[x264,x265] with vcpkg. Is it something that interesting you? Will you consider to ship such a binary?

talregev commented 3 years ago

@sergregory Fox linux I can create a docker file that will generate this python build. How you generate python build for windows? with a script? If yes, I can take this script and modify it that it will generate the gpl ffmpeg with x264,x265 and more features that you might want. Can we chat about this?

skvark commented 3 years ago

Enabling FFmpeg GPL extensions can be very easily done by just changing the build settings in the Dockerfiles and macOS build scripts in this repository or just by building locally against local FFmpeg. For example:

On Windows, OpenCV CMake scripts download the pre-built FFmpeg binary during the build. We do not generate the binary here.

For local builds, just follow the instructions in the README (FFmpeg should be picked up automatically from your computer by the CMake scripts): https://github.com/opencv/opencv-python#manual-builds

About creating new binary distributions for this purpose... In my opinion, it's too risky to distribute compiled binaries containing x264 and x265 encoders. IANAL, but I believe that x264 and x265 include algorithms that are subject to software patents. That's why the Windows FFmpeg downloaded by CMake during Windows builds is LGPL and the h264 encoder must be downloaded separately by the user: https://github.com/opencv/opencv/blob/master/3rdparty/ffmpeg/readme.txt

However, this is just my opinion. I'm not the main maintainer of this project anymore so it's up to the OpenCV team to decide how they would like to proceed with this and possibly seek legal advice, if needed.

talregev commented 3 years ago

Not sure why is risky. Yes I know the license for this binary (wheel) file will be change. The x264 and x265 are gpl, and if opencv will ship this binaries they will be gpl. What I am suggesting that you will continue to give lgpl binaries and in addition opencv can ship binaries that gpl license. Can you mentione the relevant person that can make such a decision? Thank you for your comment.

skvark commented 3 years ago

If you read my comment, the issue is not GPL but patents. Read the legal info about FFmpeg here: https://www.ffmpeg.org/legal.html

I'm sure someone from the OpenCV team will express their opinion on this matter sooner or later.

talregev commented 3 years ago

Now is more understood. Maybe to call it for private use? Not sure how to approach it from legal view. If there is a lawyer in the crowd, maybe he can give advice.

talregev commented 3 years ago

@skvark what do you think about openh264? https://www.openh264.org/faq.html Soon vcpkg will release ffmpeg with openh264. Will opencv will consider to distribute such a binary?

alalek commented 3 years ago

Releasing build scripts != binaries distribution

talregev commented 3 years ago

Can you elaborate?