Linux Video Playback: Difference between revisions

From BakaBT Wiki
Jump to navigation Jump to search
m (Added Baka Mplayer)
mNo edit summary
Line 6: Line 6:
;* [http://bakamplayer.u8sand.net Baka Player] (graphical interface for mpv player)
;* [http://bakamplayer.u8sand.net Baka Player] (graphical interface for mpv player)


==Discontinued Media Players==
==Previously Recommended but Discontinued Media Players==


* Mplayer2 (fork of Mplayer - inactive, domain expired. Do not install from any distribution)
* Mplayer2 (fork of Mplayer - inactive, domain expired. Do not install from any distribution)

Revision as of 17:22, 19 March 2015

Recommended Media Players

Previously Recommended but Discontinued Media Players

  • Mplayer2 (fork of Mplayer - inactive, domain expired. Do not install from any distribution)
  • SMplayer2 (graphical interface for Mplayer2 - Do not install from any distribution)


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

mplayer is packaged for Debian. As root:

apt-get install mplayer

However, this is often not the newest release (especially if you are running Debian stable) and does not contain support for all codecs. In particular, very old builds may not have 10-bit support. Such users will want to install newer packages:

  • Double-check what version of Debian you are running (cat /etc/debian_version). If it contains any (or more than one) of the words "wheezy", "jessie", "sid", "testing", or "unstable", or a number starting with 7.0, you're already current enough and the command above should do.
If it is a number starting with 6.0, consider upgrading your system, as this is now an old release. If that's not an option, continue on:
apt-get -t squeeze-backports install mplayer

Old codec (RealVideo) support

The "official" Debian mplayer packages are now (as of 2012) much better than they used to be, and so you probably don't need to load third-party repositories any longer. However, if you need to decode old RealVideo or QuickTime files, you might need them for the binary-only decoders. In that case only:

apt-get update && apt-get install mplayer deb-multimedia-keyring

apt-get will warn you about unsigned packages the first time you run this; allow them. Installing the keyring package will eliminate those warnings for future upgrades.

For RealVideo support, then install the packages w32codecs (32-bit OS) or w64codecs (64-bit OS).

Ubuntu

To be sure that you can play video files encoded using certain proprietary codecs, it may be useful to install w32codecs (32-bit) or w64codecs (64-bit) from the package manager. Not all users will require this, but many find it useful all the same. This package is one of those installed as part of ubuntu-restricted-extras. A full list of the codecs which require this package is available here.

Since mplayer is a command-line application, it might be useful to install a GUI front-end like gnome-mplayer like so:

sudo apt-get install gnome-mplayer

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, although these are often not needed except for Real or Quicktime videos. 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

GPU Acceleration

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 the VDPAU video output (–vo vdpau). Type "mplayer –vo help" to list available outputs.

Note that this generally offers no advantage (yet) for Hi10p encodes, which are not hardware supported. With modern desktop CPUs — roughly 2011 or newer — GPU decoding may actually be slower for some files. If you encounter stuttering with one setting, try it the other way: "–vo xv" for CPU decoding, "–vo vdpau" for GPU decoding.

  • Debian, Ubuntu users: Install the drivers with apt-get install nvidia-glx nvidia-kernel-dkms

ATI

The open-source video driver now supports AMD's UVD hardware-decoding functionality via VDPAU (with linux 3.11 and later).

The proprietary video driver provides hardware accelerated video decoding (and indeed, only works at all) for R600+ based GPUs.

  • Debian users: Install the drivers with apt-get install fglrx-glx fglrx-modules-dkms
  • Ubuntu users: apt-get install fglrx
  • Other distributions usually package the driver as either fglrx or catalyst

Note: The above packages are only valid for HD5000 chipsets and over, HD2000-4000 users should check their distribution's documentation for how to install the legacy variant.

Exposing the video decoding capabilities over VA-API (e.g. for use with VLC, mplayer or xine) requires the additional package xvba-video. XBMC (only) can natively use AMD's XvBA (the Linux DXVA equivalent) built-into the proprietary driver. Neither MPlayer nor MPlayer2 support VA-API in their standard releases, but there is an MPlayer branch mplayer-vaapi with VA-API capability.

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 you have a multicore CPU, use as many threads as you have cores.
lavdopts=threads=4
# Use the GPU accelerated video output driver if available.  If not, fall back
# to xv (which offers good speed on most cards) as a safe backup.
# For audio output, always use ALSA.
# Sometimes "vo=xv,vdpau," gives better results!  Test on your own system.
vo=vdpau,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 to 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.

MPlayer2

A fork of the original MPlayer project. Although it was the first *nix player to add 10bit support, MPlayer added it later as well; for playback purposes, there is not currently a strong reason to use one over the other besides personal preference.

Installation

The following installation works for Debian 7 Wheezy stable, and should work for any newer Debian (testing/unstable/future stable releases). It might work for Ubuntu, but I have not tested this. It will not work for a distribution that does not use DEBs.

sudo apt-get update && sudo apt-get install mplayer2