I'm a beginner to opencv, and I've been trying out some basic things using the library. I've added all the dependencies in VS, so generally the image processing related codes work. However, I am getting the following error on the console for one video-related program:
warning: Error opening file (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:578) Press any key to continue.
My code is as follows:
#include "opencv2\highgui\highgui.hpp"
#include "opencv2\imgproc\imgproc.hpp"
using namespace cv;
int main(int argc, char** argv) {
namedWindow("Video", WINDOW_AUTOSIZE);
VideoCapture cap;
cap.open(argv[1]);
Mat frame;
for (;;) {
cap >> frame;
if (frame.empty()) break;
imshow("Video", frame);
if (waitKey(33) >= 0) break;
}
return 0;
}
I downloaded ffmpeg, and added it my Path environment variable as well, it did not work. I've searched quite extensively online for this, but to no avail. Any help is appreciated.