Defining the strategy to perform forgery detection

Thank you for answering me. After a full day of trying to understand and implement your suggestions, I have a couple of questions:

First, I tried to use UMat before posting here, in my Farneback implementation, but I did not notice much (if any) speed up, and I also didn’t notice much GPU when it was executing. That’s why I went the multiprocessing route in the first place. So maybe I am skipping a step? All I have to do is transform a np.ndarray into cv.UMat and nothing else?

The other question is, when I try to implement the DISOpticalFlow method, I am getting an error. Here is my code:

cap = cv.VideoCapture('video_file.dav')
    ret, frame1 = cap.read()

    prev_frame = cv.UMat(cv.cvtColor(frame1, cv.COLOR_BGR2GRAY))

    optical_flow_magnitudes_vect = []

    dis = cv.DISOpticalFlow.create(preset=1)

    while 1:
        ret, frame2 = cap.read()
        if not ret:
            print('End of video frames.')
            break

        next_frame = cv.UMat(cv.cvtColor(frame2, cv.COLOR_BGR2GRAY))
        optical_flow = cv.UMat.get(dis.calc(frame1, frame2, None))

Returns:

Traceback (most recent call last):
  File "C:\Users\user\PycharmProjects\project\test.py", line 33, in <module>
    optical_flow = cv.UMat.get(dis.calc(frame1, frame2, None))
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cv2.error: OpenCV(4.11.0) D:\a\opencv-python\opencv-python\opencv\modules\video\src\dis_flow.cpp:1434: error: (-215:Assertion failed) !I0.empty() && I0.depth() == CV_8U && I0.channels() == 1 in function 'cv::DISOpticalFlowImpl::calc'

And the funny thing is, when I tried to implement this method but using the previous strategy of multiprocessing via CPU, it gave some errors but ran. Different erros, mind you, whilst the optical flow code was mostly the same.

I would greatly appreciate it if you could help me once again. I spent a good portion of today trying to understand OpenCL and how to implement it because I was sure I was missing something, but was unable to find it by myself.