Video classification dataloader

Hi all. Does anyone have experience in classifying videos using deep learning with pytorch? I’m having a bottleneck in reading videos with the dataloader. The videos are stored in mp4 format and I use the OpenCV library.
I have tried to increase the batch size but it doesn’t improve the speed, it even seems to slow down.
Can anyone tell me how to improve the reading speed?
Here is the part of the code where I read the videos.

frames = []
v_cap = cv2.VideoCapture(filename)
start_frame_number = frame_list[0]
last_frame_number = frame_list[-1]

v_cap.set(cv2.CAP_PROP_POS_FRAMES, start_frame_number)

for fn in range(start_frame_number, last_frame_number + 1):
    success, frame = v_cap.read()
    if fn in frame_list:
        frame = Image.fromarray(frame)
        img_tens = transform(frame)
        frames.append(img_tens)

v_cap.release()

You could give DALI a try and check if e.g. decoding the video on your GPU would speed up the training.

Thanks for your response.
Another problem I am having is that I have a significant speed difference (three times) in the execution of the code on different PCs. On the computer with the more powerful GPU I have less speed in reading the video. In both I am working with the same versions of Pytorch and OpenCV. What can these differences be due to?