VideoCapture is not working in OpenCV 2.4.2

前端 未结 2 507
忘掉有多难
忘掉有多难 2020-12-09 05:36

I recently installed OpenCV 2.4.2 in Ubuntu 12.04.

cap = VideoCapture(0)

is working. but I can\'t grab frames from some video source.

相关标签:
2条回答
  • 2020-12-09 06:03

    To run a full installation of OpenCV try the following:

    sudo apt-get install libopencv-dev python-opencv

    For more details check out the following link http://milq.github.io/install-opencv-ubuntu-debian/

    0 讨论(0)
  • 2020-12-09 06:28

    So, I realized there was some problem with ffmpeg. and I rebuilt and installed ffmpeg and then changed flags for cmake to make opencv.

    For ffmpeg,

     ./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab 
    make 
    sudo make install
    

    For OpenCV,

    cmake -D CMAKE_BUILD_TYPE=RELEASE ..
    make
    sudo make install
    

    Here's the complete script to install OpenCV 2.4.2 https://github.com/jayrambhia/Install-OpenCV/blob/master/Ubuntu/2.4/opencv2_4_2.sh

    and here's my blogpost about OpenCV 2.4.2 installation in detail http://jayrambhia.com/blog/install-opencv-2-4-in-ubuntu-12-04-precise-pangolin/

    0 讨论(0)
提交回复
热议问题