Mplayer

Mplayer with no dependencies (~4.3MB) is a powerful, flexible and relatively compact media player capable of handling both video and music files. The information on mplayer is taken from the following web site:

Tutorial: Playing around with MPlayer

rechosen 07 February, 2007 19:15

This tutorial handles about the usage of the wonderful media player MPlayer. It explains several options, lists some useful keyboard shortcuts and handles about tips and tricks that can be used to enhance your multimedia experience.

Difficulty: Basic

Note: this tutorial assumes that you have MPlayer installed & working and that you have some basic shell knowledge.

Playing a file

The most simple way of invoking MPlayer to play a media file is this:

rechosen@localhost ~]$ mplayer filename

MPlayer will try to auto-detect what kind of file you're trying to play (it usually succeeds) and play it. If it's an audio file, it'll just start playing and show its status and possible warnings on the command-line. If it's a video file, it'll open a window to play it in and then start playing.

Seeking through a file

You can seek through a file with a set of 3 keyboard shortcut pairs. Each pair makes MPlayer seek a different amount of time, and the pair consists of a key for seeking backward and a one for seeking forward. Listed below are those key pairs, for seeking backward and forward respectively: Left arrow and Right arrow (10 seconds) Down arrow and Up arrow (1 minute) Page down and Page up (10 minutes)

Knowing these will come in handy a lot of times.

Playing a DVD

MPlayer does not have DVD menu support (sadly), but it does support playing DVD's. You can play a DVD this way:

mplayer dvd://<titlenumber>

Replace <titlenumber> with a number, like 1, 2 or 3. I personally prefer xine for DVD playback, as xine does support DVD menus.

Playing with subtitles

You can play a movie with subtitles in multiple ways. When playing a movie file, you can specify a subtitle file this way:

rechosen@localhost ~]$ mplayer -sub <somesubtitlefile> <somefile>

When playing a DVD movie, you can also use the DVD's subtitle by specifying a language code like this:

rechosen@localhost ~]$ mplayer dvd://<titlenumber> -slang nl,en

The above command would try to use dutch subtitles first, and fall back on english ones if dutch subtitles weren't available.

Useful keyboard shortcuts

A list of useful keyboard shortcuts (sometimes called hotkeys) in MPlayer:

(note that the full list can be found in MPlayer's man page)

* These do not always work; see the MPlayer man page.

Generating an index

Sometimes, video files (mainly AVI files) have a corrupted index, or no index at all. This frequently is the case with incorrectly or incompletely downloaded files. Fortunately, MPlayer can generate the index it needs to play the file correctly. By using the -idx option, you can tell MPlayer to generate an index when necessary:

rechosen@localhost ~]$ mplayer -idx <somefile>

Sometimes the file does contain an index, but a corrupted one. In those cases, you might need to force MPlayer to generate an index:

rechosen@localhost ~]$ mplayer -forceidx <somefile>

Generating an index can take some time, depending on the size of the video file, but after that, the file should play correctly.

Correcting bad audio/video sync Some videos (mainly flv files) are encoded in a horrible way, and MPlayer will have enormous trouble with the A/V (Audio/Video) sync. There are pretty much two possibilities in this case: MPlayer is trying to fix it but the sync is worsening too fast MPlayer is trying to fix something that's already right and therefore pushes the sync away unnecessarily

In the first case, you should allow MPlayer to try harder to fix the sync:

rechosen@localhost ~]$ mplayer -autosync 30 -mc 2.0 <somefile>

In the second case, you shouldn't allow MPlayer to fix anything when it comes to the sync:

rechosen@localhost ~]$ mplayer -autosync 0 -mc 0 <somefile>

You might wonder what those options mean. Well, setting autosync to a positive value allows MPlayer to gradually adapt its A/V correction algorithm. The higher the value, the faster MPlayer will try to correct it. The mc option specifies how many seconds MPlayer may correct every frame. Setting it to a high value (like 2.0) practically allows MPlayer to do whatever it thinks it should to correct the A/V sync. Setting it to 0 stops MPlayer from trying anything when it comes to syncing.

Using MPlayer on slow systems

As video playback is a CPU-intensive task, older and slower systems may have a hard time to play certain video files. MPlayer has a feature that will help them to keep up the playback with less CPU power: -framedrop. This will allow MPlayer not to render a frame here and there if the CPU can't handle it. On systems that are far too slow, it won't be a pleasure to “watch” the movie (the majority of the frames will just not be rendered at all), but on systems that are a bit faster, this will stop the playback from having hiccups here and there. You can use the -framedrop option like this: rechosen@localhost ~]$ mplayer -framedrop <somefile>

Playing Youtube or Other Flash Videos Using Mplayer-nodeps.tcz

Most of us use our computers occasionally to play youtube videos or other flash content, but if the internet connection is not fast enough those videos can pause and stutter annoyingly. Here is one way to get around that problem. Mplayer (without dependencies) allows this in the most efficient way possible.

Configuration and optimization

There are two ways how you can configure mplayer: by editing config file or command line.

Configure file is created when you run mplayer for the fist time in /home/tc/.mplayer/config

commandline config description
-zoom zoom=1 enable fullscreen zoom or resizeing
-monitoraspect 16:9 monitoraspect=16:9 for widescreen
-af pan=2:1:1:1:1 if you want downmix stereo into mono
-framedrop framedrop=1 frame dropping (for slow machines)
-hardframedrop hardframedrop=1 heavy frame dropping (for slow machines)
-lavdopts skipframe=nonref:skiploopfilter=all:fast=1 lavdopts=skipframe=nonref:skiploopfilter=all:fast=1 increase processing speed twice (for slow machines)
-softvol softvol-max 800 softvol=yes softvol-max=800 if you want to volume up over the limit
-af scaletempo - scale audio tempo while maintaining pitch
-sws 4 sws=4 upscaling (nearest neighbour) for slow machines
-novideo novideo=1 turn off of video processing (for slow machines)
-nosound nosound=1 turn off audio processing (for slow machines)

For more parameters go to: https://ubuntuforums.org/archive/index.php/t-77329.html

https://github.com/larsmagne/mplayer/blob/master/etc/example.conf