arcusmaximus / YTSubConverter

A tool for creating styled YouTube subtitles
MIT License
767 stars 55 forks source link

Timing mismatch between .ass and .ytt #61

Closed MikamiShuji closed 2 years ago

MikamiShuji commented 2 years ago

I've been noticing a lot of mismatches between the timings given in .ass Event dialogues and those that end up in the XML tags of the converted file. Example:

Aegisub
Dialogue: 0,0:00:03.10,0:00:09.56,Default,,0,0,0,,{\an5\pos(960,700)\fs120\fsp25}Text 1
Dialogue: 0,0:00:09.63,0:00:12.43,Default,,0,0,0,,{\an5\pos(960,920)\fs70}Text 2
---------------------
Youtube Timed Text
<p t="3087" d="6473" p="1" wp="1" ws="1">Text 1</p>
<p t="9626" d="2803" p="2" wp="2" ws="1">​Text 2</p>

There doesn't seem to be a consistent offset for this issue, but it more often than not tends to mess up the displaying of subs by a couple frames, which does not look good in cases where it's necessary to change between different lines in quick succession or where one line immediately follows another.

Is there any way to resolve this issue and somehow force a stricter timing during conversion?

arcusmaximus commented 2 years ago

The converter indeed adjusts the timings somewhat to close gaps and align between static and animated subtitles. The resulting differences are tiny, however (13ms and 4ms respectively in the given example) - smaller than the differences you get from the inherent timing imprecision in browser-based subtitles. It's not just about differences across machines and browsers - even playing the same video with the same subtitles in the same browser can give new timing deviations each time.

In short, creating frame-perfect YouTube subtitles is sadly not possible in my experience. As such, I won't be changing the converter's timing code.