Difference between revisions of "Linux Video Playback"

From BakaBT Wiki
Jump to: navigation, search
(Installing SMPlayer)
m (minor changes, removed compiling mplayer section as it is out of date)
Line 1: Line 1:
This article explains video playback options for Linux and provides installation instructions.
+
==Recommended Media Players==
 +
;* [[Wikipedia:MPlayer|MPlayer]]
 +
;* [[Wikipedia:SMPlayer|SMPlayer]]
  
==List of recommended players==
 
;* [http://www.mplayerhq.hu/ MPlayer]
 
;* [http://smplayer.sourceforge.net/ SMPlayer]
 
 
==MPlayer==
 
==MPlayer==
 +
===Installation===
 +
Perform one of the following commands as root, depending on your distribution. If you do not find information pertaining to the distribution you use, refer to your distributions documentation.
  
===Installing Mplayer from distro repos ===
+
====Debian Based Distributions (Including Ubuntu)====
Perform the one of the following commands as root, depending on your distribution.
 
 
 
====Debian based distributions (Includes Ubuntu)====
 
 
  aptitude install mplayer
 
  aptitude install mplayer
 
 
For additional codecs:
 
For additional codecs:
 
 
# Visit http://debian-multimedia.org/ and add it as a package repository using the instructions in the red boxes.
 
# Visit http://debian-multimedia.org/ and add it as a package repository using the instructions in the red boxes.
# sudo aptitude update && sudo aptitude install mplayer w32codecs
+
sudo aptitude update && sudo aptitude install mplayer w32codecs
  
 
=====Ubuntu PPA=====
 
=====Ubuntu PPA=====
Usually the version in Ubuntu default repos is pretty old, you might want to check [https://launchpad.net/ubuntu/+ppas PPA] for updated versions.
+
The MPlayer version in the default Ubuntu repositories is outdated, look for a [https://launchpad.net/ubuntu/+ppas PPA] with an updated version.
  
 
====OpenSuse====
 
====OpenSuse====
 
  zypper in mplayer
 
  zypper in mplayer
  
====Fedora/Red Hat based distributions====
+
====Red Hat Based Distributions (Including Fedora)====
Mplayer is not in the official Fedora repos. You will have to add and enable the [http://rpmfusion.org/ RPM Fusion] third-party repos by hand before installing Mplayer.
+
MPlayer is not in the official Fedora repositories. You will have to add and enable the [http://rpmfusion.org/ RPM Fusion] third-party repositories before being able to install MPlayer.
 
  yum install mplayer
 
  yum install mplayer
  
Line 32: Line 28:
 
====Gentoo====
 
====Gentoo====
 
  emerge -ptva mplayer
 
  emerge -ptva mplayer
 
===Compiling MPlayer from source===
 
Most Linux distros ship with very outdated versions of MPlayer. The version of the source maintained at [http://repo.or.cz/w/mplayer-build.git uau's git repository] contains many features and bugfixes not found in the SVN trunk, including:
 
* [http://en.wikipedia.org/wiki/VDPAU vdpau] support ([http://en.wikipedia.org/wiki/Graphics_processing_unit GPU] decoding)
 
* better ff[http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC h264] asm (faster decoding)
 
* newer lib[http://en.wikipedia.org/wiki/SubStation_Alpha ass] (better subtitle rendering; many bugfixes here alone)
 
* no need for external Windows codecs for some files anymore
 
* ordered chapters support (which a lot of modern DVD/bluray rips use)
 
* ffmpeg-mt (multithreaded decoding for multicore processors)
 
* various fixes for bad MPlayer behavior
 
 
git clone http://repo.or.cz/w/mplayer-build.git
 
cd mplayer-build
 
Read the README. Unfortunately, you will have to install the many development headers to enable basic features.
 
  
 
===MPlayer codecs===
 
===MPlayer codecs===
 
+
Not all distributions include the full set of MPlayer codecs in their repositories. To install the full set follow these easy steps.
Not all distributions include the full set of mplayer codecs in their repositories. To install the full set follow these easy steps.
 
  
 
# Download: http://www4.mplayerhq.hu/MPlayer/releases/codecs/all-20071007.tar.bz2
 
# Download: http://www4.mplayerhq.hu/MPlayer/releases/codecs/all-20071007.tar.bz2
Line 55: Line 36:
 
# Copy the codecs (but not the directory) to the MPlayer codec directory. Default is /usr/lib/win32
 
# Copy the codecs (but not the directory) to the MPlayer codec directory. Default is /usr/lib/win32
  
====NVIDIA vdpau====
+
====NVIDIA VDPAU====
 
+
If you use an NVIDIA GPU be sure to install their latest binary drivers as they offer a feature that enables offloading video decoding from the CPU to GPU which may provide smoother video playback, especially for h264 encoded videos while keeping CPU usage at low levels. Check your MPlayer configuration to use both the VDPAU video option (-vc) and video output (-vo). Type "mplayer -vo help" to list available outputs.
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====
 
====ATI====
 
+
The open source video driver provides hardware accelerated video decoding for R600+ based GPUs.
The upcoming (as of 2009.10.04) open source driver should provide hardware accelerated video decoding for R600+ based GPUs. This will happen probably sometime around linux 2.6.32 release.
 
  
 
===MPlayer tweaks===
 
===MPlayer tweaks===
This is a sample configuration file tailored for specific preferences. The MPlayer configuration file can be found at: <tt>~/.mplayer/config</tt>. All of the options are documented in [http://www.mplayerhq.hu/DOCS/man/en/mplayer.1.html the manpage].
+
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 [http://www.mplayerhq.hu/DOCS/man/en/mplayer.1.html the manual].
  
 
  # If no GPU-specific video output driver is available, xv is the best choice,
 
  # If no GPU-specific video output driver is available, xv is the best choice,
Line 87: Line 66:
  
 
====MPlayer Tricks====
 
====MPlayer Tricks====
MPlayer has a huge collection of filters included. Some of them are magical.
+
MPlayer has a large collection of video filters included. You may use them to achieve different results.
  
 
* Play interlaced video without combing:
 
* Play interlaced video without combing:
Line 101: Line 80:
  
 
==SMPlayer==
 
==SMPlayer==
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).
+
SMPlayer provides a QT based front-end to MPlayer. It contains useful features such as saving the video position allowing you to continue watching the video from that point at a later date.
  
 
===Installing SMPlayer===
 
===Installing SMPlayer===
====Debian/Ubuntu====
+
====Debian Based Distributions (Including Ubuntu)====
 
  sudo apt-get install smplayer
 
  sudo apt-get install smplayer
 
You can also:
 
You can also:
Line 120: Line 99:
 
  emerge -ptva smplayer
 
  emerge -ptva smplayer
  
====Fedora====
+
====Red Hat Based Distributions (Including Fedora)====
You will need to enable [http://rpmfusion.org/ RPM Fusion] to install SMplayer.
+
You will need to enable the [http://rpmfusion.org/ RPM Fusion] third-party repositories to be able install SMplayer.
 
  yum install smplayer
 
  yum install smplayer
  
Line 134: Line 113:
  
 
===SMPlayer tweaks===
 
===SMPlayer tweaks===
After installation you'll need to configure it a little:
+
After installation you may want to configure SMPlayer. 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.
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 the Options > general section > general tab > output drivers > Video, and set it to <tt>x11</tt> -  this will use software rendering. Alternatively you can use <tt>xv</tt> for XVideo rendering or either <tt>gl</tt> or <tt>gl2</tt> for OpenGL rendering. In general you should try these options in the following order for best quality and performance: <tt>xv</tt>, <tt>gl2</tt>, <tt>gl</tt> and finally <tt>x11</tt>.
 
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 the Options > general section > general tab > output drivers > Video, and set it to <tt>x11</tt> -  this will use software rendering. Alternatively you can use <tt>xv</tt> for XVideo rendering or either <tt>gl</tt> or <tt>gl2</tt> for OpenGL rendering. In general you should try these options in the following order for best quality and performance: <tt>xv</tt>, <tt>gl2</tt>, <tt>gl</tt> and finally <tt>x11</tt>.

Revision as of 15:16, 4 September 2010

Recommended Media Players

MPlayer

Installation

Perform one of the following commands as root, depending on your distribution. If you do not find information pertaining to the distribution you use, refer to your distributions documentation.

Debian Based Distributions (Including 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.
sudo aptitude update && sudo aptitude install mplayer w32codecs
Ubuntu PPA

The MPlayer version in the default Ubuntu repositories is outdated, look for a PPA with an updated version.

OpenSuse

zypper in mplayer

Red Hat Based Distributions (Including Fedora)

MPlayer is not in the official Fedora repositories. You will have to add and enable the RPM Fusion third-party repositories before being able to install MPlayer.

yum install mplayer

Arch Linux

pacman -S mplayer

Gentoo

emerge -ptva mplayer

MPlayer codecs

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 VDPAU

If you use an NVIDIA GPU be sure to install their latest binary drivers as they offer a feature that enables offloading video decoding from the CPU to GPU which may provide smoother video playback, especially for h264 encoded videos while keeping CPU usage at low levels. Check your MPlayer configuration to use both the VDPAU video option (-vc) and video output (-vo). Type "mplayer -vo help" to list available outputs.

ATI

The open source video driver provides hardware accelerated video decoding for R600+ based GPUs.

MPlayer tweaks

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 manual.

# 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 Tricks

MPlayer has a large collection of video filters included. You may use them to achieve different results.

  • 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
  • Combine:
mplayer -ass -embeddedfonts -vf pullup,eq2=0.8,unsharp=l3x3:0.2,hqdn3d myvideo.ext

SMPlayer

SMPlayer provides a QT based front-end to MPlayer. It contains useful features such as saving the video position allowing you to continue watching the video from that point at a later date.

Installing SMPlayer

Debian Based Distributions (Including 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.

8.04 (hardy):

deb http://ppa.launchpad.net/rvm/ubuntu hardy main

8.10 (intrepid):

deb http://ppa.launchpad.net/rvm/ubuntu intrepid main

Arch Linux

pacman -S smplayer

Gentoo

emerge -ptva smplayer

Red Hat Based Distributions (Including Fedora)

You will need to enable the RPM Fusion third-party repositories to be able install SMplayer.

yum install smplayer

Building from Source (Compiling)

Grab the tarball from the SMPlayer download page. Decompress it, cd into the directory, and run

./configure
make
sudo make install

If you don't have sudo installed/configured, then the last step will be instead

su
make install

SMPlayer tweaks

After installation you may want to configure SMPlayer. 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 the Options > general section > general tab > output drivers > Video, and set it to x11 - this will use software rendering. Alternatively you can use xv for XVideo rendering or either gl or gl2 for OpenGL rendering. In general you should try these options in the following order for best quality and performance: xv, gl2, gl and finally x11.