Difference between revisions of "Linux Video Playback"
|Line 1:||Line 1:|
Revision as of 18:29, 19 March 2010
- 1 Recommended Media Players
- 2 MPlayer
- 3 SMPlayer
Recommended Media Players
Perform the one of the following commands as root, depending on your distribution.
Debian Based Distributions (Includes Ubuntu)
aptitude install mplayer
For additional codecs:
1. Visit http://debian-multimedia.org/ and add it as a package repository using the instructions in the red boxes.
2. sudo aptitude update && sudo aptitude install mplayer w32codecs
Usually the version in Ubuntu default repos is pretty old, you might want to check PPA for updated versions.
zypper in mplayer
Fedora/Red Hat Based Distributions
yum install mplayer
pacman -S mplayer
emerge -ptva mplayer
Not all distributions include the full set of mplayer codecs in their repositories. To install the full set follow these easy steps.
1. Download: http://www4.mplayerhq.hu/MPlayer/releases/codecs/all-20071007.tar.bz2
2. Extract with: tar xvf all-20071007.tar.bz2
3. Copy the codecs (but not the directory) to the MPlayer codec directory. Default is /usr/lib/win32
Nvidia GPU Acceleration
If you use Nvidia GPU, be sure to install their latest binary drivers, as they offer offloading video decoding from CPU to GPU which provides far smoother playback, especially for h264 video, while keeping CPU usage at vero low level. Check your mplayer configuration to use both vdpau video codec (-vc) and video output (-vo). Type "mplayer -vo help" to list available outputs.
ATI GPU Acceleration
The upcoming (as of 2009.10.04) open source driver should provide hardware accelerated video decoding for R600+ based GPUs. This will most likely happen around Linux Kernel 2.6.32 release.
This is a sample configuration file tailored for specific preferences. The MPlayer configuration file can be found at: ~/.mplayer/config. All of the options are documented in the manpage and also [online http://www.mplayerhq.hu/DOCS/man/en/mplayer.1.html].
# If no GPU-specific video output driver is available, xv is the best choice, # followed by x11 (which doesn't not do software zooming unless passed "-zoom" or "zoom=1") vo=xv ao=alsa # 4 audio channels for surround sound files channels=4 # Default audio and subtitle tracks. (Not all files use the correct tags, # so sometimes it will be necessary to switch streams manually with '#' and 'j' # or from the command line with "-aid x" and "-sid x") alang=jp,jpn, slang=en,eng, # Find ASS subs and use the fonts provided in the file if possible ass=1 embeddedfonts=1 fontconfig=1 # The highest level of subtitle anti-aliasing spuaa=4 # Less stdout text quiet=1
MPlayer has a huge collection of filters included. Some of them are magical.
- View styled subs, even if you only have plain subs:
- mplayer -ass -embeddedfonts myvideo.ext
- View external subs:
- mplayer -ass -sub mysubs.srt myvideo.ext
- Play interlaced video without combing:
- mplayer -vf pullup myvideo.ext
- Increase saturation and contrast:
- mplayer -vf eq2=0.8 myvideo.ext
- Remove "mosquito" noise:
- mplayer -vf hqdn3d myvideo.ext
- Make crappy video look good:
- mplayer -vf pp7 myvideo.ext
- mplayer -ass -embeddedfonts -vf pullup,eq2=0.8,unsharp=l3x3:0.2,hqdn3d myvideo.ext
SMPlayer provides an easy-to-use QT interface to MPlayer. It contains a couple of nice features including saving the playback position so you can continue watching your video the next time you start it (this feature can be disabled of course).
Debian Based Distributions (Includes Ubuntu)
sudo apt-get install smplayer
You can also:
- Download the .deb file from the SMPlayer website or
- Add the SMPlayer repository to your /etc/apt/sources.list.
deb http://ppa.launchpad.net/rvm/ubuntu hardy main
deb http://ppa.launchpad.net/rvm/ubuntu intrepid main
pacman -S smplayer
emerge -ptva smplayer
After installation you'll need to configure it a little: Start SMPlayer, open the options (Ctrl + P), go to the subtitles section, within the section go to the SSA/ASS library tab and check the check box for using SSA/ASS library.
If you see a black screen at playing, the colors don't seem to be right, or playback is too slow, you may need to change the video rendering mode. To do this go to Options > Preferences > General (This is open by default) > Video > Output driver > x11. This will set it to use software rendering. Alternatively you can use xv for XVideo rendering (Best Performance) or gl/gl2 for OpenGL rendering (Slow).