def write(outputs, input_path, output_path, frame_rate=30):
    '''
        write results to the output_path.
    '''

    if osp.exists(output_path) is False:
        os.makedirs(output_path)

    
    size = outputs[0].shape[2:][::-1]

    _, file_name_with_extension = os.path.split(input_path)
    file_name, _ = os.path.splitext(file_name_with_extension)

    save_video_path = f'{output_path}/output_{file_name}.mp4'
    writer = cv2.VideoWriter(save_video_path, cv2.VideoWriter_fourcc(*"mp4v"), 
                        frame_rate, size)

    for i, imgt_pred in enumerate(outputs):
        imgt_pred = tensor2img(imgt_pred)
        imgt_pred = cv2.cvtColor(imgt_pred, cv2.COLOR_RGB2BGR)
        writer.write(imgt_pred)        
    print(f"Demo video is saved to [{save_video_path}]")

    writer.release()
write results to the output_path.
opensora/models/frame_interpolation/interpolation.py