Mplayer Patch

pharon's picture

*OLD* Look at :
http://phaeronix.net/node/72

patch updated for mplayer1.0-pre7, file attached to bottom of page.

*use an overlay to build it, check gentoo documentation about how to make an overlay and use it.
*also an experimental ebuild, which can :
* use the USE flags "-gtk gtk2" to get GTK2 mplayer. Download the GTK2 patch I found somewhere, and put it in the files directory of the overlay you made for mplayer.
*USE flags "bidi arabic" to get support for arabic subtitles
*There are experimental flags I added "toolame x264 mp1e" don't use them.

This patch is for mplayer1.0-pre6 source code:

Apply the patche to the source using:

cd [path to mplayer's source]
patch -Np1 -i [name of patch file]

If it doesn't apply cleanly, tell me and I will try to fix it.

This will add bidi and shaping for displaying arabic correctly in the subtitles. You need fribidi. Add these to the configure command you use:

--enable-arabic-shaping --enable-fribidi

Mohammed Sameer ( Uniball ) found this on arabeye's mailing list.

Neither I or he made it. However I intend to maintain it.

Also you have to convert the subtitle files to UTF-8 using iconv or katoob.
Start mplayer or gmplayer with the following command (don't use gmplayer's preferences):

mplayer -fontconfig -font 'Tahoma' -flip-hebrew -fribidi-charset UTF-8 -subfont-encoding unicode -utf8 [movie filemane]

There is also a gentoo ebuild that will automatically download and apply the patch if the "bidi" USE flag is set.

*NEW*
Thanks to mhlmi we have mandrake RPMS patched and ready for usage, hosted by amrgo. Here's the announcement :

http://www.eglug.org/node/1142

qoute :

this package was patched with the arabic shaping support patch found on the arabeyes mailing lists , phaeron updated the patch to work with the latest mplayer version (MPlayer 1.0pre6 at this time) , I applied the patch and repacked the mandrake package, and amrgo (aka alienbrain) has it hosted on his work place server here http://www.egyfilm.com/amr/mplayer.php"

* Usage Instructions:

1. extract the file using:

tar xvfjp mplayer.tar.bz2

2. read the README file included for installation instructions:

cd mplayer

less README

3. the README file was made in a hurry and it maybe full of typing mistakes, and severe formatting mistakes aswell, read it with patience. for instance, the extraction command in the README is NOT correct

jaa

AttachmentSize
MPlayer-1.0pre6-arabic-subtitles.patch.gz4.13 KB
mplayer-1.0_pre6.ebuild15.22 KB
MPlayer-1.0pre7-arabic-subtitles.patch14.47 KB
mplayer-1.0_pre7-r1.ebuild18.85 KB
MPlayer-1.0pre7-gtk2.patch6.05 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Mplayer With Arabic Subtitles

Hello Shabab,

I've seen that this patch is quite out-dated and now using fribidi2 you can do arabic shaping but after some tweaking in configuration files and compliation options, I also noticed that fribidi2 is still beta and it doesn't have any RPM around.

So I've created Mplayer RPMS and Fribidi2 RPMS to solve this problem, all you have to do is to download the RPMS, follow the instructions and you get it working :)

this was made for Fedora Core 6, I'll port it to Fedora 7 As soon as it's released.

Please see, http://www.ahmedsoliman.com/2007/05/24/mplayer-with-arabic-subtitles-fix/

Arabic Subtitle

Hi Pharon,
I'm just new at linux and i'm using openSUSE 10.2
I'm trying to do all above staff to got arabic subtitle but I faild.
could u please give me an easy structure to solve this problem.

Notes:
I got separate arabic latter in mplayer like this: م ص ر

Thankx

pharon's picture

This is deprecated

The patch is deprecated , since fribidi2 has shaping and joining support. Fribidi2 is not released yet, but it is very easy to install. Check here for more information :

http://phaeronix.net/node/72

I don't know what irc

i made aquick search here but found no irc
so please tell me the address

concerning my questions

I guess you may have faced this problem in your distribution if you addes kde .

simply , I use slackware with latest kde and the problem is that some gtk applications like xchat take the arabic style (file , preferences ) appear at the right also some buttons appear in arabic rather than english , ofcourse this appears after adding "export LC_ALL=ar_EG.UTF-8
" to /etc/profile.d/lang.sh and I can't come over this problem

note :

just read this post and don't add here , just tell me the irc server and channel

pharon's picture

silly me

Which reminds me I don't have an about page yet.

You can catch me on irc.freenode.net in #phaeronix, #eglug, #gentoo-cafe.

but I am not online often these days.

As a side note you don't have to use arabic locale for arabic to work. Any UTF8 locale will work.

hi again man , i got small problem

the problem is in my kde

I moved lately to kde

when trying to install mplayer with patch it didn't result in errors but
when trying to play the subtitle an error appears saying :

Mplayer was compiled without fribidi support

although am sure I compiled it with fribidi support

./configure --enable-fribidi --enable-arabic-shaping --enable-gui

so what's wrong there ?

I also have another problem but not about this topic so where can I ask you about it coz this is not its palce .

pharon's picture

dev package

What distro is this? Make sure you have the development packages for fribidi installed. It has nothing to do with KDE or GNOME though.

If you have a general problem maybe it's better to ask on eglug.org or some other website which has lots of people ready to help.

If you insist on asking me, try to catch me on IRC. ( If you can ) :) !

