Simple question but I have been struggling a lot trying to implement a solution: I have a c++ program with two threads. One is a motion detection algorithm and the other one records a video. The Detector
tells the Recorder
when to start and stop the video recording. They both need to read video frames from the same webcam. How can I achieve this?
If I create two VideoCapture
objects in each class the program crashes on start when it tries to open the second VideoCapture
with the same index. There must be a way around that.