The solution for your problem is already mentioned in the other question you linked to: You have to set the codec before you set the wanted resolution:
Capture cv::VideoCapture;
Capture.open(0);
Capture.set(CV_CAP_PROP_FOURCC, CV_FOURCC('M','J','P','G'))
Capture.set(CV_CAP_PROP_FRAME_WIDTH, 1920):
Capture.set(CV_CAP_PROP_FRAME_HEIGHT, 1080);