{"record":{"id":"2edadab8e9a8b6b9","repo":"sgl-project/sglang","slug":"video-sampling-strategy-not-specified","errorCode":null,"errorMessage":"Video sampling strategy not specified","messagePattern":"Video sampling strategy not specified","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/multimodal/processors/mimo_v2.py","lineNumber":673,"sourceCode":"                kwargs[k] = self.default_video_processor_kwargs[k]\n        if video.num_frames is not None:\n            kwargs[\"num_frames\"] = video.num_frames\n        elif video.fps is not None:\n            kwargs[\"fps\"] = video.fps\n            if video.max_frames is not None:\n                kwargs[\"max_frames\"] = video.max_frames\n            if video.min_frames is not None:\n                kwargs[\"min_frames\"] = video.min_frames\n        elif self.default_video_processor_kwargs[\"num_frames\"] is not None:\n            kwargs[\"num_frames\"] = self.default_video_processor_kwargs[\"num_frames\"]\n        elif self.default_video_processor_kwargs[\"fps\"] is not None:\n            kwargs[\"fps\"] = self.default_video_processor_kwargs[\"fps\"]\n            if self.default_video_processor_kwargs[\"max_frames\"] is not None:\n                kwargs[\"max_frames\"] = self.default_video_processor_kwargs[\"max_frames\"]\n            if self.default_video_processor_kwargs[\"min_frames\"] is not None:\n                kwargs[\"min_frames\"] = self.default_video_processor_kwargs[\"min_frames\"]\n        else:\n            raise ValueError(\"Video sampling strategy not specified\")\n        return kwargs\n\n    def process_image(self, image: ImageInput):\n        kwargs = self.prepare_image_kwargs(image)\n        image = image.image\n        if isinstance(image, (str, bytes)):\n            image = self.fetch_image(image)\n        image_transformed_tensor, _, _ = self.get_visual_transform(\n            image,\n            factor=self.patch_size * self.merge_size,\n            min_pixels=kwargs[\"min_pixels\"],\n            max_pixels=kwargs[\"max_pixels\"],\n            device=self.device,\n        )\n        return image_transformed_tensor\n\n    def process_video(\n        self, video_input: VideoInput | VideoAudioInput, temporal_padding_factor=None","sourceCodeStart":655,"sourceCodeEnd":691,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/multimodal/processors/mimo_v2.py#L655-L691","documentation":"Raised by prepare_video_kwargs in MiMo-V2 when default_video_processor_kwargs is falsy (None or empty) so no fps/max_frames/min_frames can be derived. Without a sampling strategy the video processor cannot decide which frames to sample, so it refuses rather than guessing.","triggerScenarios":"Instantiating MiMoProcessor without default_video_processor_kwargs (or with an empty dict) and then calling process_video / prepare_video_kwargs on a video input that doesn't itself carry fps settings.","commonSituations":"A checkpoint's preprocessor_config lacks video sampling fields (fps, max_frames, min_frames); constructing the processor programmatically in tests without full config; config migrations that drop the video section.","solutions":["Populate default_video_processor_kwargs with at least {'fps': ...} when constructing MiMoProcessor","Check the model's preprocessor_config.json for the video sampling section and pass it through","If building the processor manually for tests, supply explicit fps/min_frames/max_frames values"],"exampleFix":"# before\nproc = MiMoProcessor(hf_config, server_args, _processor)  # no video kwargs\n# after\nproc = MiMoProcessor(hf_config, server_args, _processor,\n                     default_video_processor_kwargs={'fps': 2.0, 'max_frames': 16, 'min_frames': 4})","handlingStrategy":"validation","validationCode":"kwargs = proc.default_video_processor_kwargs or {}\nassert kwargs.get('fps') is not None, 'default_video_processor_kwargs must define fps before process_video'","typeGuard":null,"tryCatchPattern":"try:\n    out = proc.process_video(video_input)\nexcept ValueError as e:\n    if 'Video sampling strategy not specified' in str(e):\n        proc.default_video_processor_kwargs = {'fps': 2.0, 'max_frames': 16, 'min_frames': 4}\n        out = proc.process_video(video_input)\n    else:\n        raise","preventionTips":["Always construct MiMoProcessor with video sampling kwargs","Validate required config keys at startup, not request time","Copy fps/min_frames/max_frames from the checkpoint's preprocessor_config"],"tags":["video","config","sampling","missing-value"],"backgroundTag":"missing-config-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}