Skip to content
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

WebVTT line parameter not being parsed correctly to ASS/SSA #42

Open
felri opened this issue Apr 7, 2024 · 0 comments
Open

WebVTT line parameter not being parsed correctly to ASS/SSA #42

felri opened this issue Apr 7, 2024 · 0 comments

Comments

@felri
Copy link

felri commented Apr 7, 2024

Hello again, I found a problem related to the line:50% paramenter in VTT files and converting it to ASS/SSA files.

The fixable problem is that you are not setting the vmargin of the line in to_ass(), the way I'm fixing this is:

+let vmargin = i.position.map_or(0.0, |p| p.line as f32);
let mut line = SSAEvent {
    line_end: i.line_end,
    line_start: i.line_start,
    line_text: i.line_text.clone(),
+   vmargin,
    ..Default::default()
};

The unfixable problem is that VTT uses lines or percentage to define the the vertical position of the subtitle, ASS/SSA uses pixels, so if I send

line:50%or line:50

from VTT, ASS recognizes as 50 pixels, the only way I can fix this is to get the video height and change the values from percentage to pixels before sending it to the rsubs-lib, not related to your lib tho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant