pbs / pycaption

Python module to read/write popular video caption formats
Apache License 2.0
255 stars 137 forks source link

Support `vw` and `vh` units in subtitles #234

Open ghost opened 3 years ago

ghost commented 3 years ago

I have a TTML/DFXP subtitle file that pycaption can't parse due to vw and vh units:

CaptionReadSyntaxError: CaptionReadSyntaxError((ValueError('The specified value is not valid because its unit is not recognized: 80vw. The only supported units are: PIXEL, EM, PERCENT, CELL, PT'),))

It would be nice to have support for those units. I have attached an example file.

example.zip

ianShifrin commented 9 months ago

I don't believe that vw and vh are in the original TTML spec. I do think a similar concept was adopted in TTML2, but using the unit names rw, rh as they are relative to the root container region and not the viewport. You can see the discussion here, https://github.com/w3c/ttml2/issues/181

All this said, given our resource availability and workload, unfortunately we will not be able to tackle this request at this moment. We hope to come back to this at a later time if and when resources permit us to.

Thanks.