| 246 | return answer |
| 247 | |
| 248 | class VideoReader(Reader): |
| 249 | def parse(self, file_path: Path, task: str = "Describe this image as detail as possible.", frame_interval: int = 30, used_audio: bool = True) -> list: |
| 250 | logger.info(f"Processing video file from {file_path} with frame interval {frame_interval}.") |
| 251 | runner = VisualLLMRegistry.get() |
| 252 | answer = runner.gen_video(task, file_path, frame_interval) |
| 253 | |
| 254 | if used_audio: |
| 255 | audio_content = AudioReader.parse(file_path) |
| 256 | |
| 257 | return answer + "The audio includes:\n" + audio_content |
| 258 | |
| 259 | |
| 260 | |