arcusmaximus / YTSubConverter

A tool for creating styled YouTube subtitles
MIT License
800 stars 54 forks source link

Can --visual can configured to avoid using \pos? #39

Closed qgustavor closed 3 years ago

qgustavor commented 3 years ago

I'm getting old and my eyesight isn't that great anymore, so I use a player that allows changing subtitle sizes on .ass files as long it might not break subtitles. The way it uses to detect lines that might break is not scaling those with \pos.

Currently converting subtitles using --visual generates subtitles with \pos in all lines, disabling subtitle scaling. I tried fixing this by writing this script that removes \pos tags when x=640 and, because just removing those would make the renderer place lines in a way those would not overlap, it also handles layers.

I tested this script with some subtitles and, as it worked fine with those, I ask if there are possible caveats to this idea and if something like what this script does can be integrated to this repository. I hope it will help people that uses players with a similar feature.

arcusmaximus commented 3 years ago

Some videos have dialogue subtitles that hover on some nonstandard position (the most well-known example likely being the Hologra anime series of the Hololive group). Chances are you want to scale those too, despite them requiring \pos tags. Because of this, it might be better to already do the scaling during conversion, not afterwards in the player.

One possibility would be a --scale=150 option for making everything 50% larger, but that would make subtitles that are already big even bigger, which is not just unnecessary but might also break their visual layout. So instead, I could add something like a --minfontsize=50 option, which would change all font sizes lower than 50 to 50, and leave all other font sizes unchanged.

Let me know what you think.

qgustavor commented 3 years ago

I'm using YTSubConverter because I'm watching Hologra. I'm using the script from the gist which works fine with the player: most of the text are conventional text positioned in the middle of the image and other texts are not scaled, but those are rare, so I can just pause the video to read those if needed. I prefer scaling during watching as the scale I use may vary on my needs. An example: this is the normal scale, this is the scale I often use and this is the scale I watch when my vision is blurry and I should rest but I want to watch just more one episode or when I'm in a vehicle.

Well, implementing a whole new feature based on my experience isn't good, so I hope more people can comment on this and share if a scale feature would be better. Considering I just know two players that have a scale feature (and one of them makes this feature hidden as it's not well implemented) I think it may be a good feature. From my experience, as you can see above, my script is working well, surely that not scaling text positioned in a nonstandard way is not great, but it helps compatibility.

Sometimes, in other anime, this scaling feature causes issues like text disappearing (because the font size was too big it ended moving the text outside the image) so I need to pause the video, revert the scale back to 100% in order to read the text, That's why I made this script to not scale non-centered text, it trades legibility for compatibility in the complex cases to avoid this issue.

arcusmaximus commented 3 years ago

You made some good points. As such, I changed the converter as requested: files produced with --visual will now only have \pos tags where necessary. I'll post again once I publish a new release containing this change.