I just encountered a similar problem with the same error message. I was able to solve it in code as follows:
import os os.environ["OPENCV_FFMPEG_READ_ATTEMPTS"] = str(2**18) import cv2
The rest of the code needed no changes.