cv2.waitKey() 하면 혹시나 내부 쓰레드가 돌아갈까 싶어서 했는데 이것도 아니긴 하다.
Try placingcv::waitKey(0);beforecap0.read(frame0); instead of after:if (!frame0.empty()) cv::waitKey(0);. The issue is, that you are not going to see the video. If you want to watch the video, and pause when key is pressed, replacecv::waitKey(0);with:int key = cv::waitKey(1);if (key > 0) cv::waitKey(0);