def postprocess(
        self, value: str | Path | tuple[str | Path, str | Path | None] | None
    ) -> VideoData | None:
        """
        Parameters:
            value: 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.
        Returns:
            VideoData object containing the video and subtitle files.
        """
        if self.streaming:
            return value  # type: ignore
        if value is None or value in ([None, None], (None, None)):
            return None
        if isinstance(value, (str, Path)):
            processed_files = (self._format_video(value), None)

        elif isinstance(value, (tuple, list)):
            if len(value) != 2:
                raise ValueError(
                    f"Expected lists of length 2 or tuples of length 2. Received: {value}"
                )

            if not (
                isinstance(value[0], (str, Path)) and isinstance(value[1], (str, Path))
            ):
                raise TypeError(
                    f"If a tuple is provided, both elements must be strings or Path objects. Received: {value}"
                )
            video = value[0]
            subtitle = value[1]
            processed_files = (
                self._format_video(video),
                self._format_subtitle(subtitle),
            )

        else:
            raise Exception(f"Cannot process type as video: {type(value)}")
        if not processed_files[0]:
            raise ValueError("Video data missing")
        return VideoData(video=processed_files[0], subtitles=processed_files[1])

        Parameters:
            value: 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.
        Returns:
            VideoData object containing the video and subtitle files.
        
gradio/components/video.py