Код: Выделить всё
make -j$(nproc)
Код: Выделить всё
sudo apt update
sudo apt install -y \
build-essential cmake git pkg-config \
libjpeg-dev libtiff-dev libpng-dev \
libavcodec-dev libavformat-dev libswscale-dev \
libv4l-dev libxvidcore-dev libx264-dev \
libgtk-3-dev libatlas-base-dev gfortran \
python3-dev python3-numpy \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
cd ~
git clone https://github.com/opencv/opencv.git
git clone https://github.com/opencv/opencv_contrib.git
cd opencv
git checkout 3.4.18 # I used this version because I had the same one working in venv on a pip version
cd ../opencv_contrib
git checkout 3.4.18
cd ~/opencv
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D WITH_GSTREAMER=ON \
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
-D PYTHON3_EXECUTABLE=$(which python3) \
-D BUILD_opencv_python3=ON \
-D BUILD_EXAMPLES=OFF ..
make -j$(nproc) # ((50
Подробнее здесь: [url]https://stackoverflow.com/questions/79826973/error-throwing-while-building-opencv-with-gstreamer-support[/url]