def METHOD_NAME(self, inputs: Dict[str, Any], **kwargs) -> Dict[str, Any]:
    output_video_path = kwargs.get('output_video', None)
    demo_service = kwargs.get('demo_service', True)
    if output_video_path is None:
        output_video_path = tempfile.NamedTemporaryFile(suffix='.mp4').name
    h, w = inputs['output'].shape[-2:]
    fourcc = cv2.VideoWriter_fourcc(*'mp4v')
    video_writer = cv2.VideoWriter(output_video_path, fourcc,
                                   inputs['fps'], (w, h))
    for i in range(0, inputs['output'].size(1)):
        img = tensor2img(inputs['output'][:, i, :, :, :])
        video_writer.write(img.astype(np.uint8))
    video_writer.release()
    if demo_service:
        assert os.system(
            'ffmpeg -version'
        ) == 0, 'ffmpeg is not installed correctly, please refer to https://trac.ffmpeg.org/wiki/CompilationGuide.'
        output_video_path_for_web = output_video_path[:-4] + '_web.mp4'
        convert_cmd = f'ffmpeg -i {output_video_path} -vcodec h264 -crf 5 {output_video_path_for_web}'
        subprocess.call(convert_cmd, shell=True)
        return {OutputKeys.OUTPUT_VIDEO: output_video_path_for_web}
    else:
        return {OutputKeys.OUTPUT_VIDEO: output_video_path}