opencv wheels opencv-python, opencv-headless, opencv-contrib along with opencv distributed over conda-forge, all are not built with GStreamer support.
It is possible to build opencv wheels against GStreamer on Windows and OSX using either system-level GStreamer packages or the official GStreamer wheels with somewhat minimal patches to point to the GStreamer library files and the gst-inspect-1.0 executable, with the option to also include hooks or patches for pyinstaller or similar tools.
The official GStreamer wheels have proven to be a struggle for their maintainers to build for Linux.
On Linux, it is currently difficult to build opencv against GStreamer without having to do so for every popular linux distribution and do so for each of its releases. This is what some distributions, like Ubuntu, have present in their package repositories - opencv built against GStreamer and other system libraries from their repositories.
Conda provides packages in a reproduceable way on all platforms, making opencv built against conda GStreamer packages work as long as conda is able to provide the necessary environment at runtime. Conda brings its own packages for almost everything, which prevents ABI mismatches for packages other than glibc. For broad glibc ABI compatibility, simply compiling on the oldest known glibc in a widely in-use non-EOL linux distribution will ensure forward compatibility.
This project is an automated set of patches on the already-established opencv conda-forge package, whose build workflows are found at: https://github.com/conda-forge/opencv-feedstock/
Automatic updater
The updater workflow update-upstream.yml checks if the upstream feedstock has had any updates and pushes the updated submodule reference.
The automated-builds branch is recreated every time the updater workflow is run, and it pulls the main build workflow conda-build.yml and patches it with the "master-patch" that will later apply the build patches.
- Included Windows and OSX matrices in the main
conda-build.yml - Set the correct runners for the new matrices
- Set
UPLOAD_PACKAGESto'FALSE'- with quotes since checkers expect upper-cased boolean strings - Unset unnecessary upload tokens
BINSTAR_TOKEN,FEEDSTOCK_TOKEN,STAGING_BINSTAR_TOKEN - Added a
numpy>=2resolver/ enforcer for maximum API compatibility - Added "Upload artifact" steps after each build job (from workflow-extension.yml)
- Added a "publish" job to upload artifacts to the prefix.dev channel
aurobotics(from workflow-extension.yml) - Pull the patched workflow out of the submodule but set its build job's working directory to the submodules folder