Camera Index out of range when trying to use cv2.VideoCapture(0) for the second time
(On Raspberry Pi 5) I am using a python script (control.py) to start another python script (main.py) in a separate thread. main.py uses cv2 to get frames from a webcam attached to my Raspberry Pi. control.py has an interval mode, meaning it starts main.py, which executes until a fixed time is reached, pauses, and then starts main.py again. The first time, everything works flawlessly. However, the second time, I get this error: