VideoCapture не работает в OpenCV 2.4.2

Недавно я установил OpenCV 2.4.2 в Ubuntu 12.04.

cap = VideoCapture(0)

работает. но я не могу захватить кадры из какого-то источника видео.

cap = VideoCapture("input.avi")
img = cap.read() 

дает мне numpy со всеми нулевыми элементами.

Я также установил ffmpeg 0.11, последний снимок x264, v4l -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, я получаю это

-- Detected version of GNU GCC: 46 (406)
-- Found OpenEXR: /usr/lib/libIlmImf.so
-- Looking for linux/videodev.h
-- Looking for linux/videodev.h - not found
-- Looking for linux/videodev2.h
-- Looking for linux/videodev2.h - found
-- Looking for libavformat/avformat.h
-- Looking for libavformat/avformat.h - found
-- Looking for ffmpeg/avformat.h
-- Looking for ffmpeg/avformat.h - not found
-- checking for module 'tbb'
-- package 'tbb' not found

И

--   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

В чем проблема?

12
задан Ulrich Stern 8 September 2013 в 18:52
поделиться