I donโt know why I couldnโt include the necessary Qt headers for processing frames (they always had unresolved dependencies and some didnโt exist), so I turned to OpenCV 3.0 and did it like this:
cv::VideoCapture cap(videoFileName); if(!cap.isOpened()) // check if we succeeded return; while (cap.isOpened()) { cv::Mat frame; cap >> frame; cv::flip(frame, frame, -1); cv::flip(frame, frame, 1); // get RGB channels w = frame.cols; h = frame.rows; int size = w * h * sizeof(unsigned char); unsigned char * r = (unsigned char*) malloc(size); unsigned char * g = (unsigned char*) malloc(size); unsigned char * b = (unsigned char*) malloc(size); for(int y = 0; y < h;y++) { for(int x = 0; x < w; x++) { // get pixel cv::Vec3b color = frame.at<cv::Vec3b>(cv::Point(x,y)); r[y * w + x] = color[2]; g[y * w + x] = color[1]; b[y * w + x] = color[0]; } } } cap.release();
It worked perfectly for my purpose, so I did not continue research.
Thank you anyway.
source share