def colab_show_videos_mp4(
    video_paths: Tuple[str, ...],
    video_width: int = 128,
    autoplay: bool = False,
    muted: bool = True,
):
  """Shows the video grid in the Colab.

  Args:
    video_paths: a list of video paths to show.
    video_width: the width of the videos.
    autoplay: auto play the video in a loop. Not use it for videos with sound.
    muted: Whether to mute the video by default

  Returns:
    a HTML component to show in the colab.
  """
  results = []
  if isinstance(video_paths, str):
    video_paths = [video_paths]

  video_flags = 'controls '
  if autoplay:
    video_flags += 'autoplay loop '
  if muted:
    video_flags += 'muted '

  for path in video_paths:
    if not path.endswith('mp4'):
      continue
    with open(path, 'r+b') as f:
      video_file = f.read()
    video_url = (
        f'data:video/mp4;base64,{base64.b64encode(video_file).decode()}'
    )
    results.append(f"""<video width={video_width} {video_flags}>
                   <source src="{video_url}"></video>""")
  return display.HTML('\n'.join(results))
Shows the video grid in the Colab.

  Args:
    video_paths: a list of video paths to show.
    video_width: the width of the videos.
    autoplay: auto play the video in a loop. Not use it for videos with sound.
    muted: Whether to mute the video by default

  Returns:
    a HTML component to show in the colab.
  
videogvt/interfaces/colab_utils.py