Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

openCV 3.1.0 videocapture can't open a video

$
0
0
Hello, I've installed opencv 3.1.0, building on my own with visual studio 2010 and everything is working but videocapture, compiling but not running; I've tried all I could find on the net (updated K-lite codecs and put the opencv_ffmpeg310_64.dll in the compiler directory C:\opencv\build\x64\vc10\bin) The simple test code I'm using: #include #include #include #include #include using namespace cv; using namespace std; int main(int argc, char** argv) { Mat imagex; imagex = imread("C:/opencv/data/test.png", IMREAD_COLOR); // Read the file if( imagex.empty() ) // Check for invalid input { cout << "Could not open or find the image" << std::endl ; return -3; } else cout << "image opened" << std::endl ; ifstream myfile; myfile.open ("C:/opencv/data/pictCh0_0.yuv", ios::binary|ios::ate); //open the yuv422 file if (!myfile.is_open()) { fprintf(stderr, "error: unable to open file"); return 1; } else cout << "file opened" << std::endl ; // Open a video file: cv::VideoCapture cap("C:/opencv/data/test.avi"); if(!cap.isOpened()) { std::cout << "Unable to open the camera\n"; std::exit(-1); } ...... etc...... it reads the image and the binary file but not the video and I've tried any kind of video, also the same test.pgn image read by imread. I tried to debug but no errors, simply it does not load anything. The most annoying thing is that with the pre-built libraries 3.1.0 it runs even though in the compiler directory only but I can't use them because they don't support CUDA... Any clue? Thanks in advance.

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>