LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 06-18-2012, 12:17 AM   #16
cin_
Member
 
Registered: Dec 2010
Posts: 264

Original Poster
Rep: Reputation: 23
Un Long Dimanche De Fianšailles


Sorry, I am traveling at the moment... reliable access is scattered.

Here are three attachments. The first is a side by side depiction of the original subtitle files.

The second is the stacked subtitle file after running Submerge.

The third is the stacked subtitle file after running DualLanguage.


Of note: I am using python3. I see you wrote the script with python2.x so I changed your
Code:
print "usage:"
to
Code:
print("usage:")
perhaps the version discrepancy is the issue? After a quick debug run everything appears to be running smoothly, but with the same results.
Attached Images
File Type: jpg AVLESubs.jpg (74.7 KB, 16 views)
File Type: jpg SubmergedAVLESubs.jpg (35.4 KB, 14 views)
File Type: jpg DoubleLangAVLESubs.jpg (40.9 KB, 16 views)

Last edited by cin_; 06-18-2012 at 12:28 AM. Reason: gramm`err
 
Old 06-18-2012, 04:23 AM   #17
pierrepoulpe
LQ Newbie
 
Registered: Jun 2012
Posts: 8

Rep: Reputation: Disabled
Hello,

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)
 
Old 06-18-2012, 06:00 AM   #18
cin_
Member
 
Registered: Dec 2010
Posts: 264

Original Poster
Rep: Reputation: 23
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
 
Old 06-18-2012, 06:33 AM   #19
pierrepoulpe
LQ Newbie
 
Registered: Jun 2012
Posts: 8

Rep: Reputation: Disabled
Quote:
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.
 
Old 01-01-2013, 03:40 PM   #20
aurerua
LQ Newbie
 
Registered: Jan 2013
Posts: 2

Rep: Reputation: Disabled
Hi,

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.

Best regards
Aurelien
 
Old 01-02-2013, 12:38 PM   #21
cin_
Member
 
Registered: Dec 2010
Posts: 264

Original Poster
Rep: Reputation: 23
Bash Script

If you use the bash script from the original post it is consistent and pretty straightforward: my language, foreign language.

Last edited by cin_; 01-08-2013 at 01:06 PM. Reason: gramm`err
 
Old 01-02-2013, 02:45 PM   #22
aurerua
LQ Newbie
 
Registered: Jan 2013
Posts: 2

Rep: Reputation: Disabled
@cin_ It is the only one I did not try in the thread... I am trying it now.

Thanks for the reply!
 
Old 01-07-2013, 02:08 PM   #23
dhhkg
LQ Newbie
 
Registered: Jan 2013
Posts: 2

Rep: Reputation: Disabled
pierrepoulpe,

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
 
Old 01-08-2013, 01:06 PM   #24
cin_
Member
 
Registered: Dec 2010
Posts: 264

Original Poster
Rep: Reputation: 23
python

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
 
Old 01-08-2013, 01:24 PM   #25
patrick295767
Member
 
Registered: Feb 2006
Distribution: Debian
Posts: 275

Rep: Reputation: 39
Nice idea. I like.

If you like, you could also dictate the word while watching the moving. Check on Git for the full program.

Regards
Attached Files
File Type: txt busy-voicereco-linux.txt (9.2 KB, 12 views)
 
  


Reply

Tags
bash scripting


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Bash+crontab output is in different language jmvidalvia Linux - General 4 04-06-2011 04:37 AM
How can I personalize bash with my own language? tasodan Slackware 3 05-16-2010 04:26 PM
how to change directory using bash or other simple language packets Programming 3 05-08-2009 04:28 AM
Windows native bash-like script language koyi Programming 13 01-24-2006 10:24 PM
Mplayer OGM with subtitles and dual audio fbenites Linux - Software 4 12-16-2003 03:28 PM


All times are GMT -5. The time now is 12:22 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration