Pikurrot / whisper-gui

A simple GUI to use Whisper.
MIT License
89 stars 6 forks source link

Feature request: Save to srt #11

Closed jurandfantom closed 7 months ago

jurandfantom commented 8 months ago

Hi there, everything works nice but then noticed there is missing something that I did not expect. There is no easy way to save file with time stamps to file next of source media that was used for transcription (i know that for microphone is pointless, unless file is saved).

Would be possible to add "save to srt" with default path next to used media?

Pikurrot commented 8 months ago

Hi, you are right, that's an important point. I will try to give more freedom to where transcription and timestamps are saved. I will also look into saving to srt.

Pikurrot commented 8 months ago

Ok, I've managed to more or less incorporate your ideas into the program:

Unfortunately, Gradio doesn't save the original path of the uploaded audio, and there is no way to get it (as far as I've investigated). Instead, it creates a temporary file in a cache directory. However, I've added some checkboxes in "Advanced Options" as a workaround. To achieve saving the file with timestamps, you must specify the path where your audio is in "Save Path", then uncheck box "Save in Subfolder" and check box "Preserve Name". That's the simplest way possible I think.

To save to .srt, I've added an option named "Alignments Format" to choose between default JSON or SRT. You should be careful when using the subtitles in .srt, as they may appear too long some times and may not be suitable for videos (as mentioned in #13). So I recommend applying some post-processing to shorten the timestamps. I will also take it into account for a future enhancement.