SubtitleEdit / subtitleedit

the subtitle editor :)
http://www.nikse.dk/SubtitleEdit/Help
GNU General Public License v3.0
8.73k stars 908 forks source link

commandline set min gap #6918

Closed emcodem closed 6 months ago

emcodem commented 1 year ago

Just a random user query: i see set min gap is possible from commandline, it seems to be included in the fix common errors. My goal would be to automatically use 2 different commandlines: 1 frame min gap and 3 frames min gap. Is it possible to apply only min gap from commandline and how could i parameterize the 1 and 3 frames setting?

Thanks a bunch!

emcodem commented 1 year ago

OK so after all i was able to set 2 different min gaps from commandline but it is a little clonky. Basically the Settings that you set in the Userinterface are stored in the Settings.xml file along with the main .exe file. So my choice was to either dynamically edit settings.xml before calling the commandline or store 2 different Versions of SubtitleEdit installation folder on disk.

Also, it looks like we cannot use "profiles" from commandline, so the settings.xml must contain the changes for the default profile. It also remembers which checks are enabled for "fixcommonerrors" (that is where the min gap is applied).

I decided to store 2 separate installations because i did not find it very safe to dynamically edit settings.xml (thread safety).

The final commandline looks like this (again, i have 2 different folders with subtitleedit.exe, one for 40ms the other for 120ms min gap) : "C:\ffastrans\Whisper\SubtitleEdit_120ms_mingap\SubtitleEdit.exe" /convert "\HOSTNAME\Share\Transcribe\myfile.srt" srt /FixCommonErrors