I was following the example given in the OpenCV for video displaying, just took out some transformations unnecessary for me. The code I have right now loads the video file and then displays it, the problem is that reproduced video have wrong colours.
Here's the code:
using namespace std;
using namespace cv;
// The main function
int main (int argc, char *argv[])
{
VideoCapture cap ("ETMI 002.mpg"); // Open the file
if (!cap.isOpened ()) // Check if opening was successful
cerr << "I have failed!" << endl;
else
{
Mat edges;
Mat frame;
namedWindow("edges",1);
while (cap.read (frame))
{
cvtColor(frame, edges, CV_BGR2RGB);
imshow("edges", edges);
if(waitKey(30) >= 0) break;
}
}
return 0;
}