Friday, February 3, 2023

It's Broken, Broken, Broken

For some time, I've wondered why anime groups have taken to specifying exactly which video players they support for their releases. Some say "mpv only". Some specify others. I've finally figured out why. When it comes to compatible subtitle rendering, the fansub world is broken, broken, broken.

In the old days, most anime subbers and fans were on Windows, and most everyone used MPC-HC (media player classic home cinema) for playback and xyvsfilter for subtitle rendering. The Aegisub and CCCP projects helped enforce this by providing a uniform tool chain for the Windows world to use. Then, in short order, Aegisub stopped publishing stable releases, CCCP went out of business, and chaos ensued.

The root of the issue, as far as I can tell, is the substitution of  the portable subtitle rendering library libass for the Windows only library xyvsfilter. Using a portable library simplifies the process of producing portable players, like mpv and VLC. libass is pickier about syntax, and mistakes that xyvsfilter will accept (for example, \pos(x,y\fs40) cause libass to produce gibberish. There's no syntax checker for ASS that I know of, so it's all too easy for errors to slip by. But more importantly, libass is simply wrong in places, mostly notably in its handling of line wrapping.

ASS allows for four wrapping styles for multi-line subs, of which the default is 0: smart wrapping, top line longer. All scripts I edit are built that way. So I was baffled why the QCs for Yawara! kept asking for line breaks to be added or moved, until I found a smoking gun. Here is Aegisub's rendering of a scene from episode 72, with xyvsfilter:


And here is the same scene, with libass:

Now, I'm willing to allow some leeway about "smart wrapping", but mode 0 says top line longer. It doesn't say "top line longer unless the difference exceeds 'n' characters." In fact, libass is doing some very stupid wrapping in this case, breaking off the last word of a complete sentence. This isn't implementation leeway on an ambiguous spec. It's a bug, and it should be fixed. If I, as the editor and styling, specify top line longer, then that's what the renderer should so, unless it simply can't work due to hitting the margins.

I'm sure the younger set would tell me to give up on my ancient tool set and move to the "modern" world. However, I'm very set in my ways. I have a set of subtitling tools that work the way I like. If I were using libass, I'd be doing a lot more work to defeat this bug. In fact, I'd have to put explicit line breaks in every damned multi-line sub. Life's too short.

So here's Orphan's policy declaration. Our releases are supported on MPC-HC with xyvsfilter. If you want to use some other combination of playback and rendering, caveat emptor.


5 comments:

  1. This messed up ASS rendering, that's the only argument pro-hardsub I've been able to think of.

    I use the old Aegisub 3.2.2 with libass but the libass itself has changed about three years ago on how it renders some fonts, specially Italic and Bold effects. The result is chaos, and I have use all tricks I know, like layers, manual wrapping, or rendering the fonts myself and attaching them to the files. What I see inside Aegisub is always a little different from what I see when doing the QC with mpv. And I'm not even talking about other libraries.

    ReplyDelete
  2. I personally find the break long lines sorting option in Subtitle Edit to be so useful for this issue. I've worked with sub files with an excess of 500 lines and it only takes me like 2 minutes to add explicit line breaks to all the necessary lines (which can be measured to your own profile config/character amount). Such a shame Aegisub is so limiting in this regard and since it's no longer being updated, it'll remain limiting.

    ReplyDelete
  3. It's been a long time since I worked on SSATool, but I did make a basic syntax checker for it years ago. I don't remember all the problems it looks for, but I'd be willing to expand the functionality if it would be helpful. Reach out to me on the fansubber Discord if so?

    -korgied / RaistlinMajere

    ReplyDelete
  4. Aegisub looks great no wonder

    ReplyDelete