我最近在Ubuntu 12.04中安裝了OpenCV 2.4.2。VideoCapture無法在OpenCV 2.4.2中工作
cap = VideoCapture(0)
正在工作。但我無法從某些視頻源抓取幀。
cap = VideoCapture("input.avi")
img = cap.read()
給我一個所有零元素的numpy。
我還安裝了ffmpeg的0.11,X264,爲v41-0.8.8(全部是最新的穩定版本)的最新快照
cmake -D WITH_QT=ON -D WITH_FFMPEG=ON -D WITH_OPENGL=ON -D WITH_TBB=ON -D BUILD_EXAMPLES=OFF WITH_V4L=ON ..
make
sudo make install
當我做cmake的,我得到這個
- - 檢測到的GNU GCC的版本:46(406)
- 實測值的OpenEXR:/usr/lib/libIlmImf.so
- 尋找LINUX/videodev.h
- 尋找LINUX/videodev.h - 不發現
- 尋找LINUX/videodev2.h
- 尋找LINUX/videodev2.h - 發現
- 尋找了libavformat/avformat.h
- 尋找了libavformat/avformat.h - 發現
- 尋找的ffmpeg/avformat.h
- 尋找的ffmpeg/avformat.h - 沒有找到
- 檢查模塊 'TBB'
- 包 'TBB' 未找到
而且
-- Video I/O:
-- DC1394 1.x: NO
-- DC1394 2.x: YES (ver 2.2.0)
-- FFMPEG: YES
-- codec: YES (ver 54.23.100)
-- format: YES (ver 54.6.100)
-- util: YES (ver 51.54.100)
-- swscale: YES (ver 2.1.100)
-- gentoo-style: YES
-- GStreamer:
-- base: YES (ver 0.10.36)
-- app: YES (ver 0.10.36)
-- video: YES (ver 0.10.36)
-- OpenNI: NO
-- OpenNI PrimeSensor Modules: NO
-- PvAPI: NO
-- UniCap: NO
-- UniCap ucil: NO
-- V4L/V4L2: Using libv4l (ver 0.8.8)
-- XIMEA: NO
-- Xine: NO
我看了videodev.h等
- /usr/include/linux/videodev2.h存在
- /usr/include/libavformat/avformat.h存在
- 的/ usr /local/include/libavformat/avformat.h存在
但我找不到ffmpeg/avformat.h
這裏有什麼問題?
我也有videoCapture一個問題,當試圖打開視頻時崩潰... – 2012-09-06 15:02:56