Last active
December 4, 2018 08:43
-
-
Save ashish1405/110d2464c412a87db42eb3b05119de26 to your computer and use it in GitHub Desktop.
Compile OpenCV with ffmpeg for python3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get --assume-yes -qq remove x264 libx264-dev ffmpeg | |
sudo apt-get --assume-yes --purge remove libav-tools | |
sudo apt-get --assume-yes --purge autoremove | |
sudo apt-get --assume-yes update | |
sudo apt-get --assume-yes install libjpeg8-dev libtiff5-dev libjasper-dev libpng12-dev | |
sudo apt-get --assume-yes install libx264-dev | |
sudo apt-get --assume-yes install libgtk-3-dev | |
sudo apt-get --assume-yes install libatlas-base-dev gfortran | |
sudo apt-get --assume-yes install python2.7-dev python3.5-dev | |
sudo apt-get --assume-yes install qtbase5-dev | |
sudo apt-get --assume-yes install libopencv-dev build-essential checkinstall cmake pkg-config yasm libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine2-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils | |
sudo apt-get --assume-yes install python-setuptools | |
sudo easy_install pip | |
sudo -H pip install numpy | |
sudo apt-get --assume-yes install python3-setuptools | |
sudo easy_install3 pip | |
sudo -H pip3 install numpy | |
curl -OL "https://github.com/opencv/opencv/archive/3.2.0.zip" | |
mv 3.2.0.zip opencv.zip | |
unzip opencv.zip | |
cd opencv | |
mkdir build | |
cd build | |
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=OFF -D WITH_QT=ON -D WITH_OPENGL=ON -D PYTHON_DEFAULT_EXECUTABLE=/usr/bin/python3 .. | |
make -j4 | |
sudo make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment