Sunday, January 13, 2013

My English with Subtitles

Yes, I know, my English is not so good. And I steel study by different ways. This one - watching films with subtitles. It's cool not so handly to seek the video on short distance  by any players. And I usually  use Kdenlive for "step by step" watching the movies. But in this case I watch without subtitles. Today I  wrote small python script for forming guides with subtext. This is what I need.
I found pysrt module for reading srt-filesMy. It's helped me a lot for parsing file and forming by my script somthing like this:

<guide comment="But do we believe his&#xa;story about the DEA?" time="1841.788458"/>
<guide comment="I mean, what does any of&#xa;this have to do with drugs?" time="1844.498458"/>
<guide comment="Well, there's only&#xa;one way to find out." time="1846.458458"/>
<guide comment="Ryan, see if you can uncover" time="1847.858458"/>
<guide comment="what Michelle was doing&#xa;at the DEA." time="1849.808458"/>
<guide comment="I'll try, but it's late." time="1851.448458"/>

And then insert it all Kdenlive xml-project. but I was afraid that the 1148 guides will be too heavy for Kdenlive. But it worked.
Tomorrow I will publish cleared script.

No comments:

Post a Comment