ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
About python version, yes I use default package supplied with my distrib (ubuntu 11.04) : python 2.7.1. Ok for your change, I'll incorporate in my code.
For character encoding, I see on you screenshots that output is readable, but not input. Is it not working with your video player?
For the result, what you get from submerge is correct, regarding how I designed it. Like I said, it would be nice to have a few more lines to link together starting points or ending points that are close enough (let's say 500ms)
Yeah, sorry; the accents issue was something to do with Vim I suppose.
Those screenshots are of emacs and it seems comfortable with your hardcoding.
Also, I understand the duplicate entries now... it just remains on screen with each new entry with only a little flicker.
Its a cool program, and I like the pysrt. I'm glad you were moved to make a python `port'.
Last edited by cin_; 06-18-2012 at 06:03 AM.
Reason: gramm`err
it just remains on screen with each new entry with only a little flicker.
Exactly. It's not nice to see when you look at the srt source, but when running, it's just a bit uncomfortable when title is moving from one line to another. To be improved...
* Also it uses a few more kilobytes, but who cares when it's beside a movie file big from 700MB to 8+GB !
Last edited by pierrepoulpe; 06-18-2012 at 06:35 AM.
Thanks a lot for the Python file.
I tried it and it is working all right.
Would there be an easy way though, to ensure that languages always get displayed in the same order, for instance French on the top and English at the bottom? With my trial they seem to change place all the time.
Thanks a lot for your python script. This is exactly what I have been looking for. In the first screenshot attached to your post, it shows some confusion in the beginning of the combined subtitles. I think that is probably because of different starting times of the subtitles to be merged. When the starting times are identical, it worked well.
Probably you can fix this by synchronizing all the timings of the two subtitle files with Subtitle Workshop, downloadable at the following website: http://www.urusoft.net/downloads.php?lang=1
By: Edit/Timings/Adjust/Adjust to Synchronized Subtitles
By the way, I am new to python and I have problem in installing the SRT Library pysrt in Windows XP environment.
Could you please give me some instructions?
Many thanks!
------
Anybody who knows how to install the SRT library pysrt in Windows XP?
I would appreciate it very much if you could give me a little hint.
Thanks a lot!
Last edited by dhhkg; 01-07-2013 at 10:25 PM.
Reason: Adding request for help from others
I find it interesting that people coming to this thread all comment on the python script and suggest how to fix it.
The bash script works perfectly for its intended use... I could put more lines of code into beefing up its feature set, but as it stands it does what it is intended to do.
If it is a matter of language choice, sure, I can understand, I like python too.
But instead of incompletely trying to learn third party libraries and getting results that leave you wanting, you could take a minute to rewrite the implementation from the bash script into a python script. Devoid of any need for third party libraries.
Last edited by cin_; 01-08-2013 at 02:03 PM.
Reason: gramm`err
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.