asticode / go-astisub

Manipulate subtitles in GO (.srt, .ssa/.ass, .stl, .ttml, .vtt (webvtt), teletext, etc.)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SRT with position properties

oreo0725 opened this issue · comments

commented

Hi,

I have a .SRT file with position properties, like following:

1
00:00:12,000 --> 00:00:15,123
This is the first subtitle

2
00:00:16,000 --> 00:00:18,000
Another subtitle demonstrating tags:
<b>bold</b>, <i>italic</i>, <u>underlined</u>
<font color="#ff0000">red text</font>

3
00:00:20,000 --> 00:00:22,000  X1:40 X2:600 Y1:20 Y2:50
Another subtitle demonstrating position.

Got this error when trying to open the file

astisub: line 15: parsing srt duration 00:00:22,000  X1:40 X2:600 Y1:20 Y2:50 failed: astisub: Invalid number of millisecond digits detected in 00:00:22,000  X1:40 X2:600 Y1:20 Y2:50

It seems that astisub not recognize such position property.
Is it possible to be supportable?

referenece:

I've added limited support for this feature :

  • the lib will not fail on these kind of lines anymore
  • but the position won't be parsed since I haven't found an official documentation regarding this anywhere
commented

Yes,

This seems not belong to the official SPEC and some players support such position function but some doesn't.

In my case, I use astisub to validate subtitle content correctness rather than getting the parsed properties.
So this fix in v.0.10.0 is enough for me.

Thanks for quickly support.