sorry

I got what you said before but what I was asking about is that gmplayer
played the movie very wellthough I have read that I must use mplayer not
gmplayer and I don not remeber where exactly " may be in
http://www.eglug.org or linux-egypt , dont remeber exactly , but
fortunately I got my information corrected , and thanx alot .
by theway what is hdv codecs and where to find this codec for linux ?
thanx again .

want to add another thing

as I said before in my config file , I added just " Times New Roman "
to be the default subtitle font and it works pretty fine with mplayer
not with gmplayer , when I said gmplayer worked fine I noticed that the
subtitle font is tahoma then I checked my options and it was really
tahomma , when trying to change it to Times New roman subtitles did not
appear correctly , I wanted to add that I put the font tahoma.ttf in my
/root/.mplayer folder and about my configuration it is

in the subtab : subtitles & osd " encoding = none "
in the subtab : fonts "encoding = unicode " , "font = tahoma

just , am wondring

you always say play movies with mplayer not gmplayer so as to see arabic
subtitles well , but in fact I used gmplayer and it is fine , I even did
not use fribidi 2 , I just used the two batches as I said before and have
converted subtitle to UTF-8 , that is all .

pharon's picture

again ?!

Once again. The fribidi2 method is an ALTERNATIVE to the patches. When the new mplayer gets released I will remove these patches and describe the fribidi2 method only, becasue it is cleaner.

Mplayer is the name of the project. Whether you use mplayer commandline, or gmplayer GUI is upto you. Won't make a difference. You can even see me in the screenshots using gmplayer.

Clear?

ok , no problem

it's the right thing to remove wrong parts

no problem , and thanx for the information

by the way :

is there asolution for xine ? since I saw that xine
supports arabic in the arabic book of " learning red hat
9 " I don't know if you read it or not , but the author
put some screen shoots for xine while playing the
matrix movie - with arabic subtitles - .
also I was confused " what is fribidi project exactly ?
and what about vlc ? does it suport arabic without
patching?

thanks for your time

pharon's picture

Ok will do

I will do that soon, when I have time.
Fribidi is a library that implements the unicde standards for bidirectional text and shaping and joining ( recently in cvs ).

You can read about it here :

http://fribidi.org/wiki

The released packages of fribidi, which are probably available for install in any distro's package manager do NOT support arabic shaping and joining. You need to use the experimental version from fribidi's cvs server.

I don't know about redhat 9, it's a thing of the past I would advice against using it.

