MPlayer

From Free Knowledge Base- The DUCK Project: information for everyone
Revision as of 22:55, 27 November 2022 by Admin (Talk | contribs)

Jump to: navigation, search

MPlayer is one of the best media player applications available. Is is almost strictly monolithic, which means that it mainly consists of a single, relatively small executable, that already contains all necessary codecs. It doesn't need Windows codecs, but does have the ability to utilize external codecs for new formats it may not support natively.

MPlayer is available for all major operating systems, including Linux and other Unix-like systems, Microsoft Windows and Mac OS X. Versions for OS/2, Syllable, AmigaOS and MorphOS are also available.

MPlayer is a command line application which has different optional GUI front-ends for each of its supported operating systems. Commonly used GUIs are gMplayer written in GTK+, MPlayer OS X Extended (for Mac OS X) and MPUI-hcb (for Windows). Cross-platform GUIs are also available, like SMPlayer (Windows and Linux).

MPlayer is a movie player for Linux and also works on Windows and other operating systems. It plays most MPEG/VOB, AVI, ASF/WMA/WMV, RM, QT/MOV/MP4, Ogg/OGM, MKV, VIVO, FLI, NuppelVideo, yuv4mpeg, FILM and RoQ files, supported by many native and binary codecs. You can watch VCD, SVCD, DVD, 3ivx, DivX 3/4/5, WMV and H.264. MPlayer has a fully configurable, command-driven control layer which allows you to control MPlayer using keyboard, mouse, joystick or remote control.

video and audio output drivers: X11, Xv, DGA, OpenGL, SVGAlib, fbdev, AAlib, libcaca, DirectFB, Quartz, Mac OS X CoreVideo, GGI, SDL, VESA.

The mplayer family:

  1. mplayer - command line driven video and audio player
  2. mencoder - video encoder and converter
  3. gmplayer - MPlayer with a graphical user interface

mplayer

For Windows users go to the downloads page and look for the link "MPlayer SVN Windows with SMPlayer GUI (recommended)" You can use the SMPlayer frontend or see our front end section below for other examples, including the popular MPUI front end for Windows.

Useful MPlayer Command Line Operations

These commands are to be used from console (MSDOS Prompt or Linux Shell) etc

mplayer filename                                 (open a video or audio file)
mplayer filename -subfile filename.sub            (video file with subtitles)
mplayer -vcd <trackno>                                     (open a vcd track)
mplayer -o vesa -cache 8192 -fs -dvd <trackno>     (play dvd using vesa mode)
mplayer -framedrop                    (fix slow hardware related video skips)

Playing a DVD with MPlayer on Linux

mplayer -dvd <track> [-dvd-device <device>]
mplayer -dvd 1 -dvd-device /dev/hdc

VCD on Linux

mplayer vcd://1 -cdrom-device /dev/hdc

Open Analog TV Tuner or Capture Device

mplayer tv:// -tv driver=v4l2:norm=NTSC:input=0:amode=1:outfmt=yv12:device=/dev/video0

rtsp

although mplayer does rtsp and depending on how it is compiled, it demonstrated poor ability with dropped frames compared to other options.

mplayer rtsp://192.168.0.15:554

obviously depends on encoding, however better results were achieved by alternatively using ffplay like this:

ffplay rtsp://192.168.0.15:554

ffplay uses FFmpeg libraries and the SDL library. On Ubuntu Mplayer has it's own FFmpeg implementation. Depending on your distribution and/or if you build from source your results will differ. You can build mplayer against the ffmpeg you have installed on your system. To do so add --disable-libavcodec_a --disable-libavutil_a --disable-libavformat_a --disable-libpostproc_a and --disable-libswscale_a to the mplayer configure line. To find out how your mplayer is linked type this:

ldd `which mplayer`

mencoder

MEncoder can convert all the formats that MPlayer recognizes into a variety of compressed and uncompressed formats using different codecs. It can decode all media which MPlayer can decode and it supports all filters which MPlayer can use.

Supported filters: cropping, scaling, vertical flipping, horizontal mirroring, expanding to create letterboxes, rotating, brightness/contrast, changing the aspect ratio, colorspace conversion, hue/saturation, color-specific gamma correction, filters for reducing the visibility of compression artifacts caused by MPEG compression (deblocking, deringing), automatic brightness/contrast enhancement (autolevel), sharpness/blur, denoising filters, several ways of deinterlacing, and reversing telecine.

Rip / Encode a DVD

You can use libavcodec to encode the video. Identify the source video.

  • Identify video framerate
  • Identify video frames/fields/pulldown/telecine
  • Encode constant bitrate (CBR), constant quantizer, and multipass
  • Crop black borders or letterboxing
  • select resolution and bitrate

see: http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-dvd-mpeg4.html

Rip from TV or Composite Source (V4L capture)

Using mencoder for this is considered inefficient. It is possible to capture and encode live TV in H.264.

mencoder -tv driver=v4l2:device=/dev/video0$DEV:fps=30000/1001:audiorate=32000:adevice=/dev/dsp$DEV:input=0:amode=1:normid=4:width=512:height=384-ovc x264 -x264encopts threads=2:bitrate=800:subq=2:me=2:frameref=4:8x8dct-oac mp3lame -lameopts cbr:br=96 -endpos $TIM -o $DIR/$FIL.avi tv:// > /dev/null

GUI Frontends

SMPlayer

MPUI

References and External Resources