MPlayer Player

From LinuxMCE
Jump to: navigation, search








Basics

LMCE use two different media players. MPlayer and Xine. Even though both players do much the same they work very different.


To control mplayer with a DCE device one have to start mplayer in slave mode. This approach have a disadvantage, mplayer will run in it´s own thread making it more difficult to control. Xine on the other hand is a library that is completely integrated in to Xine_Player. To make it easier we use libplayer, gpl library that abstract the control part in to a simple api. Libplayer is written in C and have a single simple api to control backendend players. Atm libplayer support 4 different backend players. GStreamer, MPlayer, Xine and vlc. To use libplayer you the only thing one have to take care of is to create a X11 Window and fetch it´s window id then pass that into libplayer. When that is done you create a player and specify which of the 4 backend player types it shall be. It´s possible to use different backend players to playback different media types. For example m2ts can use mplayer and avi use xine. Libplayer have internal logic to make all it possible to use the same X11 window for all 4 backend players.


All communication between LMCE and MPlayer_Player is done through DCERouter.


Features

  • Uses mplayer through slave mode.
  • Support VDPAU with fallback to XV (obeys HW Accel setting done in lmceadmin)
  • libplayer to abstract mplayer mplayer communication and internals.
  • Support playback of almost any video file you can find.
  • Play
  • Pause
  • Fast Forward (jump +15s for each keypress). Not implemented.
  • Rewind (jump -15s for each keypress). Not implemented.

File types directed to MPlayer

MPlayer can theoretically play all the files that Xine can play. In LinuxMCE, MPlayer gets to play video files with the extension .EVO and .M2TS, as well as files marked HD-DVD or BluRay.

TODO

  • Status feedback back to lmce. libplayers eventhandler can be used here this way we get correct status back to lmce.
  • Bookmark. Need Screenshot.
  • Implement Screenshot functionality. Not sure if this can be done when using vdpau.
  • OSD (A simple OSD can be implemented to show what is going on. Like play, pause inforamtion.
  • Push mediafile metadata back to lmce. Like codec used, playback length etc.
  • Make use of deInterlace settings in lmceadmin. MPlayer_Player already know which setting is set but do not take advantage of it.
  • Better use of SmartPlaylists(). As in automatically identify if a media consist of several files.
  • Implement simulated FF/Rew since MPlayer do not support speed change for backward playback.
  • Research how the rest of libplayers supported backends perform (libplayer support Xine, VLC, MPlayer and GStreamer)


Architecture

MPlayer Player Schematic.jpg


MPlayer Specifics

DeInterlace options

One can enable deinterlacing in MPlayer when it is started from command line like this. Example use vdpau as video decoder. For best result use latest nVidia Linux driver.


mplayer -fs -vo vdpau:deint=x -vc ffh264vdpau -ao alsa:device=hw=0.3 filename


where x = 0..4

0: Weave no de-interlace

1: Bob 1x, each frame has 1 field selected and displayed. The field is stretched; doubled in resolution vertically. Thus, half the image resolution is lost

2: Bob 2x, each field of each frame has bob applied and displayed. The displayed frame is 1/2 the resolution of the source frame. However, all fields are displayed, so the eye effectively sees pretty much all the resolution.

3: Temporal, VDPAU "real" de-interlacing algorithm

4: Temporal spatial, a better quality vdpau "real" de-interlacing algorithm

deint=3..4 do not work good on ION based hardware. Unfortunately.

Don´t know about ION2. I have heard it should support better hardware accelerated deinterlacing. Still need to test.