Ajatt-Tools / mpvacious

🍜 Adds mpv keybindings to create Anki cards from movies and TV shows.
https://tatsumoto-ren.github.io/blog/mining-from-movies-and-tv-shows.html
GNU General Public License v3.0
592 stars 51 forks source link

Audio padding issue #83

Open Geniusssmit opened 1 year ago

Geniusssmit commented 1 year ago

Environment

1) OS name [e.g. Parabola, Debian] win 10 2) OS version 1809 3) mpv version 0.35 4) Logs 5) Screenshots, if applicable image image

Describe the bug A description of what the bug is. audio_padding only works when timings for multiple lines are set by pressing "c", and not for shift+s, shift+e

Expected behavior A description of what you expected to happen. audio padding should work

Geniusssmit commented 1 year ago

Motokare no Yuigonjou 2022 S01 1080p WEB-DL AAC H.264-MagicStar.zip comparison, padding set to 1.0 (1 second)

Geniusssmit commented 1 year ago

difference is exactly 2 seconds

tatsumoto-ren commented 1 year ago

Padding is only applied when timings are chosen automatically. When you set them manually, no padding is applied.

Geniusssmit commented 1 year ago

c - Interactive subtitle selection. is automatic?

tatsumoto-ren commented 1 year ago

If you want to create a card with padding, you shouldn't use shift+s and shift+e and instead use only c and shift+l,shift+h

Geniusssmit commented 1 year ago

I see, difference is not obvious tbh, but ok, also do you know why it cuts audio, even if subtitle is still shown. I ended up with 1.0 padding, but thats quite big

tatsumoto-ren commented 1 year ago

When you override timings set in the subtitles, mpvacious assumes that your subs are incorrectly timed, and disables the padding since applying it would mean potentially grabbing extra parts of the dialogue that you don't want on your card.

tatsumoto-ren commented 1 year ago

I ended up with 1.0 padding

Could be your subtitle's timings, or the amount of padding you set in subs2srs.conf.

Geniusssmit commented 1 year ago

When you override timings set in the subtitles, mpvacious assumes that your subs are incorrectly timed, and disables the padding since applying it would mean potentially grabbing extra parts of the dialogue that you don't want on your card.

I understand that. I mean I check, timings are perfect, even without overriding mpvacious cuts before subtitle disappears.

Geniusssmit commented 1 year ago

that's why I'm using 1.0 padding to compensate it

Geniusssmit commented 1 year ago

but yeah, anyway "c" key works just fine.

Geniusssmit commented 1 year ago

Bandicam 2022-11-14 19-57-05-276-1.zip Please watch, it cuts 4 seconds earlier, even with "c"

tatsumoto-ren commented 1 year ago

that's why I'm using 1.0 padding to compensate it

You're better off fixing the timings then.

Please watch, it cuts 4 seconds earlier, even with "c"

On the video you still set the timing manually.

Geniusssmit commented 1 year ago

that's why I'm using 1.0 padding to compensate it

You're better off fixing the timings then.

Please watch, it cuts 4 seconds earlier, even with "c"

On the video you still set the timing manually.

I mean, as you can see, automatically it sets end timing to 07m30s200ms, but when I fix it manually, I set it when the line ends, it ends around 07m34s186ms

Geniusssmit commented 1 year ago

image I think there is something wrong with the subtitle file, do you know how to deal with cases like this? 2 exact same lines with different timings [MagicStar] Motokare no Yuigonjou EP04 [WEBDL] [1080p].zip

tatsumoto-ren commented 1 year ago

This could help. You can also open the file in vim and remove the redundant lines.

tomtung commented 1 year ago

I also found this behavior really confusing: padding is only respected for single-line selection, but somehow not for multiple-line selection. I needed to spend some time debugging to figure out what was going on.

When you override timings set in the subtitles, mpvacious assumes that your subs are incorrectly timed, and disables the padding

I think this behavior is only expected when the user directly sets the timestamps without referencing the exact timing of the current subs. I only use shift+s and shift+e when the subs are already correctly timed, and I need to select a range of them. In this case, this behavior is definitely a surprise for me.

If you want to create a card with padding, you shouldn't use shift+s and shift+e and instead use only c and shift+l,shift+h

This is probably the best option. I didn't try it before because it seemed less intuitive than shift+s and shift+e.

Alternatively, just locally comment out these lines. https://github.com/Ajatt-Tools/mpvacious/blob/178674f605ad9a91b9925de5abb81880d8c70526/subs2srs.lua#L331-L333