Compiling MPlayer on OpenSolaris

OpenSolaris comes with several basic multimedia players, however they miss important codecs, so after installation you can't really use OpenSolaris to play many types of videos (avi, mpeg, wmv, rm, etc.). Until recently you could get multimedia packages from, but the site doesn't provide these packages anymore. The other solution that exists is to use Fluendo codecs (the mp3 codec is available for free but video codes are not free) which provide decoding functionality for media players distributed with OpenSolaris. For more details see this blog entry.

For those who prefer a free solution for playing video and audio files, this blog provides instructions on how to build and install MPlayer on OpenSolaris 2008.11. In case you don't know MPlayer, it's a great open source multimedia player that can play basically any video or audio files.

\* First of all, you need the source code. Get it from here. Unzip the source in your home directory and switch to the MPlayer directory: cd MPlayer-1.0rc2

\* Install GCC and gmake by running: pfexec pkg install SUNWgcc SUNWgmake

\* Replace the configure script with an updated script (two small changes were necessary for OpenSolaris - the original configure script won't work). The new configure script can be downloaded from here.

\* Run configure: ./configure --prefix=/opt/mplayer

\* Run gmake: gmake

\* Run install (as root): gmake install

Supposing everything went well (it should), mplayer is now available and can be ran from /opt/mplayer/bin/mplayer [video_file].

You can right click on video files and define associations to provide an easy playback for different video types. It may be also useful to add MPlayer to your PATH using the .profile script in your home directory. It is also possible to compile MPlayer with a GUI, but I prefer the command line version, so these steps just describe the non-GUI version. In case of the GUI version you need to get various additional header files from the IPS repository, otherwise MPlayer won't build.


Lovely, thanks :)

Posted by Dave on March 28, 2009 at 04:43 PM GMT #

Will this come pre-compiled and packaged with 2009 05?

Posted by Ryan de Laplante on March 28, 2009 at 09:10 PM GMT #

Hi Ryan, unfortunately Sun can't provide packages such as MPlayer in it's IPS repository due to legal issues. So it's up to the community to create repositories for such applications.

Posted by Roman Strobl on March 29, 2009 at 04:04 AM GMT #

Nice mate, I have two questions.

1. What $PATH you used.
2. Do you add any fancy features/codecs that are not avialable in binary IPS mplayer package from blastwave repository?


Posted by vermaden on March 29, 2009 at 10:06 AM GMT #

I used the default $PATH in OpenSolaris 2008.11. As for the blastwave MPlayer package, I tried to intall it recently and it didn't work, which is why I recompiled mplayer myself in the first place. If you want more codecs they can be downloaded from the mplayer site (in binary form).

Posted by Roman on March 29, 2009 at 10:57 AM GMT #

Are you talking about that one:

The sollution is:
$ pfexec bash
# rm -rf /opt/csw/lib/i386
# cd /
# pkg install IPScommon

Then you can install any package from blastwave without problems.

Of course if it failed before you should umount and destroy unneeded BEADM environments.

Posted by vermaden on March 29, 2009 at 12:39 PM GMT #

This is great! Finally we can play movie files on OpenSolaris. I use it under b109 and it's working perfectly. Could you also explain howto install mplayer with a GUI?

Posted by Frank on March 29, 2009 at 03:03 PM GMT #

Vermaden, thanks for the hint with Blastwave. I will still probably avoid Blastwave because it installs too many duplicate packages on my system.

Posted by Roman Strobl on March 29, 2009 at 04:54 PM GMT #

Frank, I'll look into compiling MPlayer with GUI later on this week...

Posted by Roman Strobl on March 29, 2009 at 04:55 PM GMT #

I was able to compile it with the GUI, using your directions with one minor modification:
./configure --enable-gui --prefix=/opt/mplayer
It works quite nicely.
As for blastwave, i too avoid it whenever possible for the same reasons you mentioned.

Thanks! Now I can play DVDs on the laptop! : )

Posted by Joseph Sniderman on March 29, 2009 at 08:16 PM GMT #

./configure --enable-gui --prefix=/opt/mplayer

but i get error like this :
Checking for GUI ... yes

Error: X11 support required for GUI compilation.

Check "configure.log" if you do not understand why it failed.

Posted by Rachmat Febrianto on April 08, 2009 at 04:53 PM GMT #

Just add X11 headers and libraries (SUNWxorg-headers, SUNWxwinc and SUNWxwslb) from Sun packages in X11 group. It compiled well on my 2008.11 build

Posted by apata on April 13, 2009 at 02:49 PM GMT #

I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.


Posted by Ruth on April 14, 2009 at 11:07 PM GMT #

Does not work. Gmake makes mistakes.

Posted by Andrius Burlega on May 23, 2009 at 10:09 AM GMT #

Be aware of the fact that there is more then one version of gnu tools like gmake on solaris. Install the gnu package, modify your path so that installed versions are used first, then it is a go to compile mplayer. I still could not compile vnc, and did not try to compile, but mplayer & ffmpeg compiled fine, I can use ps3mediaserver just fine to serve jpeg, raw files + all sort of fivx, mpeg, avi files to my PS3

Posted by apata on May 23, 2009 at 11:58 PM GMT #

