def _infer_modality_from_probe(self, modality_list: list[str], format_name: Optional[str]) -> Optional[Modality]:
        """
        Infer the modality from the probed media file. This is used to determine whether the media is audio or video.
        """
        if Modality.VIDEO in modality_list:
            # Images are also considered as video in ffmpeg, so we need to check the format name to
            # differentiate between video and image
            if "image" in format_name or "_pipe" in format_name:
                return Modality.IMAGE
            else:
                return Modality.VIDEO
        elif Modality.AUDIO in modality_list:
            return Modality.AUDIO
        else:
            return None

        Infer the modality from the probed media file. This is used to determine whether the media is audio or video.
        
src/marqo/inference/media_download_and_preprocess/streaming_media_processor.py