sachac / subed

subed is a subtitle editor for Emacs
177 stars 16 forks source link

How to insert a new subtitle that begin at the actual timestamp of mpv? #26

Open jpggithub opened 3 years ago

jpggithub commented 3 years ago

I don't know if I understand badly how to use subed or if it is a missing feature.

For example, I open a .srt file and load the video. There are some subtitles for the first minute of the video.

I press M-SPC to play the video for 2 minutes.

Then I pause the video and I want to insert a subtitle that starts at 2 minutes (the actual timestamp of mpv).

Is it possible to do this?

Each time I use M-i, subed add a new subtitle that starts at the end of the last subtitle (plus a given length) and backward the video accordingly.

rndusr commented 3 years ago

Looks like that's a missing feature.

You can copy the start and stop time from mpv to the current subtitle with C-c [ and C-c ], so M-i C-c [ should do what you want. But having a dedicated keybinding for this would be nice.

jpggithub commented 3 years ago

Yes, it would be nice. With the actual features, the video go backward when you insert a new subtitle :-( So, in my example, you have to play the video again to reach the 2 minutes timestamp befor to do C-c [.

EDIT: perhaps something to do with #1 (see section "3. Insert subtitle with player's timestamp")

rndusr commented 3 years ago

M-i inserts the subtitle between the current and the next subtitle.

subed tries to be smart and seeks the mpv playback position to the timestamp of the subtitle on point.

As a result, inserting a new subtitle (which also moves point to it) makes mpv seek to that new subtitle.

You can toggle the auto-seek behaviour with C-c , or maybe C-c . which does the opposite (moving point to current playback position). I have a very hard to time distinguish between those two for some reason.

C-h m should get you a list of all keybindings.

jpggithub commented 3 years ago

Thanks! I was a little bit confused with all the options.

Conclusion :

The end of the subtitle could then be before the start (because of the timestamp previously given by M-i) but my main problem is solved.

I leave the bug opened because I think the procedure could be more simple ;-)

sachac commented 3 years ago

The subed-split-subtitle command at https://github.com/rndusr/subed/pull/25 may be useful for this scenario, if you start with a subtitle that spans the whole video.