Improve LRC output by removing SRT styles#21
Open
v2lmmj04 wants to merge 1 commit intoercanserteli:masterfrom
Open
Improve LRC output by removing SRT styles#21v2lmmj04 wants to merge 1 commit intoercanserteli:masterfrom
v2lmmj04 wants to merge 1 commit intoercanserteli:masterfrom
Conversation
ASS files, or even SRT files, may contain styles / markup that are not desirable to exist as part of the final output when exporting subtitles (especially LRC files). This updates the ffmpeg command when converting subtitles to use a plain text format that removes any sort of styling. It results in SRT files also always being "converted" as a result, as they may have styling that needs removed as well. It may not handle cases where `convert_sub_if_needed` is not called, such as through the `condense_multi` -> `extract_srt` code path that seems to skip calling this function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This addresses #20 .
ASS files, or even SRT files, may contain styles / markup that are not desirable to exist as part of the final output when exporting subtitles (especially LRC files).
This updates the
ffmpegcommand when converting subtitles to use a plain text format that removes any sort of styling. It results in SRT files also always being "converted" as a result, as they may have styling that needs removed as well.It may not handle cases where
convert_sub_if_neededis not called, such as through thecondense_multi->extract_srtcode path that seems to skip calling this function.I functionally tested by running
.\make_exe.bat, updating the config per the issue, and dragging a folder over the new executable for three cases:SRT file with no styling (陰の実力者になりたくて! Season 2, Episode 1)
SRT file with styling (陰の実力者になりたくて! Season 1, Episode 1)
ASS file with styling (からかい上手の高木さん Season 2, Episode 1):
To confirm the LRC output was as expected, and that SRT -> SRT didn't cause any issues. These were all video + external subtitle file cases.
I also noticed that lines containing only symbols like these from 葬送のフリーレン Season 1, Episode 1, seem to get removed now:
Whereas before the SRT file was just directly used so it produced:
Even though I didn't modify the
filtered_charactersentry in config.json from this, which should have already been already been filtering out those lines (but wasn't, potentially because of the{\an8}formatting on the same line?):Though ones only containing the
{\an8}types of content that also have regular text are preserved (with the regular text only, not the{\an8}).