emk/subtitles-rs

Reduce padding on subtitle times

NinKenDo64 opened this issue · 4 comments

Great tool, thank you for your efforts.

I do wish for one feature especially though, it's almost a deal-breaker, and that's the ability to adjust the padding of subtitle times through an argument when generating Anki cards through substudy.

It seems to me, and correct me if I'm wrong, but it certainly seems that the times are being automatically padded by substudy, meaning there is extra time added on both the start and the end.

This might be a sensible default, as it's presumably better to have a little too much of what's said, than too little, but I have some pretty nicely timed subtitles, and it would be great to be able to prevent this padding from taking place, even if it's not the default.

I've tried looking through the source, but tbh, I'm not a great programmer, I'm actually integrating substudy into some scripts, but I've been looking at a lot of python and POSIX sh for the last few years, not so much C-like languages, and I'm totally unfamiliar with Rust. It seems a lot isn't commented, so I find my eyes glazing over and my brain shutting down when I tried to figure stuff out in the source myself.

Even if this isn't what's happening, perhaps a command line argument to reduce or increase padding would be good.

I'd try to implement it myself as I'm sure it's rather simple, but for the reasons I stated earlier, I'm pretty much at the mercy of your (or some other kind soul's) benevolence.

I eventually modified the source where I thought the timing might be getting added, but the program won't compile on my machine, so I've given up. A real shame.

emk commented

I'm sorry that the defaults don't work for you!

I've made and reviewed tons of cards (probably 10,000+ reps), from tons of different subtitle sources. Sometimes those subtitles exactly matched the audio timing, and sometimes they were approximate.

The problems with making the padding any smaller are:

  1. You'll wind up with far more "useless" cards where critical audio gets clipped.
  2. Even if your subtitle timing is exact, which almost never happens, the padding provides a small amount of helpful context.

My apologies if you've tried reviewing cards and the padding still doesn't work for you. I prefer not to have lots of extra command-line options, particularly ones which I think will cause large groups of users to generate bad substudy decks by mistake. My apologies if the defaults don't work for you.

No worries. Any chance you could point out to me the lines where padding is added, so that I can patch it for my own use?

emk commented

Try here:

conv.period = conv.period.grow(2.5, 2.5);

Good luck!