Support per-chunk timeline durations
This commit is contained in:
+4
-1
@@ -81,7 +81,10 @@ def validate_assembly_plan_contract(plan: Mapping[str, Any]) -> None:
|
||||
raise ValueError("assembly_plan.chunk_seconds must be finite and positive")
|
||||
|
||||
target_frames = _strict_int("assembly_plan.target_frames", plan.get("target_frames"), 1)
|
||||
expected_target = int(round(len(chunks) * chunk_seconds * fps))
|
||||
durations = plan.get("chunk_durations") or [chunk_seconds] * len(chunks)
|
||||
if not isinstance(durations, list) or len(durations) != len(chunks):
|
||||
raise ValueError("assembly_plan.chunk_durations does not match chunks")
|
||||
expected_target = int(round(sum(float(value) for value in durations) * fps))
|
||||
if target_frames != expected_target:
|
||||
raise ValueError(
|
||||
"assembly_plan.target_frames does not match chunks * chunk_seconds * fps"
|
||||
|
||||
Reference in New Issue
Block a user