Subtitle Burn-in Execution Discipline
Applicable Scenarios and Default Policy
- Master without subtitles + given SRT: Save a hard-subtitle copy, or export sidecar files and switchable soft subtitles.
- Titles, bullet comments, stickers, karaoke, and bilingual tracks: Execute according to the declared text, style, and timeline.
- Successfully rendered shots proceed directly to post-production; do not reject due to picture quality, sound, characters, nominal duration, or lip-sync quality, and do not perform automatic ASR/TTS.
Original video is read-only. The existing workstation rule for removing punctuation from Chinese subtitles is still applied during parseSrt inbound processing; keep periods, colons, hyphens, slashes, and pure Latin punctuation marks within numbers. This is a consistent text formatting operation and must not be used to truncate body text or delete valid entries.
1. SRT → ASS Parameter Table
| Item | Actual Value | Basis for Operation |
|---|---|---|
| Time precision | ASS uses H:MM:SS.cc | Fixed conversion by workstation conversion function; re-read source cue start/end |
| Multi-line text | Same cue line break written as \N | Preserve semantic content and line structure |
| PlayResX / PlayResY | Actual output width/height | Font size and canvas use the same coordinate system |
| ScaledBorderAndShadow | yes | Border scales with canvas |
| Styles | Title, Sub, and each extended track style | Independent layers, events can be read back |
| Font identification | Font ID and real font name | fontselect and receipt can be reconciled |
Missing timeline, end time before start time, illegal coordinates, or missing essential text are actual request errors that must explicitly fail; do not silently skip entries to claim "success."
2. Font Execution Discipline
- From account-locked fonts or recipes, select actual font files with a valid license; record the ID, license, and SHA-256.
- Prepare multi-layer font directories (cn/en, etc.) as a
fontsdirthatlibasscan actually read; do not treat a directory name as evidence that the font is loaded. - Parse the render log for
fontselect; silent fallback to system fonts or missing glyphs must be explicitly reported and the request stopped. - Missing fonts must not be processed as "best-effort output"; correct the missing fonts first, then execute. Preserve the original video and any historical outputs.
3. Executable Entry Points
Execute from the repository root; paths, font licenses, and output directories must be authorized for this task first.
node bundles/ai-video/connectors/subtitle-bridge/cli.mjs plan --in master.mp4 --srt subtitles.srt --out-dir subtitle-plan
node bundles/ai-video/connectors/subtitle-bridge/cli.mjs burn --in master.mp4 --out subtitled.mp4 --srt subtitles.srt --platform TikTok/Kuaishou
node bundles/ai-video/connectors/subtitle-bridge/cli.mjs sidecar --in master.mp4 --out-dir sidecars --srt subtitles.srt --name film
node bundles/ai-video/connectors/subtitle-bridge/cli.mjs softmux --in master.mp4 --out softsub.mp4 --srt subtitles.srt --lang chi
The actual FFmpeg parameters for burning are generated by the kernel; audio is copied. If the original has no audio track, it remains without audio. softmux performs SHA-256 reconciliation on the complete encoded package, not by relying on a few frame screenshots as proof of copy.
4. Processing Verification and Honest Reporting
| Item | Technical Verification | Quality Judgment NOT Performed |
|---|---|---|
| Timeline | Number of ASS events, start/end reconciled with declared cues | Do not guess "whether the audience can finish reading" |
| Font | Actual fontselect hits workstation files | Do not rate whether the font is beautiful |
| Canvas | Actual output width/height matches request | Do not reject footage based on source resolution |
| Audio track | Input track present/absent matches output | Do not test intelligibility, voice activity, or LUFS for approval |
| File | File exists, non-empty, SHA-256 matches receipt | Do not test frame difference or visibility |
| Quality fields | qualityReviewed=false, qualityScore=null | presence.reviewed=false, delta/ok set to null |
Real tool errors (non-zero exit), missing files, missing fonts, or unexecuted requested tracks must propagate errors; do not write "not tested" as quality passed.
5. Extended Track Workflows
| Track | Design Reference / Parameters | Execution Boundaries |
|---|---|---|
| Bullet comments | Top 1/4 with separate lanes, default opacity 0.85 | Preserve all incoming text and all entries by default; only constrain if max_chars / max_concurrent is explicitly specified, and record the number of entries culled |
| Stickers | Five built-in presets, 200ms fade-in | Use explicit time windows, positions, and real ASS events; stop on illegal requests |
| Karaoke | \kf sweep, optional highlight color | Explicit word-by-word timing preferred; evenly-timed karaoke must be labeled "not real pronunciation alignment," cannot be passed off as ASR alignment |
| Bilingual | Primary and secondary languages each have their own cue; secondary line can be 12% smaller | Read back each language's timeline separately; original text is not automatically truncated due to length |
| Title | Independent Title style and declared time window | Title length is a request parameter; do not automatically rewrite based on source video quality |
| Soft subtitles | mov_text track, language and default track flags | Video/audio encoded packets remain unchanged; actual subtitle track exists |
Design references must not become quality gates for source footage. Diagnostics, sample frames, or text comparisons are performed as explicitly separate tasks and do not block the default formal post-production.
6. SOP
- Trigger: Receive a text track request. Validate source, SRT, font licenses, and output path. Receipt: Input hash, original cues, and declared parameters. Failure: Stop if items are missing, permissions are invalid, or the timeline is illegal.
- Trigger: Request is executable. First
planto write ASS, then execute oneburn,softmux, or extended track operation. Receipt: ASS, actual filters,fontselect, tool exit code. Failure: On tool error, do not change fonts, alter content, or retry in a loop to mask the error. - Trigger: Output is written to disk. Re-read real files, tracks, events, canvas, and hash. Receipt: Subtitle report, source video preserved,
qualityReviewed=false. Failure: If output is missing or the request is incomplete, stop delivery; preserve the original video and the real error log.
7. Failure Diagnosis (Cause → Disposition)
| Symptom | First Check / Cause | Disposition |
|---|---|---|
| Actual render reports path error | ASS path contains colon, space, or escape issue | Fix parameters and re-execute; do not bypass error and claim burning completed |
| Font fallback or missing glyphs | Font does not exist, license not declared, character coverage insufficient | Specify font and characters, add valid files; do not silently drop glyphs |
| Events do not match source cues | Time conversion or line break encoding error | Fix ASS conversion, preserve original text and entries |
| Bullet comment count reduced | Explicit cull constraint or old default threshold | Keep all by default; when limited, record the request and each entry processed |
| Encoder failure | ffmpeg non-zero exit, encoder not installed | Preserve stderr, stop; do not retry with different encoders indefinitely |
| Original video overwritten or altered | Input and output paths are the same, hash mismatch | Reject and stop; recovery can only be done from a versioned source copy |
8. Evidence Standards
- Each output records path, byte count, SHA-256, ASS, and font parse logs; the workstation receipt must be bound to the current file.
- Each source reuse retains the original SHA-256 and lineage; old quality refusal records are not overwritten.
- Sidecar, soft subtitle, and hard-subtitle copies all come from explicit cues; one missing requested output cannot use remaining files to claim completeness.
- Fields for unsampled visibility, contrast, and audio quality remain
null; do not fabricate "all six quality checks passed."