sachac / subed

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

Describe workflow for writing new subtitles? #15

Open larsmagne opened 4 years ago

larsmagne commented 4 years ago

The README seems geared towards editing existing subtitles. It would be nice if there was a section there to describe what the typical workflow would be when writing brand new subtitles: I've played around with the mode for fifteen minutes, and I don't think I've quite understood how this mode is to be used efficiently.

rndusr commented 4 years ago

Editing is indeed my use case. I've tried to keep creating subtitles from scratch in mind, but I couldn't come up with a good work flow.

Even the editing work flow hasn't been very efficient for me. I think the mpv integration should be much tighter but I'm not sure how exactly.

If C-h m doesn't help, I'm afraid I can't either.

larsmagne commented 4 years ago

I've uploaded a movie to Youtube, and then made Youtube auto-segment the audio, and then downloaded the resulting .srt file from Youtube. :-/ It has no text, of course, but it does mark the sections where there's talking, so using that I'm making some progress.

But it can be hard to actually hear what people are saying when listening to looped snippets, so I've added some commands to snap out of the loops and listen more continuously, which helps.

The mode seems quite intuitive once you've got a scaffolding going. But, yes, the mpv integration needs just a bit more... stuff. Perhaps widening the loops sometime.

rndusr commented 4 years ago

I think I've added options that let you define how much time before/after the subtitle the loop to include.

But the issue is that the loop might overlap with the previous subtitle, and then the cursor would jump back to the previous loop if that feature is turned on. Maybe disabling cursor-jumping while looping would fix this. I don't remember if I've tried.

larsmagne commented 4 years ago

Adding some time after the loop just makes the mode continue on to the next title (if there's an overlap) due to

subed-mpv-playback-position-hook #'subed--ensure-subtitle-loop

The mode is rather difficult to debug due to all the indirection in the code, and all the functions that seem to appear out of nowhere -- it makes the normal Emacs debugging interfaces rather useless, unfortunately.

rndusr commented 4 years ago

It looks like disabling point-to-player sync while looping fixes that issue I vaguely remember. I've pushed a simple fix and changed the default values of subed-loop-seconds-before/after to 1 second.

That should give you some time to understand badly aligned subtitles without moving point.

alienbogart commented 4 years ago

I would also be interested in that answer.

larsmagne commented 4 years ago

I ended up uploading the video to youtube and using their tool to create the "scaffolding": They add the timings for each line, basically, and then I downloaded that file, and used this Emacs mode to fill in the translations. But it's not ideal...

alienbogart commented 4 years ago

I ended up uploading the video to youtube and using their tool to create the "scaffolding": They add the timings for each line, basically, and then I downloaded that file, and used this Emacs mode to fill in the translations. But it's not ideal...

I coincidentally subtitled my video yesterday using YouTube's builtin tool. It's certainly not ideal, but a lot better than I thought. If I could use Emacs to create subtitles from scratch I could even make that a hobby, all the other programs are so-not-Emacs hahaha

Thanks ;)

rndusr commented 4 years ago

Aside from M-i (insert blank subtitle(s)), I have no idea how creating subtitles from scratch would work with Emacs. It looks like there are some other tools that can generate subtitles from audio/video sources, but I haven't used any of them.

https://github.com/search?q=generate+subtitles

mooseyboots commented 3 years ago

another possibility would be to install and set up vosk https://github.com/alphacep/vosk-api, and then use https://github.com/boi4/subextractor/blob/master/extract_srt.py.

(you have to download some ~1GB models for the speech-to-text extraction.)

this means no upload to youtube, which seems to have a max 15 mins limit for free accounts.