def get_input_video_from_path(input_path, device="cuda"):

    '''
        Get the input video from the input_path.

        params:
            input_path: str, the path of the input video.
            devices: str, the device to run the model.
        returns:
            inputs: list, the list of the input frames.
            scale: float, the scale of the input frames.
            padder: InputPadder, the padder to pad the input frames.
    '''

    anchor_resolution, anchor_memory, anchor_memory_bias, vram_avail = init(device)

    if osp.splitext(input_path)[-1] in ['.mp4', '.avi', '.mov', '.mkv', '.flv', '.wmv', 
                                        '.webm', '.MP4', '.AVI', '.MOV', '.MKV', '.FLV', 
                                        '.WMV', '.WEBM']:

        vcap = cv2.VideoCapture(input_path)

        inputs = []
        w = int(vcap.get(cv2.CAP_PROP_FRAME_WIDTH))
        h = int(vcap.get(cv2.CAP_PROP_FRAME_HEIGHT))
        scale = anchor_resolution / (h * w) * np.sqrt((vram_avail - anchor_memory_bias) / anchor_memory)
        scale = 1 if scale > 1 else scale
        scale = 1 / np.floor(1 / np.sqrt(scale) * 16) * 16
        if scale < 1:
            print(f"Due to the limited VRAM, the video will be scaled by {scale:.2f}")
        padding = int(16 / scale)
        padder = InputPadder((h, w), padding)
        while True:
            ret, frame = vcap.read()
            if ret is False:
                break
            frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
            frame_t = img2tensor(frame).to(device)
            frame_t = padder.pad(frame_t)
            inputs.append(frame_t)
        print(f'Loading the [video] from {input_path}, the number of frames [{len(inputs)}]')
    else:
        raise TypeError("Input should be a video.")
    
    return inputs, scale, padder
Get the input video from the input_path.

params:
input_path: str, the path of the input video.
devices: str, the device to run the model.
returns:
inputs: list, the list of the input frames.
scale: float, the scale of the input frames.
padder: InputPadder, the padder to pad the input frames.
opensora/models/frame_interpolation/interpolation.py