-
Notifications
You must be signed in to change notification settings - Fork 505
[FEATURE] Add guarded ASS/SSA \pos positioning for CEA-608 captions #1885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[FEATURE] Add guarded ASS/SSA \pos positioning for CEA-608 captions #1885
Conversation
cfsmp3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Summary
Thanks for this feature! The implementation is well-designed with good safeguards. Testing confirms it works correctly.
✅ What's Good
- Conservative guard: only applies positioning for 1-2 row captions
- Falls back gracefully to legacy behavior for complex layouts (>2 rows)
- Uses standard SSA resolution (384×288) with explicit header declaration
- Positioning math is correct: Row 0 → y=172 (60%), Row 14 → y=273 (95%)
- Doesn't affect SRT or other output formats
- All CI checks pass, all 248 Rust tests pass
Testing Results
Tested with sample 56c9f345... from Sample Platform:
- 118 dialogues correctly received
{\an2\pos(x,y)}tags - 1 dialogue with >2 rows correctly fell back to legacy behavior
- Compared with master: changes are purely additive
📋 One Minor Fix Needed
CHANGES.TXT entry is truncated:
- New: Added ASS/SSA \pos-based positioning for CEA-608 captions when layout
Please complete the sentence, e.g.:
- New: Added ASS/SSA \pos-based positioning for CEA-608 captions when layout is simple (1-2 rows) (#1726)
Once fixed, this is ready to merge! 🎉
|
Note: The approval above is conditional on the Sample Platform CI tests passing. The tests were still queued at the time of review:
Please wait for these to complete before merging. If any tests fail, the issues should be addressed first. |
|
Thanks for the review. I’ve fixed the truncated changelog entry and updated the loops to use scoped variables, and pushed the updated commit. |
CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit d573548...:
Congratulations: Merging this PR would fix the following tests:
All tests passing on the master branch were passed completely. Check the result page for more info. |
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
[FEATURE] - Add ASS/SSA \pos positioning for CEA-608 captions (feature request #1726)
Summary
Implements precise positioning for ASS/SSA subtitle export using
\pos(x,y)tags, replacing whitespace-based layout where sufficient positioning information is available.Fixes #1726
Changes
ass_position_from_row()function to map CEA-608 rows to ASS coordinates{\an2\pos(x,y)}positioning tags for single-region captions (1-2 rows)Design Decisions
Positioning is intentionally conservative:
avoid unsafe display areas
Resolution choice:
This improves visual consistency without changing caption semantics or risking regressions on complex roll-up layouts.
Testing
Future Enhancements
Fuller grid-based positioning and horizontal placement derived from CEA-608 semantics; however, this involves additional
interpretation of PAC data and roll-up behavior and is intentionally out of scope for this change.