mirror of https://github.com/devine-dl/devine.git
Use /ConvertColorsToDialog when converting subs to SRT format
This is because SubtitleEdit keeps color-related information when converting to SRT from WebVTT, TTML, and such formats. Why? Not 100% sure. Maybe some players support colors, but generally if you are using SubRip, it's because you either only want basic text subs, or your player doesn't support these "fancy" ooh-la-la colors. This is a better solution to just stripped out the information. As the option name suggests, it isn't just removing the color information but rather using it to detect different speakers, then appropriately "dialogify" the captions when needed. I.e., start each speaker's sentence with `- `, and separate them with a new line. The dash-style dialog formatting is quite vital to know if a caption is all spoken by one speaker versus multiple. Not particularly necessary for non-SDH captioning, but would be wanted for SDH subtitles.
This commit is contained in:
parent
3b62b50e25
commit
568cb616df
|
@ -181,14 +181,16 @@ class Subtitle(Track):
|
||||||
Subtitle.Codec.SubStationAlphav4: "AdvancedSubStationAlpha",
|
Subtitle.Codec.SubStationAlphav4: "AdvancedSubStationAlpha",
|
||||||
Subtitle.Codec.TimedTextMarkupLang: "TimedText1.0"
|
Subtitle.Codec.TimedTextMarkupLang: "TimedText1.0"
|
||||||
}.get(codec, codec.name)
|
}.get(codec, codec.name)
|
||||||
|
sub_edit_args = [
|
||||||
|
sub_edit_executable,
|
||||||
|
"/Convert", self.path, sub_edit_format,
|
||||||
|
f"/outputfilename:{output_path.name}",
|
||||||
|
"/encoding:utf8"
|
||||||
|
]
|
||||||
|
if codec == Subtitle.Codec.SubRip:
|
||||||
|
sub_edit_args.append("/ConvertColorsToDialog")
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
[
|
sub_edit_args,
|
||||||
sub_edit_executable,
|
|
||||||
"/Convert", self.path, sub_edit_format,
|
|
||||||
f"/outputfilename:{output_path.name}",
|
|
||||||
f"/outputfolder:{output_path.parent}",
|
|
||||||
"/encoding:utf8"
|
|
||||||
],
|
|
||||||
check=True,
|
check=True,
|
||||||
stdout=subprocess.DEVNULL,
|
stdout=subprocess.DEVNULL,
|
||||||
stderr=subprocess.DEVNULL
|
stderr=subprocess.DEVNULL
|
||||||
|
|
Loading…
Reference in New Issue