I tried putting various versions of Python + OpenCV + FFmpeg environment on Mac

Introduction

――I wanted to use FFmpeg this time to prepare various environments, so I tried to build the environment. ――In addition, I have summarized the procedure for building Python + OpenCV because it is confusing because it rolls too much on the net and there are situations where it is necessary to use it properly depending on the combination of versions. --The steps to build Homebrew, pip, and pyenv are omitted. The procedure of pasting the PATH is also omitted. --OpenCV and FFmpeg take time to make, so it's a good idea to do it when you can afford it.

What I have tried so far

Python2.7+OpenCv2

Homebrew only

brew install python
brew install opencv

Python2.7+OpenCv3

Homebrew + pip

brew install python
pip install opencv-python

pyenv + pip

--pyenv was entered from anyenv.

pyenv install 2.7
pip install opencv-python

Python3.6+OpenCv3

Homebrew + pip

brew install python3
pip3 install opencv-python

Python3.6+OpenCv3+FFmpeg

――It seems that pip doesn't compile FFmpeg with OpenCV. video related functionality is not supported (not compiled with FFmpeg) --If you can create the following files, you are successful. Please put a symbolic link in /usr/local/lib/python3.6/site-packages. (For some reason, I gave up because I couldn't do this file many times last time.)

/usr/local/Cellar/opencv3/3.2.0/lib/python3.6/site-packages/cv2.cpython-36m-darwin.so

Homebrew only

brew install opencv3 --with-python3 --with-ffmpeg --without-python

Recommended Posts

I tried putting various versions of Python + OpenCV + FFmpeg environment on Mac
Environment construction of python3.8 on mac
How to build an environment for using multiple versions of Python on Mac
I tried Python on Mac for the first time.
[OpenCV / Python] I tried image analysis of cells with OpenCV
I tried "morphology conversion" of images with Python + OpenCV
Handling of python on mac
I tried "gamma correction" of the image with Python + OpenCV
Using multiple versions of Python on Mac OS X (2) Usage
Building a Python environment on Mac
Environment construction of python and opencv
Create a Python environment on Mac (2017/4)
I checked Mac Python environment construction
Python environment construction memo on Mac
I tried using GrabCut of OpenCV
OpenCV3 & Python3 environment construction on Ubuntu
I tried to create an environment of MkDocs on Amazon Linux
Using multiple versions of Python on Mac OS X (1) Multiple Ver installation
Run different versions of Python (wsgi) apps on one development environment
Build Python3 and OpenCV environment on Ubuntu 18.04
Create a python environment on your Mac
I tried non-photorealistic rendering with Python + opencv
I installed Kivy on a Mac environment
Created Ubuntu, Python, OpenCV environment on Docker
Build Python environment with Anaconda on Mac
Create an OpenCV3 + python3 environment on OSX
Build a Python + OpenCV environment on Cloud9
Video processing using Python + OpenCV on Mac
I tried to build a Mac Python development environment with pythonz + direnv
[Python / DynamoDB / boto3] List of operations I tried
I tried "smoothing" the image with Python + OpenCV
I tried hundreds of millions of SQLite with python
I tried "differentiating" the image with Python + OpenCV
I want to use Python in the environment of pyenv + pipenv on Windows 10
I installed Pygame with Python 3.5.1 in the environment of pyenv on OS X
Build a Python environment on Mac (Mountain Lion)
Use multiple versions of python environment with pyenv
Build a Python development environment on your Mac
I tried "binarizing" the image with Python + OpenCV
python on mac
I tried using the image filter of OpenCV
Create a Python execution environment on IBM i
I tried to extract various information of remote PC from Python by WMI Library
I tried to build an environment for machine learning with Python (Mac OS X)
Install Python3 on Mac and build environment [Definitive Edition]
I tried to extract features with SIFT of OpenCV
I tried to summarize how to use matplotlib of python
Install Python venv --VSCode --GitHub integration environment on Mac
I tried to implement Minesweeper on terminal with python
Build a machine learning Python environment on Mac OS
Summary of python environment settings for myself [mac] [ubuntu]
I tried python on heroku for the first time
I made a Python3 environment on Ubuntu with direnv.
I checked out the versions of Blender and Python
Build a Python development environment on Mac OS X
Build a Python environment on your Mac using pyenv
I want to AWS Lambda with Python on Mac!
I tried input interpolation on UE4 Python VS Code
[Python] I tried to get Json of squid ring 2
Install Python environment on local PC (pyenv, venv on Mac)
I tried using Python (3) instead of a scientific calculator