{"record":{"id":"6d9bfdb53026524e","repo":"calesthio/OpenMontage","slug":"all-local-reference-audio-clips-together-must-be-a","errorCode":null,"errorMessage":"all local reference audio clips together must be at most {max_reference_seconds} seconds","messagePattern":"all local reference audio clips together must be at most (.+?) seconds","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/video/seedance_ark.py","lineNumber":852,"sourceCode":"                    sum(float(value) for value in audio_durations)\n                    > max_reference_seconds\n                ):\n                    raise ValueError(\n                        \"all reference audio clips together must be at most \"\n                        f\"{max_reference_seconds} seconds\"\n                    )\n            local_audio_durations = [\n                duration\n                for ref in audio_refs\n                if (\n                    duration := self._local_or_data_audio_duration(\n                        str(ref), max_seconds=max_reference_seconds\n                    )\n                )\n                is not None\n            ]\n            if sum(local_audio_durations) > max_reference_seconds:\n                raise ValueError(\n                    \"all local reference audio clips together must be at \"\n                    f\"most {max_reference_seconds} seconds\"\n                )\n            if audio_refs and not (image_refs or video_refs):\n                raise ValueError(\n                    \"reference audio requires at least one reference image or video\"\n                )\n            if not (image_refs or video_refs):\n                raise ValueError(\n                    \"reference_to_video requires at least one image or video\"\n                )\n\n            content.extend(\n                self._image_content(ref, role=\"reference_image\") for ref in image_refs\n            )\n            content.extend(\n                {\n                    \"type\": \"video_url\",","sourceCodeStart":834,"sourceCodeEnd":870,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/seedance_ark.py#L834-L870","documentation":"Raised when the actual decoded durations of local/file or data-URI audio refs (measured via _local_or_data_audio_duration) sum above the model's total budget (15s standard, 30s on 2.5). Unlike the durations-hint checks, this inspects the real files, so it fires even without reference_audio_durations.","triggerScenarios":"Passing local paths or data: URIs in reference_audio_paths/url whose probed lengths total more than 15 (or 30) seconds.","commonSituations":"Believing that omitting reference_audio_durations bypasses duration limits; long local music files referenced for mood; the hint list passing while the real files exceed the cap.","solutions":["Trim local audio files (e.g. with ffmpeg -t) so total referenced audio is within 15s (30s on 2.5)","Reduce the number of local clips referenced","Use model_variant='2.5' when longer combined audio is required"],"exampleFix":"# before: two 10s local clips, standard variant\ninputs = {\"reference_audio_paths\": [\"a.wav\", \"b.wav\"]}\n\n# after\nsubprocess.run([\"ffmpeg\", \"-y\", \"-i\", \"a.wav\", \"-t\", \"7\", \"a7.wav\"])\nsubprocess.run([\"ffmpeg\", \"-y\", \"-i\", \"b.wav\", \"-t\", \"8\", \"b8.wav\"])\ninputs = {\"reference_audio_paths\": [\"a7.wav\", \"b8.wav\"]}","handlingStrategy":"validation","validationCode":"import subprocess\n\ndef probe_seconds(path: str) -> float:\n    out = subprocess.run([\"ffprobe\", \"-v\", \"error\", \"-show_entries\",\n                          \"format=duration\", \"-of\", \"csv=p=0\", path],\n                         capture_output=True, text=True, check=True).stdout.strip()\n    return float(out)\n\nmax_s = 30 if str(inputs.get(\"model_variant\", \"standard\")).lower() == \"2.5\" else 15\nlocal = [r for r in audio_refs if not str(r).startswith((\"http://\", \"https://\"))]\nassert sum(probe_seconds(r) for r in local) <= max_s","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pre-trim local audio with ffmpeg -t so total referenced audio fits the budget","Do not assume omitting duration hints skips validation; real files are probed"],"tags":["validation","seedance","ark","audio","durations","ffmpeg","limits"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}