Repository navigation
feat(text): timed text, caption box and SRT/WebVTT caption import - #1854
Merged
Merged
Conversation
Text overlays get optional start and end times (in source seconds), drawn with drawtext's enable expression mapped through the trim and speed, and left out when outside the kept part. Import captions turns each cue of an .srt or .vtt file into a timed caption; an edit holds up to 500 text items. The preview now places and sizes text within the output frame, centred on its position as the export draws it, and hides text outside its time.
✅ Deploy Preview for reframe-os ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
# Conflicts: # docs/DATADOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 5, item 5: text overlays and captions. Position, size, colour and the bundled font were already in place, so this adds the missing timing plus caption support.
What changes
box=1:boxcolor=black@0.55).MAX_TEXT_OVERLAYSgoes from 50 to 500, so an edit can hold a whole caption file. A longer file adds its first 500 cues and says so.Export (FFmpeg)
enable='between(t,a,b)', orgte/ltfor a one-sided range.setpts, so source times are mapped to(time - trimStart) / speed.x=X-text_w/2:y=Y-text_h/2), matching the preview, which already centred it. Before this, the export drew it from the top-left corner.Preview
requestAnimationFrameand re-renders only when the set of visible items changes.Project files and telemetry
start,endandboxare validated and round-trip.feature_usedadditions:text_tool(import_captions, set_timing, caption_box) andtimed_text(exported). No caption text is ever sent. Documented indocs/DATADOG.md.Memory
The cost is low: overlays are part of the same filter pass with no extra decoding. Inactive drawtext filters are skipped per frame through timeline support.
Tests
test/e2e/captions.spec.ts: imports an SRT and checks that the preview shows each cue only during its time and that an end before the start is refused. It then exports and compares pixels with a plain export: caption drawn at 0.5 s, nothing between cues at 1.8 s, the second caption at 2.5 s. Passes on both the multi-threaded and single-threaded projects locally.Docs
New "Text and captions" section in
docs/USAGE.md.