Sorry for my mistake, i meant custom Dataset as well.
Can you please clarify what do you mean by labels?
is labels the GT labels for the corresponding video that im reading? and in what format i should have the labels? or is lables like the video index (name of the video)?
Also, is it necessary to have the labels in out put?
last but not least,  do i need to convert the numpy to torch inside the MyDataset function?
UPDATE:
So I did it as you mentioned (lets not worry about the transpose right now, i can take care of it late).

class MyDataset(Dataset):
    '''Custom dataset-class for loading video-frames'''
    def __init__(self, VideosPath):
        Videos = os.listdir(VideosPath) # get all files' and folders' names in the current directory
        Videos.sort()
        self.num_videos = len(Videos)
        self.video_directory = VideosPath
        self.videos = Videos
    def __len__(self):
        return len(self.num_videos)
    
    def __getitem__(self, i):
        cap = cv2.VideoCapture(os.path.join(self.video_directory, self.videos[i]))
        
        # reading all frames into a big ndarray

        
        width = cap.get(cv2.CAP_PROP_FRAME_WIDTH)
        height = cap.get(cv2.CAP_PROP_FRAME_HEIGHT)
        num_frames = cap.get(cv2.CAP_PROP_FRAME_COUNT)
        print(width,height,num_frames)
        frames = np.zeros((int(num_frames), int(height), int(width), 3))
        count = 0
        while count < num_frames:
            succesful, frame = cap.read()
        #     print(succesful)
            if not succesful:
                break
            else:
                frames[count] = frame

        frames = torch.Tensor(frames)

        labels = i # not sure what should be for lables, please let me know
        return {'frames': frames, 'labels': labels}

but when i wanna test it:

VideosPath = '/home/alireza/Desktop/Datasets/VID/ILSVRC-Old/Data/VID/snippets/train/ILSVRC2015_VID_train_0000/' # this videospath includes 1000 videos

Training = MyDataset(VideosPath)
print(Training)
None

I get none as the output of my print 
I also checked and the code inside the __getitem__ is correct,
Test check:
VideosPath = '/home/alireza/Desktop/Datasets/VID/ILSVRC-Old/Data/VID/snippets/train/ILSVRC2015_VID_train_0000/'
Videos = os.listdir(VideosPath) # get all files' and folders' names in the current directory
Videos.sort()
print('len:',len(Videos))
i= 0
cap = cv2.VideoCapture(os.path.join(VideosPath, Videos[i]))
print(cap)

len: 1000
<VideoCapture 0x7f193b976890>


But i don’t know why MyDataset is not working