ass_fix_timing
Extend subtitle end times to meet minimum duration or maximum CPS, optionally avoiding overlaps, and preview changes with dry_run before applying.
Instructions
Compute timing fixes and apply them only when dry_run is False.
Only end times move. A line shorter than min_duration_ms is extended to
it; a line reading faster than max_cps/target_cps is extended so that
its characters per second fall back to that figure. With avoid_overlap
an extension stops at the next line's start on the same layer, minus
keep_gaps_ms; when there is no room the fix is reported as blocked
instead of being applied.
Args:
selection: lines to fix.
doc_id: document id.
dry_run: True (default) returns the plan and writes nothing.
min_duration_ms: shortest acceptable duration.
target_cps: extend faster lines until they read at this rate.
max_cps: same, used when target_cps is not given.
avoid_overlap: stop extensions at the neighbouring line.
keep_gaps_ms: keep this much room before the neighbouring line.
Returns:
{"doc_id", "dry_run", "applied", "parameters": {...}, "count", "changes": [{"index", "field", "old_ms", "new_ms", "old", "new", "reason"}], "blocked": [{"index", "reason", "wanted_ms", "limit_ms"}]}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | No | ||
| dry_run | No | ||
| max_cps | No | ||
| selection | No | ||
| target_cps | No | ||
| keep_gaps_ms | No | ||
| avoid_overlap | No | ||
| min_duration_ms | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||