Lovely thanks.
But I still met some problem when run gmake then I got some message as follows :
awk : syntax error near line 67
awk : illegal statement near line 67
awk : syntax error near line 76
awk : illegal statement near line 76
awk : syntax error near line 128
awk : bailing out near line 128
gmake[1]:\*\*\*[pci_name.c] error 2
gmake[1]: leaving directory '/export/home/MyHome/MPlayer-1.0rc2/vidix'
gmake:\*\*\* [vidix/libvidix.a] error 2

There are too long meeage need to know, I know that is not your responsibitity. So if you can helping me, I will very appreciated you, thanks a lot.

Posted by Adam on June 03, 2009 at 12:24 AM GMT #

I am sorry that helping in detail is not very easy for me, as I am not very experienced on unix systems, I've just setup a home file server and a media server and that's all.

Probably you're using an old version of gcc, as if I remember correct, you need to have a new one, and the one on opensolaris is old. So pay a visit to blastwave and update your gcc. Also check dependencies that may be required by mplayer, as I have compiled a couple of applications and I had to compile a couple of dependenct libraries also, pity that I don't remember now for which application I had compiled them for, probably for ffmpeg.

First step: update gcc, and give it a try. Then you may google "opensolaris compile mplayer" kind of queries, as there are some very good guides out, I have got tons of information by googling

Posted by apata on June 03, 2009 at 12:44 AM GMT #

Thank you so much for replay me in a lot of detail description about this problem. I may need to pay a lot of effor to solve this promblem. If I have solving the problem I will post it back. Thanks a lot... Thanks.

Posted by Tung ChiHsiung on June 03, 2009 at 07:39 AM GMT #

it's a pity that I did not take down note of the steps I've completed. It would have helped people a lot. I'll do it for further compilations.

good luck there

Posted by apata on June 03, 2009 at 08:38 AM GMT #

MPlayer developers don't recommend that release 1.0rc2, because it's out of date now. These days you should use the latest version of MPlayer from Subversion repo.

Its compilation is possible in that moment, because the bugs #1496 and #1499 in MPlayer Bugzilla have been fixed recently. Please note you still need to apply a patch for a bug #1477.

Below is short instruction:

$ pfexec pkg install SUNWsvn SUNWgcc SUNWgmake SUNWgawk SUNWxorg-headers

$ mkdir ~/src
$ cd ~/src/
$ svn checkout svn:// mplayer

$ cd mplayer/
$ wget -O - |patch -p0

$ ./configure --prefix=/opt/mplayer
$ gmake
$ pfexec gmake install

Good luck and have a nice watching movies using MPlayer! :)

Posted by ptecza on June 26, 2009 at 01:52 AM GMT #

No, does not work. After gmake following crack appears:
./mpbswap.h:9: error: conflicting types for 'swab'
/usr/include/stdlib.h:161: error: previous declaration of 'swab' was here
./mpbswap.h:9: error: conflicting types for 'swab'
/usr/include/stdlib.h:161: error: previous declaration of 'swab' was here
gmake: \*\*\* [command.o] Error 1

Posted by Andrius Burlega on June 26, 2009 at 02:25 AM GMT #

If you are using Opensolaris 2009.06 (I have moved to it), there is a very nice thread about compiling mplayer on opensolaris, which I have followed step by step, and compiled ffmpeg (even ffmpeg-mt which multi threaded version which scales better on multicore machines) and compiled mplayer successfully.

Here is the link to forums, check post 3, and follow it step by step.

Posted by apata on June 26, 2009 at 02:38 AM GMT #

here is the link, sorry, I was involved in solving the math problem to post :)

Posted by apata on June 26, 2009 at 02:40 AM GMT #

god, here is the link to the post, soooory, still sleeping today

Posted by apata on June 26, 2009 at 02:42 AM GMT #

@adam: the reason it's not compiling is probably because you are trying to compile it when you are the "root" user. If you do echo $PATH as a normal user and then do "su - root" and then echo $PATH, you will notice that the $PATH variable is completely different for root than it is for a normal user. A normal user has the GNU version of awk while root probably has the old AT&T UNIX version of awk. You need to use the GNU version of awk for it to build correctly.

Posted by system5 on August 04, 2009 at 10:04 PM GMT #

You can get MPlayer compiled from SVN source with support for 137 audio & 299 video codecs from

Posted by asyropoulos on October 04, 2009 at 05:48 AM GMT #

where the location for mplayer codec on opensolaris ?? i want to add extra codec ..

Posted by Rachmat Febrianto on October 24, 2009 at 08:55 PM GMT #

What do you mean? The binary can handle all these different codecs.

Posted by asyropoylos on October 25, 2009 at 09:45 AM GMT #

i mean, can we use extra mplayer codec from :

then, where the place to extract that codec on opensolaris ???

Posted by Rachmat Febrianto on October 25, 2009 at 12:07 PM GMT #

Yes you can use them and you should place them in

Posted by asyropoulos on October 25, 2009 at 01:41 PM GMT #

I got the latest mplayer to compile using a similar procedure, but your configure file was not necessary. I downloaded the latest rc4 release and configured it --with-install=ginstall in addition to --prefix and everything went fine (the other change you made for -rdynamic is in the configure script now). I also had to set CC to gcc to avoid using the Sun Studio compiler.

Posted by Sprewell on April 09, 2011 at 01:55 AM GMT #

Post a Comment:
  • HTML Syntax: NOT allowed

The Observatory is a blog for users of Oracle Solaris. Tune in here for tips, tricks and more as we explore the Solaris operating system from Oracle.

Connect with Oracle Solaris:


« April 2014