-
Notifications
You must be signed in to change notification settings - Fork 512
[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. |
34cd891 to
9ad9155
Compare
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.
The implementation looks good! The positioning is working correctly and the guard for 1-2 row captions is a sensible approach to avoid regressions.
The Windows CI failure is expected since the ASS output format changed - we'll need to update the test baselines.
One small fix needed: the CHANGES.TXT entry appears incomplete:
- New: Added ASS/SSA \pos-based positioning for CEA-608 captions when layout
Please complete this sentence (e.g., "...when layout information is available" or similar).
Once that's fixed, we can merge and update the test baselines.
50a8540 to
5dd1961
Compare
|
@cfsmp3, I've completed the |
CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit 9a76133...:
Congratulations: Merging this PR would fix the following tests:
All tests passed completely. Check the result page for more info. |
CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results, when compared to test for commit 9a76133...:
Your PR breaks these cases:
It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you). 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.