Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix problem with extra characters in subtitle #1

Merged
merged 1 commit into from
Aug 30, 2017

Conversation

rosetinted
Copy link

I made some modifications to the way subtitles are extracted. Looking closely at the .caption files, I discovered the timestamps and subtitles appear at predictable positions. This allows them to be separated from the binary data without needing to filter any characters. I tested this method on 16 courses, and so far I've only had good results.

The .caption files consist of subtitle text and timestamps with some
binary data interposed. When converted to text, this binary data
produces random, mostly unprintable characters. Many can be filtered
out, but printable characters are sometimes overlooked and end up in the
subtitle. This problem can be overcome by taking a different approach.
Study revealed that the subtitle text and timestamp data appears at
predictable positions in the .caption file. This commit replaces the
filter method with one that makes use of this principle, extracting only
text and timestamps and leaving out any binary data.
@rosetinted
Copy link
Author

I'm adding some proof of my claim of improved accuracy. Since the question came up in a different conversation, I did a comparison between my method and the recent changes made to LyndaCaptionToSrtConvertor. The resulting diff shows that the regex filter method still misses characters sometimes, where the extraction method converted correctly.

Copy link
Owner

@mdomnita mdomnita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the work, good to see someone take a different approach.

@mdomnita mdomnita merged commit da0ef57 into mdomnita:master Aug 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants