Skip to content

Join-concatenate should maintain timestamps of joined parts #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
JeromeNelsonC opened this issue Jun 9, 2023 · 15 comments
Open

Join-concatenate should maintain timestamps of joined parts #55

JeromeNelsonC opened this issue Jun 9, 2023 · 15 comments

Comments

@JeromeNelsonC
Copy link

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

JeromeNelsonC commented Jun 9, 2023 via email

@JeromeNelsonC
Copy link
Author

JeromeNelsonC commented Jun 10, 2023

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
Copy link
Author

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

@arch1t3cht
Copy link
Owner

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
Copy link
Author

JeromeNelsonC commented Jun 10, 2023 via email

@arch1t3cht
Copy link
Owner

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

@JeromeNelsonC
Copy link
Author

JeromeNelsonC commented Jun 10, 2023

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

@arch1t3cht
Copy link
Owner

I don't know, what are you doing?

@JeromeNelsonC
Copy link
Author

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
Copy link
Author

I guess its hard to change that, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants