Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/280.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python OpenCV3.1编译错误';ffmpeg/avformat.h';找不到文件_Python_Macos_Ffmpeg_Cmake - Fatal编程技术网

Python OpenCV3.1编译错误';ffmpeg/avformat.h';找不到文件

Python OpenCV3.1编译错误';ffmpeg/avformat.h';找不到文件,python,macos,ffmpeg,cmake,Python,Macos,Ffmpeg,Cmake,在MacOS 10.9.5小牛上。我使用自制软件安装了Python,cmake,ffmpeg。 在终端中输入ffmpeg,表明它已安装。 我下载了Opencv3和opencv\u contrib 然后cmake使用以下命令: cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D WITH_CUDA=OFF -D CMAKE_INSTALL_PREFIX=/Users/stefan/Downloads/opencv-3.1.0dl/build \ -D PY

在MacOS 10.9.5小牛上。我使用自制软件安装了
Python
cmake
ffmpeg
。 在终端中输入
ffmpeg
,表明它已安装。 我下载了
Opencv3
opencv\u contrib

然后
cmake
使用以下命令:

cmake -D CMAKE_BUILD_TYPE=RELEASE \
    -D WITH_CUDA=OFF -D CMAKE_INSTALL_PREFIX=/Users/stefan/Downloads/opencv-3.1.0dl/build \
    -D PYTHON2_LIBRARIES=/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/bin \
    -D PYTHON2_PACKAGES_PATH=~/.virtualenvs/cv/lib/python2.7/site-packages \
    -D PYTHON2_NUMPY_INCLUDE_DIRS=~/.virtualenvs/cv/lib/python2.7/site-packages/numpy/core/include \
    -D PYTHON2_INCLUDE_DIR=/usr/local/Frameworks/Python.framework/Headers \
    -D INSTALL_PYTHON_EXAMPLES=ON -D WITH_TBB=ON  -D INSTALL_C_EXAMPLES=ON \
    -D FFMPEG_INCLUDE_DIR=/usr/local/Cellar/ffmpeg/3.0.2/include \
    -D FFMPEG_LIB_DIR=/usr/local/Cellar/ffmpeg/3.0.2/lib \
    -D BUILD_EXAMPLES=ON \
    -D OPENCV_EXTRA_MODULES_PATH=~/Downloads/opencv_contrib-3.0.0/modules ..
终端输出包括:

--   Video I/O:
--     DC1394 1.x:                  NO
--     DC1394 2.x:                  NO
--     FFMPEG:                      YES
--       codec:                     YES (ver 57.24.102)
--       format:                    YES (ver 57.25.100)
--       util:                      YES (ver 55.17.103)
--       swscale:                   YES (ver 4.0.100)
--       resample:                  YES (ver 3.0.0)
--       gentoo-style:              YES
但是
CMakeError.log
的唯一错误是:

找不到ffmpeg/avformat.h文件

该文件确实存在于

/usr/local/Cellar/ffmpeg/3.0.2/include/libavformat/avformat.h
如果我在
cmake
命令中正确指定了
FFMPEG
include目录,我不理解为什么会出现此错误。此外,文件
CMakeLists.txt
中不存在变量
FMPEG\u INCLUDE\u DIR
FFMPEG\u LIB\u DIR


这是否使我在cake命令中使用这些变量变得无用?

我用

brew uninstall ffmpeg
brew install ffmpeg --build-from-source
所需的组件仅在下拉源时可用。
我用计算机解决了这个问题

brew uninstall ffmpeg
brew install ffmpeg --build-from-source
所需的组件仅在下拉源时可用。