Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I am trying to open a video file qith video capture. I have compiled it on VS10 and it is ok.
but when I compile it on linux (ubuntu 11.10) and try to run it, it does not open the file and it is not giving any errors or warnings either.
Here is the code:
int main(int argc, char** argv)
if (argc < 2)
std::cout << "Usage: " << argv[0] << " <input.avi>" << std::endl;
exit(1);
// Video Capture:
VideoCapture capture(argv[1]);
if(!capture.isOpened())
printf("Failed to open %s\nExiting ...\n",argv[1]);
exit (1);
return 0;
And it always outputs "Filed to open".
what could be the problem?
Even I had the same problem. I hadn't configured ffmpeg properly. Look at this question
VideoCapture is not working in OpenCV 2.4.2
You need to configure ffmpeg properly.
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
sudo make install
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.