code: def make_video(tensor, fps):
      try:
          import moviepy  # noqa: F401
      except ImportError:
          print("add_video needs package moviepy")
          return
      try:
          from moviepy import editor as mpy
      except ImportError:
          print(
              "moviepy is installed, but can't import moviepy.editor.",
              "Some packages could be missing [imageio, requests]",
          )
          return
  
      import moviepy.version
      import tempfile
  
      t, h, w, c = tensor.shape
  
      # encode sequence of images into gif string
      clip = mpy.ImageSequenceClip(list(tensor), fps=fps)
  
      filename = tempfile.NamedTemporaryFile(
          suffix=".gif", delete=False
      ).name
  
      if moviepy.version.__version__.startswith("0."):
          logger.warning(
              "Upgrade to moviepy >= 1.0.0 to supress the progress bar."
          )
          clip.write_gif(filename, verbose=False)
      elif moviepy.version.__version__.startswith("1."):
          # moviepy >= 1.0.0 use logger=None to suppress output.
          clip.write_gif(filename, verbose=False, logger=None)
      else:
          # Moviepy >= 2.0.0.dev1 removed the verbose argument
          clip.write_gif(filename, logger=None)
  
      with open(filename, "rb") as f:
          tensor_string = f.read()
  
      try:
          os.remove(filename)
      except OSError:
          logger.warning(
              "The temporary file used by moviepy cannot be deleted."
          )
  
      return Summary.Image(
          height=h,
          width=w,
          colorspace=c,
          encoded_image_string=tensor_string,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import logging
  import numpy
  import os
  import re
  from .proto.summary_pb2 import Summary
  from .proto.summary_pb2 import HistogramProto
  from .proto.summary_pb2 import SummaryMetadata
  from .proto.tensor_pb2 import TensorProto
  from .proto.tensor_shape_pb2 import TensorShapeProto
  from .proto.plugin_pr_curve_pb2 import PrCurvePluginData
  from .proto.plugin_text_pb2 import TextPluginData
  from .proto.plugin_mesh_pb2 import MeshPluginData
  from .proto import layout_pb2
  from .x2num import make_np
  from .utils import _prepare_video, convert_to_HWC, convert_to_NTCHW
label_desc: Use image node_id 13 for calling a global function with example usage: make_video(tensor, fps) and returns: Summary