Closed darrellenns closed 2 years ago
Hi, on pycaption 2.0.2 we released the implementation for SCC tab offsets and enforced caption safe area limits which visibly improved positioning. We will also remove the "start" positioning alignment on the next release (2.0.3) and here's how it will look:
WEBVTT
00:01.034 --> 00:01.935 align:left position:40% line:89% size:50%
CENTERED
00:02.035 --> 00:02.936 align:left position:10% line:89% size:80%
LEFT ALIGNED
00:03.036 --> 00:07.036 align:left position:57.5% line:89% size:32.5%
RIGHT ALIGNED
Horizontally they seem closer now, the only difference being that positioning percentages in pycaption relate to the left side of the caption, while your example places the middle at that percentage. Another problem I noticed is the viewer you're using, it seems to enforce a right padding that is not there, I suggest testing the files on another player. I attached a few examples on how the pycaption result looks like on video.js.
There appear to be multiple issues with positing, both in the SCC reader and the VTT writer.
Take the following test case:
The first caption should be centered, the second should be left aligned with the title safe frame, and the third should be right aligned with the title safe frame.
The resulting WebVTT (using WebVTTWriter(relativize=True,video_width=1920,video_height=1080)) is as follows:
This can be viewed using https://zcorpan.github.io/live-webvtt-viewer/.
The result is that all captions are left aligned. This seems to be because the "position" attribute is invalid. It should not include ",start" - just a percentage value. I'm guessing this is a bug in the VTT writer? I have also tried manually removing the ",start" as follows:
In this case, the centered line appears correct, the left aligned line is all the way to the edge of the frame (instead of within the title safe region), and the right aligned text is about 2/3 of the way to the right.
The same SCC source converted using Telestream CaptionMaker results in the following VTT, which renders correctly: