aboutsummaryrefslogtreecommitdiff
path: root/src/playback.cc
diff options
context:
space:
mode:
authorYour Name <you@example.com>2021-08-17 08:54:45 -0400
committerYour Name <you@example.com>2021-08-17 08:54:45 -0400
commit5e4240ea795c992635a3cfc464d760205e07bf05 (patch)
treeb2a19cded0a2194a4554ceca7a1bbb69d1633701 /src/playback.cc
parent8c884838ced928d29a8436be8b2808766c5a1e53 (diff)
downloadannotator-5e4240ea795c992635a3cfc464d760205e07bf05.tar.gz
annotator-5e4240ea795c992635a3cfc464d760205e07bf05.tar.bz2
annotator-5e4240ea795c992635a3cfc464d760205e07bf05.zip
Updated keys
Diffstat (limited to 'src/playback.cc')
-rw-r--r--src/playback.cc4
1 files changed, 2 insertions, 2 deletions
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<playback_impl>(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;