Skip to content

Instantly share code, notes, and snippets.

@pabsan-0
Last active March 31, 2023 06:09
Show Gist options
  • Save pabsan-0/1bf9d69f978e437692ef10cb5d77e466 to your computer and use it in GitHub Desktop.
Save pabsan-0/1bf9d69f978e437692ef10cb5d77e466 to your computer and use it in GitHub Desktop.
Install instructions for opencv with gstreamer support
OPENCV_VER="master"
TMPDIR=$(mktemp -d)
# Build and install OpenCV from source.
cd "${TMPDIR}"
git clone --branch ${OPENCV_VER} --depth 1 --recurse-submodules --shallow-submodules https://github.com/opencv/opencv-python.git opencv-python-${OPENCV_VER}
cd opencv-python-${OPENCV_VER}
export ENABLE_CONTRIB=1
export ENABLE_HEADLESS=0
# We want GStreamer support enabled.
export CMAKE_ARGS="-DWITH_GSTREAMER=ON"
python3 -m pip wheel . --verbose
# Install OpenCV
python3 -m pip install opencv_*python*.whl
# Purge some stuff
rm -rf .git
rm -rf ./opencv_extra/testdata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment