Comments (17)
I might have figured out a way to include FFmpeg support to the Linux (and maybe MacOS too) builds without actually shipping the library itself within the package. This will of course require a proof of concept first, but this is roughly the idea:
1. Find somewhere a fresh dev build of FFmpeg for Cent OS 5 or compile it manually
2. Compile OpenCV against it
3. Patch the resulting binary with PatchELF which comes pre-installed in the manylinux containers
- this means that any needed link time dependencies (DT_NEEDED
) related to FFmpeg will be removed
4. Users can install the opencv-python as before and it will import without any issues, BUT:
- video I/O is maybe (I have to look at this, not sure about the dynamic linker stuff) supported given that FFmpeg has been separately installed in the system and it is API/ABI compatible with the one that OpenCV was compiled against
- trying to use video related functions without FFmpeg will most likely result in undefined symbol / some other error and terminate the program
EDIT: I have been thinking about this and the solution above does not probably work correctly. However, the same logic could be applied to __init__.py
if import fails -> remove DT_NEEDED
(with python) entries from the binary and try again.
EDIT2: Forget all of the above. We will ship LGPL FFmpeg with the packages like in the Windows wheels. Work in progress.
It will take some time to test this, so do not except video support any time soon. I haven't forgotten this or the other issues :)
from opencv-python.
The Linux wheel built this way is useless to me then. A shame, for this could be an easy way to get OpenCV rolling in my environments. I have gstreamer also installed but it looks like it is of no help.
The lack of ffmpeg codecs could be the reason why I can not read my videos, but what about the camera? Any hints on how I can work through this?
Anyone using this on Linux with success? Can anyone cv2.VideoCapture(0)
even without ffmpeg enabled?
from opencv-python.
FFmpeg will be supported in the next release. I will try to enable V4L2 also.
from opencv-python.
Some of the V4L/V4L2 headers were missing on those Cent OS 5 containers. I ended up adding them there manually since anything else didn't seem to work. OpenCV detects now both of them and builds fine. Can't really test if webcams work in reality since I don't have actual HW for testing but I guess we will see at some point.
from opencv-python.
I'm waiting for pull request for macOS support, see #49. For Linux builds FFmpeg will be added hopefully during this year.
from opencv-python.
How is V4L2 (using VideoCapture with webcams) related to FFmpeg in any way? The two are orthogonal (except maybe to support h264 webcams, which are somewhat rare anyway).
Is there a problem building with V4L2 support with the manylinux setup?
from opencv-python.
The Linux builds have been built without ffmpeg. I can enable it (and I'm looking into #6), but there remains the GPL/LGPL licensing issue. Statically linking the ffmpeg to the cv2.so is a no go (I don't know if this is even possible). Shipping the shared ffmpeg lib with the package might be possible. Another solution is to build the package with ffmpeg support and then users manually install ffmpeg on their systems.
from opencv-python.
Using the wheels built here, I cannot get capture devices to work on either OS X or Linux (Ubuntu).
from opencv-python.
It looks like windows support was added: #15
from opencv-python.
Haven't found yet enough time to enable ffmpeg on Linux/OS X. Yes, Windows support was a lot easier to add than for example Linux because precompiled ffmpeg shared libs are provided within OpenCV.
from opencv-python.
https://github.com/opencv/opencv/tree/master/3rdparty/ffmpeg talks about various options around ffmpeg, etc and dealing with licenses. It seems that at least on OS X, oepncv should link against AVFoundation.
It might also be worth looking at how brew builds opencv3: https://github.com/Homebrew/homebrew-science/blob/master/opencv3.rb
from opencv-python.
There is also some flag: WITH_AVFOUNDATION
.
from opencv-python.
@skvark is it in progress? are there any rc with it already? Thanks m8
from opencv-python.
I haven't tried, but I hope it works. I'm just trying to provide consistent and comprehensive packages across different platforms given that Windows builds already use FFmpeg for video I/O and macOS builds will have FFmpeg support hopefully soon.
from opencv-python.
Closing in favor of #50 and #56.
from opencv-python.
As @kerio92 mentioned. We could have webcam video capture enabled without FFMPEG.
Its a totally separate flag and dependency to enable V4L2 support in OpenCV.
from opencv-python.
Once it's released I can help testing it.
from opencv-python.
Related Issues (20)
- PyPI: macOS arm64 wheel missing
- cv2.createThinPlateSplineShapeTransformer not exist in 4.10
- imdecode jpeg2000 segfault or deadlock in multithreading HOT 2
- Typing of compare does not allow scalar for src1 or src2
- Why Building wheel for opencv-python when using "pip install opencv-python"
- Typing stubs generation has failed when building wheel HOT 1
- error: OpenCV(4.9.0) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\layers\convolution_layer.cpp:396: error: (-2:Unspecified error) Number of input channels should be multiple of 3 but got 4 in function 'cv::dnn::ConvolutionLayerImpl::getMemoryShapes'
- Gstreamer support on windows 10
- why ı am getting this error
- BUG: cv2.fillPoly() causing segmentation fault on Ubuntu 22.04.4 LTS HOT 1
- [Suggestion] Metapackage as solution to current issues with opencv as dependency HOT 1
- Build from source python 3.12 fails HOT 6
- error: OpenCV(4.8.0) /io/opencv/modules/core/src/copy.cpp:71: error: (-215:Assertion failed) cn <= 4 in function 'scalarToRawData'
- ModuleNotFoundError: No module named 'distutils' in latest release HOT 7
- MacOS arm64 wheels missing from PyPI 4.10 release HOT 2
- ImportError: numpy.core.multiarray --- Numpy 2.0.0 HOT 1
- cv2/cv2.abi3.so, 2): Library not loaded: /usr/local/opt/libunistring/lib/libunistring.2.dylib Referenced from: /usr/local/opt/gnutls/lib/libgnutls.30.dylib HOT 1
- When will opencv-python support numpy 2.0? HOT 6
- compile bug
- AttributeError: module 'numpy' has no attribute 'object'. `np.object` was a deprecated alias for the builtin `object`. To avoid this error in existing code, use `object` by itself. Doing this will not modify any behavior and is safe. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opencv-python.