Posts Tagged ‘mplayer’

Which media player to use?

November 2, 2014 1 comment

When I started to use Linux, I played movies with mplayer. Then the development of mplayer seemed to slow down (stopped?) and I switched to VLC. VLC is very easy to use and it plays everything, so I’m very satisfied with this player.

A few days ago I discovered mpv, which is a fork of mplayer2 and MPlayer. It shares some features with the former projects while introducing many more.

It seems that mplayer and mplayer2 are dead, but mpv is developed actively (check it out on github).

I just ran through its feature list and I saw that if you quit with Shift-q (i.e. Q), then mpv will resume from that position next time you start the same movie. Cool.

So next to VLC you can keep mpv too.

black screen with VLC and mplayer

September 5, 2013 Leave a comment


When trying to play a video, I get a black screen. It’s the same with VLC and mplayer.



alias mplayer='mplayer -vo x11'


Go to Tools -> Preferences -> Video. At the Output, choose “X11 video output (XCB)” from the dropdown list. If it doesn’t work, untick the option “Accelerated video output (Overlay)”.

Categories: bash Tags: , ,

mplayer doesn’t quit

June 28, 2013 Leave a comment

When I play a song with mplayer (from the package mplayer2), the song is played but mplayer doesn’t quit, I don’t get the prompt back. This is annoying if I want to play sound effects from a script and tens of mplayer processes are hanging…

Add the “-ao alsa” switch as a temporary solution (tip from here):

mplayer -ao alsa audio.mp3
Categories: bash Tags: ,

Play an interlaced video without those funny lines

March 20, 2012 Leave a comment

I wanted to watch a DVD but it was interlaced, thus it contained lots of disturbing horizontal lines. How to get rid of those lines? Is there a way to filter them out?

Mplayer has an option for that :) Try this:

mplayer -vf pp=lb interlaced_video.iso

This procedure is called deinterlacing.

Tip from here. Image borrowed from here.

VLC can do this too. Available under Video -> Deinterlace. You can also choose the deinterlacing method under Video -> Deinterlace mode.

Play the first 30 seconds of a song with mplayer

June 30, 2011 Leave a comment
mplayer -endpos 00:00:30 song.mp3

I have an alarm script that loads a bunch of MP3s and starts playing them in random order in the morning. However, some songs are very long, some of them are boring, etc. So I prefer playing just the first X seconds of each song.

This tip is from here.

Categories: Uncategorized Tags:

Screenshot and video information with mplayer

May 7, 2011 1 comment

Let our test file be “/tmp/test.wmv“.

Getting video info

mplayer '/tmp/test.wmv' -ao null -vo null -frames 1 -identify

It will produce a long output. You can refine the output:

(mplayer '/tmp/test.wmv' -ao null -vo null -frames 1 -identify | grep ID_) 2>/dev/null

Again, it will produce a long output that I omit. The video length is here (given is sec.):


Another interesting line is the video summary:

(mplayer '/tmp/test.wmv' -ao null -vo null -frames 1 -identify | grep 'VIDEO:') 2>/dev/null

Sample output:

VIDEO:  [WMV3]  320x240  24bpp  1000.000 fps  386.0 kbps (47.1 kbyte/s)

Taking a screenshot at a given time

mplayer '/tmp/test.wmv' -ss '20' -noautosub -frames 1 -ao null -vo png:outdir='/tmp'

Here we take a screenshot from the video at 20 sec. The output file will be /tmp/00000001.png (mplayer gives this name automatically).

Ref.: I found these tricks in this project.

Configure Midnight Commander to open files with custom application

December 8, 2010 7 comments


You use Midnight Commander (mc) for all your file operations. So far it’s not a problem :) However, when you hit Enter on a file, you would like to set what application mc should use for opening the given file.

For instance, you want to open an .avi file with VLC instead of X player, etc.


Steps to follow:

cd ~/.mc
cp /etc/mc/mc.ext .
ln -s mc.ext bindings

That is, copy the global mc.ext to your local .mc directory and put a symbolic link on it called bindings. Now you can start customizing your local mc.ext file.

Don’t forget to restart mc after editing mc.ext!


(1) You want to open all your video files with VLC. You also want to add support for .wmv files.

# add these lines

# modify the include/video section
    #Open=(mplayer %f >/dev/null 2>&1 &)   # for mplayer
    Open=(vlc %f >/dev/null 2>&1 &)   # for VLC

(2) Open .docx files with

# add these lines
    Open=(ooffice %f &)

(Thanks for the mc mailing list for their help).

Categories: ubuntu Tags: , , , ,

My mplayer settings

November 7, 2010 Leave a comment

To customize mplayer, modify the file ~/.mplayer/config. Every time you launch mplayer, settings are read from this file. Reduce command-line arguments and put them in this file.

Here is my config file:

# Write your default config options here!

# Font

fs = "1"
#subfont-text-scale = "3"
subfont-text-scale = "4"
#subfont-text-scale = "5"
subcp = "iso-8859-2"

# audio output: ALSA
# PulseAudio caused a problem in Jaunty 9.04 beta

# video driver

# Find subtitle files (1: load all subs containing movie name)

# Font encoding

# Subtitle file encoding

# Resample the font alphamap (10: bold black outline)

# Font size (2: proportional to movie width)

# Font blur radius (default: 2)

# font outline thickness (default: 2)

For subtitles I use the Comic font. Download it somewhere and specify its absolute path. Videos start in fullscreen (fs). Previously I had some problems with the accents in Hungarian subtitles but with subcp I managed to solve it. The other settings are mainly for the subtitles.

Categories: ubuntu Tags: , ,