class_docstr: Creates a video component that can be used to upload/record videos (as an input) or display videos (as an output).
  For the video to be playable in the browser it must have a compatible container and codec combination. Allowed
  combinations are .mp4 with h264 codec, .ogg with theora codec, and .webm with vp9 codec. If the component detects
  that the output video would not be playable in the browser it will attempt to convert it to a playable mp4 video.
  If the conversion fails, the original video is returned.
  Preprocessing: passes the uploaded video as a {str} filepath or URL whose extension can be modified by `format`.
  Postprocessing: expects a {str} or {pathlib.Path} filepath to a video which is displayed, or a {Tuple[str | pathlib.Path, str | pathlib.Path | None]} where the first element is a filepath to a video and the second element is an optional filepath to a subtitle file.
  Examples-format: a {str} filepath to a local file that contains the video, or a {Tuple[str, str]} where the first element is a filepath to a video file and the second element is a filepath to a subtitle file.
  Demos: video_identity, video_subtitle
docstr: Processes a video to ensure that it is in the correct format.
docstr_tok: ["Processes","a","video","to","ensure","that","it","is","in","the","correct","format","."]
code: def _format_video(self, video: str | Path | None) -> FileData | None:
      """
      Processes a video to ensure that it is in the correct format.
      """
      if video is None:
          return None
      video = str(video)
      returned_format = video.split(".")[-1].lower()
      if self.format is None or returned_format == self.format:
          conversion_needed = False
      else:
          conversion_needed = True
  
      is_url = client_utils.is_http_url_like(video)
  
      # For cases where the video is a URL and does not need to be converted to another format, we can just return the URL
      if is_url and not (conversion_needed):
          return FileData(path=video)
  
      # For cases where the video needs to be converted to another format
      if is_url:
          video = processing_utils.save_url_to_cache(
              video, cache_dir=self.GRADIO_CACHE
          )
      if (
          processing_utils.ffmpeg_installed()
          and not processing_utils.video_is_playable(video)
      ):
          warnings.warn(
              "Video does not have browser-compatible container or codec. Converting to mp4"
          )
          video = processing_utils.convert_video_to_playable_mp4(video)
      # Recalculate the format in case convert_video_to_playable_mp4 already made it the selected format
      returned_format = utils.get_extension_from_file_path_or_url(
          video
      ).lower()
      if self.format is not None and returned_format != self.format:
          if wasm_utils.IS_WASM:
              raise wasm_utils.WasmUnsupportedError(
                  "Returning a video in a different format is not supported in the Wasm mode."
              )
          output_file_name = (
              video[0 : video.rindex(".") + 1] + self.format
          )
          ff = FFmpeg(
              inputs={video: None},
              outputs={output_file_name: None},
              global_options="-y",
          )
          ff.run()
          video = output_file_name
  
      return FileData(path=video, orig_name=Path(video).name)
  
imports: from __future__ import annotations
  import tempfile
  import warnings
  from pathlib import Path
  from typing import Any, Callable, Literal, Optional
  from gradio_client import utils
  from gradio_client.documentation import document, set_documentation_group
  import gradio
  from gradio import processing_utils, utils, wasm_utils
  from gradio.components.base import Component
  from gradio.data_classes import FileData, GradioModel
  from gradio.events import Events
label_desc: Use image node_id 4 for calling the Video obj's underlying member method code with example usage: obj._format_video(video) and returns: FileData, None, FileData