LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Playing 2 subtitle simultaneous for movies (https://www.linuxquestions.org/questions/linux-desktop-74/playing-2-subtitle-simultaneous-for-movies-778059/)

nima0102 12-25-2009 12:13 PM

Playing 2 subtitle simultaneous for movies
 
Hi
I intend play 2 subtitle simultaneous in different languages for educational purpose. that means one subtitle is English and another is Persian.
Is there any movie player with this possibility ?

Thanks in advance

David the H. 12-25-2009 04:54 PM

I've never heard of any player that can do that.

What formats are you talking about? The subtitle files for most computer videos are simply text files. You could edit the files so that lines from both languages are displayed together.

If it's a fixed media like dvd then I can't think of any way to do it, other than ripping the disk, extracting and converting the subtitles to a text format, then doing the above.

nima0102 12-26-2009 08:19 AM

Thanks for your attention
I have questioned on forum of Smplayer and got reply on this topic.
But unfortunately this script can not merge unicode subtitle correctly:(

osor 12-29-2009 05:26 PM

Quote:

Originally Posted by nima0102 (Post 3805170)
But unfortunately this script can not merge unicode subtitle correctly:(

There should be no problem in unicode as long as you have set your locale properly and you are using the GNU versions of tr, sed, etc. The problem then is most likely a non-unicode encoding (e.g., ISO8859-6 for arabic scripts). The encoding problem itself has nothing to do with the merging of subtitles. For example,
Code:

mplayer -sub sub.srt vid.avi
should have the same output for the foreign subtitles as the merged version. The trick is to find the source encoding of the subtitles you already have. Or, you can get the bitmap subtitles (from e.g., the DVD) and OCR them directly (you need an OCR program which will detect Persian).

Another option (which if you’re using text subtitles still relies on correct encoding) is to use the gstreamer framework. Gstreamer applies things like subtitles as a filter or layer, so there is no limit to the number of subtitles at one time. The benefit here is that it will correctly handle bitmap and text subtitles, so there is no need to OCR a foreign script. It shouldn’t be too hard to create a gstreamer pipeline in whatever language you like.

For the simple example of 2 srt subtitles with OSS and Xv output:
Code:

gst-launch filesrc location=sub1.srt ! subparse ! top. \
filesrc location=sub2.srt ! subparse ! bot. \
filesrc location=vid.avi ! decodebin name=decoder \
decoder. ! queue ! audioconvert ! audioresample ! osssink \
decoder. ! textoverlay name=top valignment=top ! textoverlay name=bot valignment=bottom ! xvimagesink



All times are GMT -5. The time now is 06:11 PM.