code: def temp_encoded_video(
      num_frames: int, fps: int, height=10, width=10, prefix=None
  ):
      """
      Creates a temporary lossless, mp4 video with synthetic content. Uses a context which
      deletes the video after exit.
      """
      # Lossless options.
      video_codec = "libx264rgb"
      options = {"crf": "0"}
      data = create_dummy_video_frames(num_frames, height, width)
      with tempfile.NamedTemporaryFile(
          prefix=prefix, suffix=".mp4"
      ) as f:
          f.close()
          io.write_video(
              f.name,
              data,
              fps=fps,
              video_codec=video_codec,
              options=options,
          )
          yield f.name, thwc_to_cthw(data).to(torch.float32)
      os.unlink(f.name)
  
file_path: pytorchvideo/tests/utils.py
imports: import contextlib
  import os
  import pathlib
  import tempfile
  import av
  import numpy
  import torch
  import torchvision.io
  import torchvision.transforms
  from pytorchvideo.data.dataset_manifest_utils import EncodedVideoInfo, VideoFrameInfo, VideoInfo
  from pytorchvideo.data.utils import thwc_to_cthw
label_desc: Use image node_id 3 for calling a global function with example usage: temp_encoded_video(num_frames, fps, height, width, prefix) without return types