arch1t3cht / Aegisub

Cross-platform advanced subtitle editor, with new feature branches. Read the README on the feature branch.
http://www.aegisub.org
Other
738 stars 32 forks source link

Join-concatenate should maintain timestamps of joined parts #55

Open JeromeNelsonC opened 1 year ago

JeromeNelsonC commented 1 year ago

Excellent work here, but I wonder if it is too difficult to proportion this detail. I generate word level timestamps using Whisper_timestamped (https://github.com/linto-ai/whisper-timestamped) but I want to make karaoke style captions, so when I put it into aegisub, i can join many words to make it karaoke. But When I use join concatenate, it doesnt maintain my already accurate timestamps, and I have to re-align each word again, which is a lot of work. So do you have anyway to maintain the timestamps of the different parts of the concatenate, instead of just taking the beginning timestamp of the first part and the ending of the last part?

arch1t3cht commented 1 year ago

Can you be more precise in what exactly you want to achieve? What would be an example input, and what output would you expect?

JeromeNelsonC commented 1 year ago

So Ill attach two screenshots to show whats is happening This one shows how it is before I concatenate... notice the timestamps

Screenshot 2023-06-09 at 14 45 02

After I concatenate and commit the spilts in karaoke mode we get this:

Screenshot 2023-06-09 at 14 45 57

notice that the timestamps for each word dont correspond to the ones I had before.

it should be like this (I manually put them somewhat in place):

Screenshot 2023-06-09 at 14 52 52

I hope this helps make it clear.

arch1t3cht commented 1 year ago

Wait, so are you concatenating first and then applying the automatically generated karaoke splits? Maybe you just want to use the Subtitle > Join Lines > As Karaoke command instead? This can also be bound to a keyboard shortcut, the command is called edit/line/join/as_karaoke.

JeromeNelsonC commented 1 year ago

That worked somewhat... but look at the results... IS there a way I can ad a space after each word automatically?

Screenshot 2023-06-09 at 16 28 51
arch1t3cht commented 1 year ago

Sure, there's a lot of ways. The simplest one might be to append a space to every line before joining, by running search&replace (Ctrl+H) to replace $ with (i.e. a space character) with "Use regular expressions" checked. If you need more complex behavior, you might be better off with a simple automation script, or a luainterpret snippet.

JeromeNelsonC commented 1 year ago

Oh wow .. I'll try the search & replace and let you know... Thanks!

On Fri, Jun 9, 2023, 3:22 PM arch1t3cht @.***> wrote:

Wait, so are you concatenating first and then applying the automatically generated karaoke splits? Maybe you just want to use the Subtitle > Join Lines > As Karaoke command instead? This can also be bound to a keyboard shortcut, the command is called edit/line/join/as_karaoke.

— Reply to this email directly, view it on GitHub https://github.com/arch1t3cht/Aegisub/issues/55#issuecomment-1584976332, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZEBLC5A435ARTWS5U2V3JDXKNSV3ANCNFSM6AAAAAAZAVFL5M . You are receiving this because you authored the thread.Message ID: @.***>

JeromeNelsonC commented 1 year ago

Well... I just realized that join/karaoke does about the same this as concatenate... It doesnt preserve the timestamps of each line. Your search replace worked though... Anyway to get those timestamps?

JeromeNelsonC commented 1 year ago

And btw, is there a shortcut to commit splits in the audio pane?

arch1t3cht commented 1 year ago

I'm still not sure what you mean by "preserve the timestamps" here. Doesn't "join as karaoke" set karaoke timing markers that match the timing of the input lines?

And no, there's no shortcut to commit splits. This is likely because it's a button for this specific timing mode and not an action that can be run globally from anywhere. But usually you'd only use that button after manually setting splits. If all you want is to automatically generate splits based on words with timing being guessed based on the length, you could use an automation script.

JeromeNelsonC commented 1 year ago

Exactly. "Join as Karaoke" doesn't use the timestamps from the input lines, it just guesses it's own timestamps based on the word length (I think)

On Sat, Jun 10, 2023, 3:31 PM arch1t3cht @.***> wrote:

I'm still not sure what you mean by "preserve the timestamps" here. Doesn't "join as karaoke" set karaoke timing markers that match the timing of the input lines?

And no, there's no shortcut to commit splits. This is likely because it's a button for this specific timing mode and not an action that can be run globally from anywhere. But usually you'd only use that button after manually setting splits. If all you want is to automatically generate splits based on words with timing being guessed based on the length, you could use an automation script.

— Reply to this email directly, view it on GitHub https://github.com/arch1t3cht/Aegisub/issues/55#issuecomment-1585763046, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZEBLC4TMPX4WLX2OKFS273XKS4OJANCNFSM6AAAAAAZAVFL5M . You are receiving this because you authored the thread.Message ID: @.***>

arch1t3cht commented 1 year ago

No, it doesn't guess. It uses the timestamps of the input lines and outputs \k tags accordingly.

JeromeNelsonC commented 1 year ago

Then what am I doing wrong that its not working? Let me try again.

arch1t3cht commented 1 year ago

I don't know, what are you doing?

JeromeNelsonC commented 1 year ago

I figured out the bug... It only messes up when there is a pause between two lines (a silent time-gap). Because it expects to have one word after the other. Would it be too diffucult to implement a segment with no text when this happens? I only have an elementary undetrsanding of programing, but I assume there will have to be another if loop, to check if the ending timestamp of "first" is the same as the beggining timestamp of the "second" and then if yes, add a segment "space" with the starts with the end of first and ends with the begging of "second"

I hope it makes sense

JeromeNelsonC commented 1 year ago

I guess its hard to change that, right?