{"record":{"id":"2ea7f1207da36803","repo":"crewAIInc/crewAI","slug":"video-filename-duration-duration-1f-s-exce","errorCode":null,"errorMessage":"Video '{filename}' duration ({duration:.1f}s) exceeds maximum ({constraints.max_duration_seconds}s)","messagePattern":"Video '(.+?)' duration \\((.+?)s\\) exceeds maximum \\((.+?)s\\)","errorType":"validation","errorClass":"FileValidationError","httpStatus":null,"severity":"error","filePath":"lib/crewai-files/src/crewai_files/processing/validators.py","lineNumber":440,"sourceCode":"    _validate_format(\n        \"Video\",\n        filename,\n        file.content_type,\n        constraints.supported_formats,\n        errors,\n        raise_on_error,\n    )\n\n    if constraints.max_duration_seconds is not None:\n        duration = _get_video_duration(content)\n        if duration is not None and duration > constraints.max_duration_seconds:\n            msg = (\n                f\"Video '{filename}' duration ({duration:.1f}s) exceeds \"\n                f\"maximum ({constraints.max_duration_seconds}s)\"\n            )\n            errors.append(msg)\n            if raise_on_error:\n                raise FileValidationError(msg, file_name=filename)\n\n    return errors\n\n\ndef validate_text(\n    file: TextFile,\n    constraints: ProviderConstraints,\n    *,\n    raise_on_error: bool = True,\n) -> Sequence[str]:\n    \"\"\"Validate a text file against general constraints.\n\n    Args:\n        file: The text file to validate.\n        constraints: Provider constraints to validate against.\n        raise_on_error: If True, raise exceptions on validation failure.\n\n    Returns:","sourceCodeStart":422,"sourceCodeEnd":458,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-files/src/crewai_files/processing/validators.py#L422-L458","documentation":"validate_video probes the video's duration and raises FileValidationError when duration > constraints.max_duration_seconds (message shows actual duration at one decimal and the limit). It is the video counterpart of the audio check and runs only when duration extraction succeeds and the constraint is set.","triggerScenarios":"Validating a video (e.g. a 10-minute clip, 600s) against VideoConstraints(max_duration_seconds=120) with raise_on_error=True or through STRICT-mode processing. Videos under the limit pass.","commonSituations":"Video-understanding providers capping clip length (often 1-10 minutes); screen recordings and event footage attached whole; limits configured for short clips but hit by full uploads.","solutions":["Split the video upstream with ffmpeg (-f segment or -ss/-t cuts) into clips under max_duration_seconds.","Raise max_duration_seconds within the provider's documented cap.","Extract key frames or a transcript and attach those as images/text instead of full video.","Catch FileValidationError and surface the duration numbers to the uploader."],"exampleFix":"# before\nconstraints = VideoConstraints(max_duration_seconds=120)\nvalidate_video(screen_recording, constraints)  # FileValidationError: 612.0s exceeds maximum 120s\n\n# after\n# shell: ffmpeg -i recording.mp4 -f segment -segment_time 120 -c copy rec_%02d.mp4\nfor clip in segmented_clips:\n    validate_video(clip, constraints)  # each clip passes","handlingStrategy":"validation","validationCode":"duration = probe_video_duration(content)  # ffprobe\nif constraints.max_duration_seconds is not None and duration > constraints.max_duration_seconds:\n    return split_or_reject(file, duration, constraints.max_duration_seconds)","typeGuard":null,"tryCatchPattern":"from crewai_files.processing.exceptions import FileValidationError\n\ntry:\n    processor.process(video_file)\nexcept FileValidationError as e:\n    if \"duration\" in str(e):\n        return split_video(file, segment_seconds=constraints.max_duration_seconds)\n    raise","preventionTips":["Check clip length with ffprobe before attaching video.","Cut long footage into under-limit clips (ffmpeg -ss/-t or -f segment).","Align max_duration_seconds with the provider's documented video cap."],"tags":["validation","video","duration","constraints","ffmpeg"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}