个人工具

UbuntuHelp:MPlayer/CVS

来自Ubuntu中文

跳转至: 导航, 搜索

<<Include(Tag/Unsupported)>> IconsPage?action=AttachFile&do=get&target=mplayer.png IconsPage?action=AttachFile&do=get&target=eyes.png This guide will help you install MPlayer from CVS, which should most noticeably give a GTK2 GUI. If you simply want to install MPlayer from the Ubuntu repositories, see the MPlayer wiki page instead. <
>

Main

Enabling the appropriate repositories

Using your prefered editor, edit your sources.list file (don't forget sudo) so it has these repositories enabled:

  deb http://archive.ubuntu.com/ubuntu breezy-updates main restricted
  deb-src http://archive.ubuntu.com/ubuntu breezy-updates main restricted
  deb http://archive.ubuntu.com/ubuntu breezy main universe multiverse restricted
  deb-src http://archive.ubuntu.com/ubuntu breezy main universe multiverse restricted
  deb http://security.ubuntu.com/ubuntu breezy-security main restricted
  deb-src http://security.ubuntu.com/ubuntu breezy-security main restricted
  deb http://security.ubuntu.com/ubuntu breezy-security universe
  deb-src http://security.ubuntu.com/ubuntu breezy-security universe

You can now update your sources using

  sudo apt-get update

Installing the required/recommended packages

 sudo apt-get install build-essential debhelper libx11-dev libxv-dev libpng12-0 \
 libpng12-dev checkinstall libavcodec-dev aalib1 libaa1-dev libaa1 caca-utils \
 libcaca-dev libavcodec-dev libavifile-0.7-dev libsdl1.2debian-all \
 libsdl1.2debian libsdl1.2-dev libesd0-dev libfaac-dev libfaad2-dev \
 liblame-dev libice-dev libjpeg62-dev libmatroska-dev libmad0-dev  \
 libmp4v2-dev libmikmod2-dev libogg-dev libtheora-dev libvorbis-dev \
 libxinerama-dev libxv-dev xlibs-dev x-dev cvs libquicktime1 libquicktime-dev \
 libmjpegtools0 fakeroot libgtk2.0-dev libmpcdec-dev

If you have never used cvs before, do the following command:

 touch $HOME/.cvspass 

Downloading MPlayer CVS

Issue the following commands to get the latest sources:

 
  cvs -d:pserver:anonymous@mplayerhq.hu:/cvsroot/mplayer login
  cvs -z3 -d:pserver:anonymous@mplayerhq.hu:/cvsroot/mplayer co -P main 

When asked for a password, just hit enter. A directory named main will be created.

Downloading FFmpeg

CVS MPlayer is not fully functional without a copy of the libavcodec, libavformat and libavutil libraries from FFmpeg. To get FFmpeg CVS:

 
  cvs -d:pserver:anonymous@mplayerhq.hu:/cvsroot/ffmpeg login
  cvs -z3 -d:pserver:anonymous@mplayerhq.hu:/cvsroot/ffmpeg co -P ffmpeg 

When asked for a password, just hit enter. A directory named ffmpeg will be created. Copy the libavcodec, libavformat and libavutil subdirectories into the main directory just created from the MPlayer checkout.

 cp ffmpeg/libav* main/ -rf  

In order to include libavcodec and libavutil in CVS updates, add the following lines to main/CVS/Entries:

 
  D/libavcodec////
  D/libavformat////
  D/libavutil////

Previously win32 codecs were placed in /usr/lib/win32. Applications like Xine use that directory for the same purpose. If you would like you can either keep both directories or make one linked to the other. If both directories exist you cannot link them.

 sudo ln -s /usr/lib/win32 /usr/local/lib/codecs

Note:The above is optional.

Compiling MPlayer

Most users will find the default configuration options adequate. However I recommend the following options. The first option is required to install the GUI. The second option is to allow access to large files over 2GB. Useful to rip DVD's or record Digital Video. The third option is for menus in the OSD (On Screen Display).

 cd main 
 ./configure --enable-gui --enable-largefiles --enable-menu --prefix=/usr \
 --confdir=/etc/mplayer 

If some errors pops up it is most likely due to a missing dependency (hey, I tried to include them all). Once it finishes, you should be able to see what you have enabled (ie what you compiled) and you do not. This step is great to see how your compile is piling up.

 make 
 sudo make install 

Building MPlayer's debian package

Open a terminal and type:

 fakeroot debian/rules binary 

Making it work the first time

  • Install the deb package, but don't run the program.
  • Go to a terminal, and run
 sudo mkdir /usr/local/share/mplayer
 sudo mkdir /usr/local/share/mplayer/Skin/
  • Go to the MPlayer download section and download any skin (Blue is the official default skin); in a sudo terminal, extract the directory from the archive, and copy it to /usr/local/share/mplayer/Skin/ ; rename the extracted directory from "Blue" (or whatever) to "default" (cd to the Skindirectory and then try: sudo mv Blue default)
  • Assuming that you've downloaded the Microsoft core fonts (by installing msttcorefonts), do this:
  sudo ln -s /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType/Arial.ttf \ 
  /usr/local/share/mplayer/subfont.ttf

Now you can safely start gmplayer. You can later import more skins to the ~/.mplayer/Skin folder.

Extras

Smooth playback

The defaults of MPlayer's A-V sync parameters aren't fine-tuned for perfect files. When looking at timing in such detail, you should take care of video timers, too. Be sure that the hardware RTC timer is used (MPlayer will complain to the standard output if the RTC timer has a value lower than 1024, start mplayer from a terminal window and examine the error messages). First make sure the kernel rtc module is loaded in your kernel permanently:

  gksudo gedit /etc/modules

Add

  rtc

at the end of the list. Now to set up the rtc timer value at booting up time:

  gksudo gedit /etc/sysctl.conf

Add the following:

  dev.rtc.max-user-freq=1024

and save the file. For faster loading times, you will need to include the rtc module in your initrd image. Add it to your mkinitramfs configuration file:

  gksudo gedit /etc/mkinitramfs/modules

Add:

  rtc

and regenerate the initrd file of your running kernel:

  sudo dpkg-reconfigure linux-image-$(uname -r)

In case you have several kernels installed, you will have to specify their version explicitly. If you want instant gratification, you can set up the rtc values of the running kernel before stating mplayer like this:

  sudo modprobe rtc
  sudo sysctl -w dev.rtc.max-user-freq=1024

Updating your CVS MPlayer

Go to your MPlayer main directory and do

  cvs -z3 '''update''' -dPA  and repeat the compiling steps.

MPlayer Clearlooks skin

The Clearlooks skin is available on gnome-look.

Mozilla MPlayer Plugin

Go here to get the source, and you'll also want to get the Mozilla SDK. Once that is downloaded, extract it, just like we did mplayer, then browse to the directory it made and run ./configure again, this time with the following options:

 ./configure --with-gecko-sdk=/path/to/gecko-sdk --enable-gtk2

Once ./configure is done, just run:

 make && sudo checkinstall

And again, it will compile, build a deb file, and install the deb file for you.

ASCII text video (colored)

  mplayer ''video.avi'' -vo caca

ASCII text video (black and white)

  mplayer ''video.avi'' -vo aa

Guide discussion

Follow the link.