code: def make_video_repr_html(ex, *, use_colormap: bool):
      """Returns the encoded `<video>` or GIF <img/> HTML."""
      # Use GIF to generate a HTML5 compatible video if FFMPEG is not
      # installed on the system.
      images = [
          utils.create_thumbnail(frame, use_colormap=use_colormap)
          for frame in ex
      ]
  
      if not images:
          return "Video with 0 frames."
  
      # Display the video HTML (either GIF of mp4 if ffmpeg is installed)
      try:
          utils.ffmpeg_run(
              ["-version"]
          )  # Check for ffmpeg installation.
      except FileNotFoundError:
          # print as `stderr` is displayed poorly on Colab
          print("FFMPEG not detected. Falling back on GIF.")
          return _get_repr_html_gif(images)
      else:
          return _get_repr_html_ffmpeg(images)
  
imports: from __future__ import annotations
  import dataclasses
  import functools
  import io
  import os
  import tempfile
  from typing import Any, List, Optional, Type, Union
  from absl import logging
  from etils import epath
  import numpy
  from tensorflow_datasets.core import lazy_imports_lib
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.features import feature
  from tensorflow_datasets.core.proto import feature_pb2
  from tensorflow_datasets.core.utils import dtype_utils
  from tensorflow_datasets.core.utils import py_utils
  from tensorflow_datasets.core.utils import type_utils
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: make_video_repr_html(ex) and returns: str, _get_repr_html_ffmpeg, _get_repr_html_gif