Until recently only mplayer could display arabic subtitles using the patches available here. But now that we have a central way of doing arabic support, most if not all projects could support arabic with some effort.

As I said here mplayer and vlc work out of the box with fribidi2. Xine shouldn't be any different.

Hope this helps.

It got worked

actually I got it worked

the problem was that I did not know that - fribidi - was apackage

I thought it was just an option , so every time I wanted to compile mplaye

and try to play any movie it gives me error message that it was compiled

without fribidi support , and that what made me got confused .

when I read Mr khalid Hosny's words about fribidi 2 I downloaded fribidi

and got it installed and it worked very fine but with applying the two

patches I didn know where to download this fribidi 2 .

I just found fribidi-0.10.4.tar.gz and didnot find any fribidi 2 so

please tell me where to find that fribidi 2 .

the 2nd thing that confused me that you were talking about ebuild and I

realized that you are using gentoo while Iam running slackware .

I got gentoo installed once before and didn´t use it - may be in future -

Actually the 2 distributions to make you very familiar with linux are

gentoo and slack and they are the only to give you agood efficency in

working and fast responding than others .

I also want to know why gmplayer can load arabic subtitles .

at last I like to simplify what I did to others on behalf of you .

1- download fribidi from http://fribidi.sourceforge.net
and install it .

2- download the latest mplayer and extract it in any place -home will be

-fine - .

3- copy the two patches in the folder containing extracted mplayer source
code

MPlayer-1.0pre7-gtk2.patch

MPlayer-1.0pre7-arabic-subtitles.patch

4- apply the two patches using :

patch -Np1 -i MPlayer-1.0pre7-gtk2.patch

patch -Np1 -i MPlayer-1.0pre7-arabic-subtitles.patch

5- ./configure --enable-arabic-shaping --enable-fribidi --enable-gui

6- make && make install

7- open ~/.mplayer/config with any editor

8 - add these lines to it

fontconfig=1
font='Times New Roman'
flip-hebrew=1
fribidi-charset=UTF-8
subfont-encoding=unicode
utf8=1

I found this trick in linux-egypt and it is very nice so as not to run
the command

mplayer -fontconfig -font 'Tahoma' -flip-hebrew -fribidi-charset UTF-8 -subfont-encoding unicode -utf8 [movie filemane]

every time you want to play amovie and just run : mplayer [movie name ]

9- notice that I used Times New Roman instead of tahonmma so as to get
agood shape for subtitles .

10- at last you have to convert subtitle file to UTF-8 using katoob and

this is the easiest way .

thank you

pharon's picture

you got it worked out all wrong

Supercede means makes obsolete. That is the patches are NO LONGER needed.

Only use one solution ... EITHER the patch OR fribidi2

firbidi2 is NOT yet a package, you have to get it from cvs, as I described in the link I posted.

The "trick" was posted in one of the comments in this thread long ago before linux-egypt.

Tahoma looks much better than times new roman, that is if you have either of them installed. You need to install them manually becasue they are M$ fonts and are not free. I am not ok with distributing non-free fonts.

With your persmission I will remove the wrong parts from your post so they don't cause confusion.

I will wait for your acceptance, because I don't want anybody to think of it as censorship.

that´s difficult some how

Hi
the way you show people how to apply patch is difficult some how , and not
organized properly .

actually I got lost in this because there are many patches , some for mplayer 6 and others for 7 .

how to use new patches is my problem " didn;t find good information in gentoo hand book about overlay ebuild "

please tell me in detailed how to do this and what the gtk patch does exactly ?

is it suitable for latest version MPlayer-1.0pre7 try2 ?

why didn you email the mplayer developpers to apply your patch in their releases ?

pharon's picture

You are right

I am not very good at explaining things. Or maybe I am just lazy.

Don't worry about the patches, they are superseded by this page:

http://phaeronix.net/node/72

and I explained more here :
http://www.eglug.org/node/1767#comment-17243

I will write a note on the top of the page. About using an overlay :

