diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2021-08-29 03:15:32 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2021-08-29 03:54:17 +0200 |
commit | e2405afeae0adfa32bde63a182e5f605ac8e8f16 (patch) | |
tree | aa5f8ddcfd289cca521915a0487538e3cdf3f3b6 /video-opencv | |
parent | 48d1d1a06eb6acad0b0f436dcc73a19b408edb32 (diff) |
tracker/pt, video/opencv: allow mjpeg media type
Diffstat (limited to 'video-opencv')
-rw-r--r-- | video-opencv/impl-camera.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/video-opencv/impl-camera.cpp b/video-opencv/impl-camera.cpp index 3f2a1b1a..7e357d7c 100644 --- a/video-opencv/impl-camera.cpp +++ b/video-opencv/impl-camera.cpp @@ -33,7 +33,7 @@ bool cam::is_open() bool cam::start(info& args) { stop(); - cap.emplace(idx + video_capture_backend); + cap.emplace(idx, cv::CAP_DSHOW); if (args.width > 0 && args.height > 0) { @@ -43,6 +43,9 @@ bool cam::start(info& args) if (args.fps > 0) cap->set(cv::CAP_PROP_FPS, args.fps); + if (args.use_mjpeg) + cap->set(cv::CAP_PROP_FOURCC, cv::VideoWriter::fourcc('M', 'J', 'P', 'G')); + if (!cap->isOpened()) goto fail; |