[OpenCV] 동영상 파일 출력(재생)하기


[OpenCV] 동영상 파일 출력(재생)하기

Visual Studio 2019 환경에서 OpenCV 4.9를 사용합니다. - 동영상 파일 출력 소스: #include #include int main() { cv::VideoCapture cap("CanonRock_drumCover.mp4"); cv::Mat frame; int fps = (int)cap.get(cv::CAP_PROP_FPS); //초당 프레임 수 if (cap.isOpened()) { while(1) { cap >> frame; if(frame.empty()) break; // 동영상 끝이면 루프 종료 cv::imshow("new", frame); if(cv::waitKey(1000 / fps) == 27) break; // 기본 속도로 재생 } } else { std::cerr << "Error: Failed to open the Media File." << std::endl; return -1; } c...


#OpenCV #VisualStudio #동영상출력

원문링크 : [OpenCV] 동영상 파일 출력(재생)하기