http://gentoo-wiki.com/HOWTO_Installing_3rd_Party_Ebuilds

The gentoo wiki is a very valuable source of information.

The GTK2 patch was used to make the mplayer GUI use GTK2, so that it can display arabic filenames properly. Mplayer-cvs and naturally the next version has this option already.

The guy who made the arabic patch tried to submit it before but it got rejected. We don't need it as I explained above.

In my debian unstable,

In my debian unstable, mplayerpre7's configure script was not able to correctly tell if fribidi is installed or not.
I had to edit the configure script, change FRIBIDI_CHARSET_UTF8 to FRIBIDI_CHAR_SET_UTF8 to make it work.

just in case anyone had the same problem ;-)

Still doesn't work

Hi
I followed all the instructions and though I can read the sub file in hebrew I still get all underlines ____ in the subtitle.
Any idea?

Oren

1. Make sure you specified a

1. Make sure you specified a valid hebrew font using -font font_name_here
2. Make sure your subtitle is utf8.

Still doesn't work - more information

Here is my config file:
fontconfig=1
font='/usr/share/fonts/msttcorefonts/arial.ttf'
#subfont-encoding='ISO8859-8'
flip-hebrew=1
fribidi-charset=UTF-8
subfont-encoding=unicode
utf8=1

the font file is there
the sub file is UTF-8
This is the command line I use:
# mplayer -sub movie.avi

Here are four line from the sub file...
{1}{1}25.000
{556}{923}The Professor תורג×

pharon's picture

I suppose for for hebrew you

I suppose for for hebrew you will need to change things :

1- If hebrew needs shaping you will have to define the way it gets shaped. Use the arabic shaping file in this patch as an example.

2- Use a font that has hebrew charachters.

Win32

Can any brave warrior compile this for Win32. I am trying to introduce linux through the Win32 version of mplayer, which they really like (except for arabic subtitle support).

pharon's picture

I think we can cross compile

I think we can cross compile this from linux for win32 using mingw , I saw something similar in the configure script. I will look into it. Did you try getting it to work in cygwin?
cygwin can also run lots of other linux programs on win32 , a great way to introduce the concept of alternate desktop environments.

it's great

it works very good with me.
it's amazing and it's faster than any linux I have used.
realy realy i like it

pharon's picture

I am happy to hear that,

I am happy to hear that, thank you for sahring your experience.

just greetings

what a nice site :)

just greetings from fallow

:)

Mplayer arabic path

i did the path file on source of mplayer 6 and i make -f makefile
after this i make install and the compilation working fine but the subtitle the same problem arabic not appiear
and i tried to edit the /etc/mplayer.conf and put the font='ae_ALMothnna'
flip-hebrew=1
fribidi-charset=UTF-8
subfont-encoding=unicode
utf8=1

give me error and not working at all

can you please step by step what we can do to make mplayer working with fedora with subtitle arabic

try another font

try another font

pharon's picture

Why?

What's wrong with this one? Maybe you don't have it. It's one of the fonts from the arabeyes khotot project.

http://www.arabeyes.org/project.php?proj=Khotot

this what i ment

this what i ment

little notice

good done man
it works well with me
but i want to added this
you can edit mplayer's configuration file at ~/mplayer/config to cantain this
##########################
fontconfig=1
font='ae_ALMothnna'
flip-hebrew=1
fribidi-charset=UTF-8
subfont-encoding=unicode
utf8=1
##########################
instead of typing the options each time you want to run mplayer
also every one can chang the font 'ae_ALMothnna' with the font he likes(in fact tahoma is not installed in my system ,and it takes while untile i discovered that)

thanks pharon

mplayer arabic patch

i need to work in fedora this patch can you please give the excatly what i am need to do for arabic subtitle

pharon's picture

good note

Thanks.
Yes you are right, I am just lazy, I should write a good howto.

You don't have to double post, all comments have to be approved, due to
the nice spam flood. I deleted the duplicate post if you don't mind :)

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options