From 5e4240ea795c992635a3cfc464d760205e07bf05 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 17 Aug 2021 08:54:45 -0400 Subject: Updated keys --- src/playback.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/playback.cc') diff --git a/src/playback.cc b/src/playback.cc index 045abb6..8839528 100644 --- a/src/playback.cc +++ b/src/playback.cc @@ -13,14 +13,14 @@ namespace frontend { std::size_t frameNum = 0; }; - playback::playback(const std::filesystem::path& video) { + playback::playback(const std::filesystem::path& video, std::size_t frameCap) { data = std::shared_ptr(new playback_impl); cv::VideoCapture cap(video); if(!cap.isOpened()) { throw std::runtime_error("Error loading video " + video.string()); } data->fps = cap.get(cv::CAP_PROP_FPS); - while(true) { + while(frameCap == 0 or data->images.size() < frameCap) { cv::Mat frame; cap >> frame; if(frame.empty()) break; -- cgit v1.2.3