API Reference - Seg-mel/mplayer_control GitHub Wiki



##Classes

mplayer_control.Player([mplayer][, pipe][, stdout][, pid][, debug])

Parameters:

  • mplayer (string) - path to MPlayer. By default in Unix 'mplayer', in Windows '/mplayer/mplayer.exe'
  • pipe (string) - path to fifo file (only Unix). By default '<temp directory>/mplayer.pipe'
  • stdout (string) - path to stdout file. By default '<temp directory>/mplayer.stdout'
  • pid (string) - path to pid file. By default '<temp directory>/mplayer.pid'
  • debug (bool) - write/doesn't write debug messages. By default False

Properties:

  • process

    The MPlayer process (class object). For more detailed manual check out the documentation of psutil.Process(pid)

    Example:

from mplayer_control import Player player = Player() player.create_new_process() player.process.name 'mplayer' player.process.pid 11056


* __properties__

  MPlayer properties (class object).<br />
  This class is an abstraction for all MPlayer properties. <br />
  It sets and gets the corresponding properties using MPlayer commands 
  get_property and set_property.<br />
  Example of a raw MPlayer command: get_property volume

  Example:
    ``` Python
>>>from mplayer_control import Player
>>>player = Player()
>>>player.create_new_process()
>>>player.loadfile('/home/user/music/sound.ogg')
>>>print player.properties.volume
100
>>>print player.properties.channels
2
>>>print player.properties.length
35
>>>print player.properties.percent_pos
1
Properties list:
* __angle__<br />
   select angle<br />
   type:   int<br />
   min:    0<br />

* __aspect__<br />
   type:   float<br />
   (read-only property)<br />

* __audio_bitrate__<br />
   type:   int<br />
   (read-only property)<br />

* __audio_codec__<br />
   type:   str<br />
   (read-only property)<br />

* __audio_delay__<br />
   type:   float<br />
   min:    -100<br />
   max:    100<br />

* __audio_format__<br />
   type:   int<br />
   (read-only property)<br />

* __balance__<br />
   change audio balance<br />
   type:   float<br />
   min:    -1<br />
   max:    1<br />

* __border__<br />
   type:   flag<br />
   min:    0<br />
   max:    1<br />

* __brightness__<br />
   type:   int<br />
   min:    -100<br />
   max:    100<br />

* __capturing__<br />
   dump primary stream if enabled<br />
   type:   flag<br />
   min:    0<br />
   max:    1<br />

* __channels__<br />
   type:   int<br />
   (read-only property)<br />

* __chapter__<br />
   select chapter<br />
   type:   int<br />
   min:    0<br />

* __chapters__<br />
   number of chapters<br />
   type:   int<br />
   (read-only property)<br />

* __contrast__<br />
   type:   int<br />
   min:    -100<br />
   max:    100<br />

* __deinterlace__<br />
   type:   flag<br />
   min:    0<br />
   max:    1<br />

* __demuxer__<br />
   demuxer used<br />
   type:   str<br />
   (read-only property)<br />

* __filename__<br />
   file playing wo path<br />
   type:   str<br />
   (read-only property)<br />

* __fps__<br />
   type:   float<br />
   (read-only property)<br />

* __framedropping__<br />
   1 = soft, 2 = hard<br />
   type:   int<br />
   min:    0<br />
   max:    2<br />

* __fullscreen__<br />
   type:   flag<br />
   min:    0<br />
   max:    1<br />

* __gamma__<br />
   type:   int<br />
   min:    -100<br />
   max:    100<br />

* __height__<br />
   "display" height<br />
   type:   int<br />
   (read-only property)<br />

* __hue__<br />
   type:   int<br />
   min:    -100<br />
   max:    100<br />

* __length__<br />
   length of file in seconds<br />
   type:   float<br />
   (read-only property)<br />

* __loop__<br />
   as -loop<br />
   type:   int<br />
   min:    -1<br />

* __metadata__<br />
   list of metadata key/value<br />
   type:   str<br />
   (read-only property)<br />

* __metadata/*__<br />
   metadata values<br />
   type:   str<br />
   (read-only property)<br />

* __mute__<br />
   type:   flag<br />
   min:    0<br />
   max:    1<br />

* __ontop__<br />
   type:   flag<br />
   min:    0<br />
   max:    1<br />

* __osdlevel__<br />
   as -osdlevel<br />
   type:   int<br />
   min:    0<br />
   max:    3<br />

* __panscan__<br />
   type:   float<br />
   min:    0<br />
   max:    1<br />

* __path__<br />
   file playing<br />
   type:   str<br />
   (read-only property)<br />

* __pause__<br />
   1 if paused<br />
   type:   flag<br />
   min:    0<br />
   max:    1<br />
   (read-only property)<br />

* __percent_pos__<br />
   position in percent<br />
   type:   int<br />
   min:    0<br />
   max:    100<br />

* __rootwin__<br />
   type:   flag<br />
   min:    0<br />
   max:    1<br />

* __samplerate__<br />
   type:   int<br />
   (read-only property)<br />

* __saturation__<br />
   type:   int<br />
   min:    -100<br />
   max:    100<br />

* __speed__<br />
   as -speed<br />
   type:   float<br />
   min:    0.01<br />
   max:    100<br />

* __stream_end__<br />
   end pos in stream<br />
   type:   int<br />
   min:    0<br />
   (read-only property)<br />

* __stream_length__<br />
   (end - start)<br />
   type:   int<br />
   min:    0<br />
   (read-only property)<br />

* __stream_pos__<br />
   position in stream<br />
   type:   int<br />
   min:    0<br />

* __stream_start__<br />
   start pos in stream<br />
   type:   int<br />
   min:    0<br />
   (read-only property)<br />

* __stream_time_pos__<br />
   present position in stream (in seconds)<br />
   type:   float<br />
   min:    0<br />
   (read-only property)<br />

* __sub__<br />
   select subtitle stream<br />
   type:   int<br />
   min:    -1<br />

* __sub_alignment__<br />
   subtitle alignment<br />
   type:   int<br />
   min:    0<br />
   max:    2<br />

* __sub_delay__<br />
   type:   float<br />

* __sub_demux__<br />
   select subs from demux<br />
   type:   int<br />
   min:    -1<br />

* __sub_file__<br />
   select file subtitles<br />
   type:   int<br />
   min:    -1<br />

* __sub_forced_only__<br />
   type:   flag<br />
   min:    0<br />
   max:    1<br />

* __sub_pos__<br />
   subtitle position<br />
   type:   int<br />
   min:    0<br />
   max:    100<br />

* __sub_scale__<br />
   subtitles font size<br />
   type:   float<br />
   min:    0<br />
   max:    100<br />

* __sub_source__<br />
   select subtitle source<br />
   type:   int<br />
   min:    -1<br />
   max:    2<br />

* __sub_visibility__<br />
   show/hide subtitles<br />
   type:   flag<br />
   min:    0<br />
   max:    1<br />

* __sub_vob__<br />
   select vobsubs<br />
   type:   int<br />
   min:    -1<br />

* __switch_angle__<br />
   select DVD angle<br />
   type:   int<br />
   min:    -2<br />
   max:    255<br />

* __switch_audio__<br />
   select audio stream<br />
   type:   int<br />
   min:    -2<br />
   max:    255<br />

* __switch_program__<br />
   (see TAB default keybind)<br />
   type:   int<br />
   min:    -1<br />
   max:    65535<br />

* __switch_title__<br />
   select DVD title<br />
   type:   int<br />
   min:    -2<br />
   max:    255<br />

* __switch_video__<br />
   select video stream<br />
   type:   int<br />
   min:    -2<br />
   max:    255<br />

* __teletext_format__<br />
   0 - opaque,<br />
   1 - transparent,<br />
   2 - opaque inverted,<br />
   3 - transp. inv.<br />
   type:   int<br />
   min:    0<br />
   max:    3<br />

* __teletext_half_page__<br />
   0 - off, 1 - top half,<br />
   2- bottom half<br />
   type:   int<br />
   min:    0<br />
   max:    2<br />

* __teletext_mode__<br />
   0 - off, 1 - on<br />
   type:   flag<br />
   min:    0<br />
   max:    1<br />

* __teletext_page__<br />
   type:   int<br />
   min:    0<br />
   max:    799<br />

* __teletext_subpage__<br />
   type:   int<br />
   min:    0<br />
   max:    64<br />

* __time_pos__<br />
   position in seconds<br />
   type:   float<br />
   min:    0<br />

* __tv_brightness__<br />
   type:   int<br />
   min:    -100<br />
   max:    100<br />

* __tv_contrast__<br />
   type:   int<br />
   min:    -100<br />
   max:    100<br />

* __tv_hue__<br />
   type:   int<br />
   min:    -100<br />
   max:    100<br />

* __tv_saturation__<br />
   type:   int<br />
   min:    -100<br />
   max:    100<br />

* __video_bitrate__<br />
   type:   int<br />
   (read-only property)<br />

* __video_codec__<br />
   type:   str<br />
   (read-only property)<br />

* __video_format__<br />
   type:   int<br />
   (read-only property)<br />

* __volume__<br />
   change volume<br />
   type:   float<br />
   min:    0<br />
   max:    100<br />

* __vsync__<br />
   type:   flag<br />
   min:    0<br />
   max:    1<br />

* __width__<br />
   "display" width<br />
   type:   int<br />
   (read-only property)<br />

Methods:

  • af_add(<str>)<br > MPlayer command: af_add String<br > MPlayer doc: af_add <filter_arguments_list> (comma separated list of audio filters with parameters)<br > (experimental) Load the given list of audio filters.<br >

  • af_clr()<br > MPlayer command: af_clr<br > MPlayer doc: af_clr<br > (experimental) Unload all loaded audio filters.<br >

  • af_cmdline(<str>, <str>)<br > MPlayer command: af_cmdline String String<br > MPlayer doc: af_cmdline <filter_name> <filter_arguments><br > (experimental) Send new command-line options to a filter with the given name.<br >

  • af_del(<str>)<br > MPlayer command: af_del String<br > MPlayer doc: af_del <filter_name_list> (comma separated list of audio filter's names)<br > (experimental) Unload the first occurrence of the filters, if loaded.<br >

  • af_switch(<str>)<br > MPlayer command: af_switch String<br > MPlayer doc: af_switch <filter_arguments_list> (comma separated list of audio filters with parameters)<br > (experimental) Remove all the audio filters and replace them with the given list.<br >

  • alt_src_step(<int>)<br > MPlayer command: alt_src_step Integer<br > MPlayer doc: alt_src_step <value> (ASX playlist only)<br > When more than one source is available it selects the next/previous one.<br >

  • ass_use_margins([<int>])<br > MPlayer command: ass_use_margins [Integer]<br >

  • audio_delay(<float>[, <int>])<br > MPlayer command: audio_delay Float [Integer]<br > MPlayer doc: audio_delay <value> [abs]<br > Set/adjust the audio delay.<br > If [abs] is not given or is zero, adjust the delay by <value> seconds.<br > If [abs] is nonzero, set the delay to <value> seconds.<br >

  • balance(<float>[, <int>])<br > MPlayer command: balance Float [Integer]<br >

  • brightness(<int>[, <int>])<br > MPlayer command: brightness Integer [Integer]<br > MPlayer doc: brightness <value> [abs]<br > Set/adjust video parameter.<br > If [abs] is not given or is zero, modifies parameter by <value>.<br > If [abs] is non-zero, parameter is set to <value>.<br > <value> is in the range [-100, 100].<br >

  • capturing()<br > MPlayer command: capturing<br > MPlayer doc: capturing [value]<br > Toggle/set capturing the primary stream like -dumpstream.<br > Requires the -capture parameter to be given.<br >

  • change_rectangle(<int>, <int>)<br > MPlayer command: change_rectangle Integer Integer<br > MPlayer doc: change_rectangle <val1> <val2><br > Change the position of the rectangle filter rectangle.<br >         <val1><br >                 Must be one of the following:<br >                         0 = width<br >                         1 = height<br >                         2 = x position<br >                         3 = y position<br >         <val2><br >                 If <val1> is 0 or 1:<br >                         Integer amount to add/subtract from the width/height.<br >                         Positive values add to width/height and negative values<br >                         subtract from it.<br >                 If <val1> is 2 or 3:<br >                         Relative integer amount by which to move the upper left<br >                         rectangle corner. Positive values move the rectangle<br >                         right/down and negative values move the rectangle left/up.<br >

  • contrast(<int>[, <int>])<br > MPlayer command: contrast Integer [Integer]<br > MPlayer doc: contrast <value> [abs]<br > Set/adjust video parameter.<br > If [abs] is not given or is zero, modifies parameter by <value>.<br > If [abs] is non-zero, parameter is set to <value>.<br > <value> is in the range [-100, 100].<br >

  • dvb_set_channel(<int>, <int>)<br > MPlayer command: dvb_set_channel Integer Integer<br > MPlayer doc: dvb_set_channel <channel_number> <card_number><br > Set DVB channel.<br >

  • dvdnav(<str>)<br > MPlayer command: dvdnav String<br > MPlayer doc: dvdnav <button_name><br > Press the given dvdnav button.<br >         up<br >         down<br >         left<br >         right<br >         menu<br >         select<br >         prev<br >         mouse<br >

  • edl_mark()<br > MPlayer command: edl_mark<br > MPlayer doc: edl_mark<br > Write the current position into the EDL file.<br >

  • forced_subs_only([<int>])<br > MPlayer command: forced_subs_only [Integer]<br > MPlayer doc: forced_subs_only [value]<br > Toggle/set forced subtitles only.<br >

  • frame_drop([<int>])<br > MPlayer command: frame_drop [Integer]<br > MPlayer doc: frame_drop [value]<br > Toggle/set frame dropping mode.<br >

  • frame_step()<br > MPlayer command: frame_step<br > MPlayer doc: frame_step<br > Play one frame, then pause again.<br >

  • gamma(<int>[, <int>])<br > MPlayer command: gamma Integer [Integer]<br > MPlayer doc: gamma <value> [abs]<br > Set/adjust video parameter.<br > If [abs] is not given or is zero, modifies parameter by <value>.<br > If [abs] is non-zero, parameter is set to <value>.<br > <value> is in the range [-100, 100].<br >

  • get_audio_bitrate()<br > MPlayer command: get_audio_bitrate<br > MPlayer doc: get_audio_bitrate<br > Print out the audio bitrate of the current file.<br >

  • get_audio_codec()<br > MPlayer command: get_audio_codec<br > MPlayer doc: get_audio_codec<br > Print out the audio codec name of the current file.<br >

  • get_audio_samples()<br > MPlayer command: get_audio_samples<br > MPlayer doc: get_audio_samples<br > Print out the audio frequency and number of channels of the current file.<br >

  • get_file_name()<br > MPlayer command: get_file_name<br > MPlayer doc: get_file_name<br > Print out the name of the current file.<br >

  • get_meta_album()<br > MPlayer command: get_meta_album<br > MPlayer doc: get_meta_album<br > Print out the 'Album' metadata of the current file.<br >

  • get_meta_artist()<br > MPlayer command: get_meta_artist<br > MPlayer doc: get_meta_artist<br > Print out the 'Artist' metadata of the current file.<br >

  • get_meta_comment()<br > MPlayer command: get_meta_comment<br > MPlayer doc: get_meta_comment<br > Print out the 'Comment' metadata of the current file.<br >

  • get_meta_genre()<br > MPlayer command: get_meta_genre<br > MPlayer doc: get_meta_genre<br > Print out the 'Genre' metadata of the current file.<br >

  • get_meta_title()<br > MPlayer command: get_meta_title<br > MPlayer doc: get_meta_title<br > Print out the 'Title' metadata of the current file.<br >

  • get_meta_track()<br > MPlayer command: get_meta_track<br > MPlayer doc: get_meta_track<br > Print out the 'Track Number' metadata of the current file.<br >

  • get_meta_year()<br > MPlayer command: get_meta_year<br > MPlayer doc: get_meta_year<br > Print out the 'Year' metadata of the current file.<br >

  • get_percent_pos()<br > MPlayer command: get_percent_pos<br > MPlayer doc: get_percent_pos<br > Print out the current position in the file, as integer percentage [0-100).<br >

  • get_sub_visibility()<br > MPlayer command: get_sub_visibility<br > MPlayer doc: get_sub_visibility<br > Print out subtitle visibility (1 == on, 0 == off).<br >

  • get_time_length()<br > MPlayer command: get_time_length<br > MPlayer doc: get_time_length<br > Print out the length of the current file in seconds.<br >

  • get_time_pos()<br > MPlayer command: get_time_pos<br > MPlayer doc: get_time_pos<br > Print out the current position in the file in seconds, as float.<br >

  • get_video_bitrate()<br > MPlayer command: get_video_bitrate<br > MPlayer doc: get_video_bitrate<br > Print out the video bitrate of the current file.<br >

  • get_video_codec()<br > MPlayer command: get_video_codec<br > MPlayer doc: get_video_codec<br > Print out the video codec name of the current file.<br >

  • get_video_resolution()<br > MPlayer command: get_video_resolution<br > MPlayer doc: get_video_resolution<br > Print out the video resolution of the current file.<br >

  • get_vo_fullscreen()<br > MPlayer command: get_vo_fullscreen<br > MPlayer doc: get_vo_fullscreen<br > Print out fullscreen status (1 == fullscreened, 0 == windowed).<br >

  • hue(<int>[, <int>])<br > MPlayer command: hue Integer [Integer]<br > MPlayer doc: hue <value> [abs]<br > Set/adjust video parameter.<br > If [abs] is not given or is zero, modifies parameter by <value>.<br > If [abs] is non-zero, parameter is set to <value>.<br > <value> is in the range [-100, 100].<br >

  • key_down_event(<int>)<br > MPlayer command: key_down_event Integer<br > MPlayer doc: key_down_event <value><br > Inject <value> key code event into MPlayer.<br >

  • loadfile(<str>[, <int>])<br > MPlayer command: loadfile String [Integer]<br > MPlayer doc: loadfile <file|url> <append><br > Load the given file/URL, stopping playback of the current file/URL.<br > If <append> is nonzero playback continues and the file/URL is<br > appended to the current playlist instead.<br >

  • loadlist(<str>[, <int>])<br > MPlayer command: loadlist String [Integer]<br > MPlayer doc: loadlist <file> <append><br > Load the given playlist file, stopping playback of the current file.<br > If <append> is nonzero playback continues and the playlist file is<br > appended to the current playlist instead.<br >

  • loop(<int>[, <int>])<br > MPlayer command: loop Integer [Integer]<br > MPlayer doc: loop <value> [abs]<br > Adjust/set how many times the movie should be looped. -1 means no loop,<br > and 0 forever.<br >

  • mute([<int>])<br > MPlayer command: mute [Integer]<br > MPlayer doc: mute [value]<br > Toggle sound output muting or set it to [value] when [value] >= 0<br > (1 == on, 0 == off).<br >

  • osd([<int>])<br > MPlayer command: osd [Integer]<br > MPlayer doc: osd [level]<br > Toggle OSD mode or set it to [level] when [level] >= 0.<br >

  • osd_show_progression()<br > MPlayer command: osd_show_progression<br > MPlayer doc: osd_show_progression<br > Show the progression bar, the elapsed time and the total duration of the<br > movie on the OSD.<br >

  • osd_show_property_te(<str>[, <int>][, <int>])<br > MPlayer command: osd_show_property_te String [Integer] [Integer]<br >

  • osd_show_text(<str>[, <int>][, <int>])<br > MPlayer command: osd_show_text String [Integer] [Integer]<br > MPlayer doc: osd_show_text <string> [duration] [level]<br > Show <string> on the OSD.<br >

  • panscan(<float>[, <int>])<br > MPlayer command: panscan Float [Integer]<br > MPlayer doc: panscan <-1.0 - 1.0> | <0.0 - 1.0> <abs><br > Increase or decrease the pan-and-scan range by <value>, 1.0 is the maximum.<br > Negative values decrease the pan-and-scan range.<br > If <abs> is != 0, then the pan-and scan range is interpreted as an<br > absolute range.<br >

  • pause()<br > MPlayer command: pause<br > MPlayer doc: pause<br > Pause/unpause the playback.<br >

  • pt_step(<int>[, <int>])<br > MPlayer command: pt_step Integer [Integer]<br > MPlayer doc: pt_step <value> [force]<br > Go to the next/previous entry in the playtree. The sign of <value> tells<br > the direction. If no entry is available in the given direction it will do<br > nothing unless [force] is non-zero.<br >

  • pt_up_step(<int>[, <int>])<br > MPlayer command: pt_up_step Integer [Integer]<br > MPlayer doc: pt_up_step <value> [force]<br > Similar to pt_step but jumps to the next/previous entry in the parent list.<br > Useful to break out of the inner loop in the playtree.<br >

  • quit([<int>])<br > MPlayer command: quit [Integer]<br > MPlayer doc: quit [value]<br > Quit MPlayer. The optional integer [value] is used as the return code<br > for the mplayer process (default: 0).<br >

  • run(<str>)<br > MPlayer command: run String<br > MPlayer doc: run <string><br > Run <string> with properties expanded as shell command. In OSD menu<br > console mode stdout and stdin are through the video output driver.<br > Property expansion happens in the same way as for osd_show_property_text.<br > Note: MPlayer will do property expansion on anything of the form<br > ${somevar} before it is passed to the shell.<br > This means that you cannot use this syntax for anything you actually<br > want the shell to handle, though any other form like $somevar will<br > be passed on to and processed by the shell.<br >

  • saturation(<int>[, <int>])<br > MPlayer command: saturation Integer [Integer]<br > MPlayer doc: saturation <value> [abs]<br > Set/adjust video parameter.<br > If [abs] is not given or is zero, modifies parameter by <value>.<br > If [abs] is non-zero, parameter is set to <value>.<br > <value> is in the range [-100, 100].<br >

  • screenshot([<int>][, <int>])<br > MPlayer command: screenshot [Integer] [Integer]<br > MPlayer doc: screenshot <value><br > Take a screenshot. Requires the screenshot filter to be loaded.<br >         0 Take a single screenshot.<br >         1 Start/stop taking screenshot of each frame.<br >

  • seek(<float>[, <int>][, <int>])<br > MPlayer command: seek Float [Integer] [Integer]<br > MPlayer doc: seek <value> [type]<br > Seek to some place in the movie.<br >         0 is a relative seek of +/- <value> seconds (default).<br >         1 is a seek to <value> % in the movie.<br >         2 is a seek to an absolute position of <value> seconds.<br >

  • seek_chapter(<int>[, <int>])<br > MPlayer command: seek_chapter Integer [Integer]<br > MPlayer doc: seek_chapter <value> [type]<br > Seek to the start of a chapter.<br >         0 is a relative seek of +/- <value> chapters (default).<br >         1 is a seek to chapter <value>.<br >

  • set_mouse_pos(<int>, <int>)<br > MPlayer command: set_mouse_pos Integer Integer<br > MPlayer doc: set_mouse_pos <x> <y><br > Tells MPlayer the coordinates of the mouse in the window.<br > This command doesn't move the mouse!<br >

  • set_property_osd(<str>, <str>)<br > MPlayer command: set_property_osd String String<br >

  • speed_incr(<float>)<br > MPlayer command: speed_incr Float<br > MPlayer doc: speed_incr <value><br > Add <value> to the current playback speed.<br >

  • speed_mult(<float>)<br > MPlayer command: speed_mult Float<br > MPlayer doc: speed_mult <value><br > Multiply the current speed by <value>.<br >

  • speed_set(<float>)<br > MPlayer command: speed_set Float<br > MPlayer doc: speed_set <value><br > Set the speed to <value>.<br >

  • step_property(<str>[, <float>][, <int>])<br > MPlayer command: step_property String [Float] [Integer]<br > MPlayer doc: step_property <property> [value] [direction]<br > Change a property by value, or increase by a default if value is<br > not given or zero. The direction is reversed if direction is less<br > than zero.<br >

  • step_property_osd(<str>[, <float>][, <int>])<br > MPlayer command: step_property_osd String [Float] [Integer]<br >

  • stop()<br > MPlayer command: stop<br > MPlayer doc: stop<br > Stop playback.<br >

  • sub_alignment([<int>])<br > MPlayer command: sub_alignment [Integer]<br > MPlayer doc: sub_alignment [value]<br > Toggle/set subtitle alignment.<br >         0 top alignment<br >         1 center alignment<br >         2 bottom alignment<br >

  • sub_delay(<float>[, <int>])<br > MPlayer command: sub_delay Float [Integer]<br > MPlayer doc: sub_delay <value> [abs]<br > Adjust the subtitle delay by +/- <value> seconds or set it to <value><br > seconds when [abs] is nonzero.<br >

  • sub_demux([<int>])<br > MPlayer command: sub_demux [Integer]<br > MPlayer doc: sub_demux [value]<br > Display subtitle specified by [value] for subtitles from DVD or embedded<br > in media file. The [value] is corresponding to ID_SUBTITLE_ID values<br > reported by '-identify'. If [value] is -1, will turn off subtitle display.<br > If [value] is omitted or less than -1, will cycle all DVD subs or embedded subs<br > (forward or backward respectively).<br >

  • sub_file([<int>])<br > MPlayer command: sub_file [Integer]<br > MPlayer doc: sub_file [value]<br > Display subtitle specified by [value] for file subs. The [value] is<br > corresponding to ID_FILE_SUB_ID values reported by '-identify'.<br > If [value] is -1, will turn off subtitle display.<br > If [value] is omitted or less than -1, will cycle all file subs<br > (forward or backward respectively).<br >

  • sub_load(<str>)<br > MPlayer command: sub_load String<br > MPlayer doc: sub_load <subtitle_file><br > Loads subtitles from <subtitle_file>.<br >

  • sub_log()<br > MPlayer command: sub_log<br > MPlayer doc: sub_log<br > Logs the current or last displayed subtitle together with filename<br > and time information to ~/.mplayer/subtitle_log. Intended purpose<br > is to allow convenient marking of bogus subtitles which need to be<br > fixed while watching the movie.<br >

  • sub_pos(<int>[, <int>])<br > MPlayer command: sub_pos Integer [Integer]<br > MPlayer doc: sub_pos <value> [abs]<br > Adjust/set subtitle position.<br >

  • sub_remove([<int>])<br > MPlayer command: sub_remove [Integer]<br > MPlayer doc: sub_remove [value]<br > If the [value] argument is present and non-negative, removes the subtitle<br > file with index [value]. If the argument is omitted or negative, removes<br > all subtitle files.<br >

  • sub_scale(<float>[, <int>])<br > MPlayer command: sub_scale Float [Integer]<br > MPlayer doc: sub_scale <value> [abs]<br > Adjust the subtitle size by +/- <value> or set it to <value> when [abs]<br > is nonzero.<br >

  • sub_select([<int>])<br > MPlayer command: sub_select [Integer]<br > MPlayer doc: sub_select [value]<br > Display subtitle with index [value]. Turn subtitle display off if<br > [value] is -1 or greater than the highest available subtitle index.<br > Cycle through the available subtitles if [value] is omitted or less<br > than -1 (forward or backward respectively).<br > Supported subtitle sources are -sub options on the command<br > line, VOBsubs, DVD subtitles, and Ogg and Matroska text streams.<br > This command is mainly for cycling all subtitles, if you want to set<br > a specific subtitle, use sub_file, sub_vob, or sub_demux.<br >

  • sub_source([<int>])<br > MPlayer command: sub_source [Integer]<br > MPlayer doc: sub_source [source]<br > Display first subtitle from [source]. Here [source] is an integer:<br > SUB_SOURCE_SUBS (0) for file subs<br > SUB_SOURCE_VOBSUB (1) for VOBsub files<br > SUB_SOURCE_DEMUX (2) for subtitle embedded in the media file or DVD subs.<br > If [source] is -1, will turn off subtitle display.<br > If [value] is omitted or less than -1, will cycle between the first subtitle<br > of each currently available source (forward or backward respectively).<br >

  • sub_step(<int>[, <int>])<br > MPlayer command: sub_step Integer [Integer]<br > MPlayer doc: sub_step <value><br > Step forward in the subtitle list by <value> steps or backwards if <value><br > is negative.<br >

  • sub_visibility([<int>])<br > MPlayer command: sub_visibility [Integer]<br > MPlayer doc: sub_visibility [value]<br > Toggle/set subtitle visibility.<br >

  • sub_vob([<int>])<br > MPlayer command: sub_vob [Integer]<br > MPlayer doc: sub_vob [value]<br > Display subtitle specified by [value] for VOBsubs. The [value] is<br > corresponding to ID_VOBSUB_ID values reported by '-identify'.<br > If [value] is -1, will turn off subtitle display.<br > If [value] is omitted or less than -1, will cycle all VOBsubs<br > (forward or backward respectively).<br >

  • switch_angle([<int>])<br > MPlayer command: switch_angle [Integer]<br > MPlayer doc: switch_angle [value] (DVDs only)<br > Switch to the DVD angle with the ID [value]. Cycle through the<br > available angles if [value] is omitted or negative.<br >

  • switch_audio([<int>])<br > MPlayer command: switch_audio [Integer]<br > MPlayer doc: switch_audio [value] (currently MPEG*, AVI, Matroska and streams handled by libavformat)<br > Switch to the audio track with the ID [value]. Cycle through the<br > available tracks if [value] is omitted or negative.<br >

  • switch_ratio([<float>])<br > MPlayer command: switch_ratio [Float]<br > MPlayer doc: switch_ratio [value]<br > Change aspect ratio at runtime. [value] is the new aspect ratio expressed<br > as a float (e.g. 1.77778 for 16/9), or special value -1 to reset to<br > original aspect ratio (ditto if [value] is missing), or special value 0<br > to disable automatic movie aspect ratio compensation.<br > There might be problems with some video filters.<br >

  • switch_title([<int>])<br > MPlayer command: switch_title [Integer]<br > MPlayer doc: switch_title [value] (DVDNAV only)<br > Switch to the DVD title with the ID [value]. Cycle through the<br > available titles if [value] is omitted or negative.<br >

  • switch_vsync([<int>])<br > MPlayer command: switch_vsync [Integer]<br > MPlayer doc: switch_vsync [value]<br > Toggle vsync (1 == on, 0 == off). If [value] is not provided,<br > vsync status is inverted.<br >

  • teletext_add_dec(<str>)<br > MPlayer command: teletext_add_dec String<br >

  • teletext_go_link(<int>)<br > MPlayer command: teletext_go_link Integer<br > MPlayer doc: teletext_go_link <1-6><br > Follow given link on current teletext page.<br >

  • tv_last_channel()<br > MPlayer command: tv_last_channel<br > MPlayer doc: tv_last_channel<br > Set the current TV channel to the last one.<br >

  • tv_set_brightness(<int>[, <int>])<br > MPlayer command: tv_set_brightness Integer [Integer]<br > MPlayer doc: tv_set_brightness <-100 - 100> [abs]<br > Set TV tuner brightness or adjust it if [abs] is set to 0.<br >

  • tv_set_channel(<str>)<br > MPlayer command: tv_set_channel String<br > MPlayer doc: tv_set_channel <channel><br > Set the current TV channel.<br >

  • tv_set_contrast(<int>[, <int>])<br > MPlayer command: tv_set_contrast Integer [Integer]<br > MPlayer doc: tv_set_contrast <-100 -100> [abs]<br > Set TV tuner contrast or adjust it if [abs] is set to 0.<br >

  • tv_set_freq(<float>)<br > MPlayer command: tv_set_freq Float<br > MPlayer doc: tv_set_freq <frequency in MHz><br > Set the TV tuner frequency.<br >

  • tv_set_hue(<int>[, <int>])<br > MPlayer command: tv_set_hue Integer [Integer]<br > MPlayer doc: tv_set_hue <-100 - 100> [abs]<br > Set TV tuner hue or adjust it if [abs] is set to 0.<br >

  • tv_set_norm(<str>)<br > MPlayer command: tv_set_norm String<br > MPlayer doc: tv_set_norm <norm><br > Set the TV tuner norm (PAL, SECAM, NTSC, ...).<br >

  • tv_set_saturation(<int>[, <int>])<br > MPlayer command: tv_set_saturation Integer [Integer]<br > MPlayer doc: tv_set_saturation <-100 - 100> [abs]<br > Set TV tuner saturation or adjust it if [abs] is set to 0.<br >

  • tv_start_scan()<br > MPlayer command: tv_start_scan<br > MPlayer doc: tv_start_scan<br > Start automatic TV channel scanning.<br >

  • tv_step_chanlist()<br > MPlayer command: tv_step_chanlist<br > MPlayer doc: tv_step_chanlist<br > Change channel list.<br >

  • tv_step_channel(<int>)<br > MPlayer command: tv_step_channel Integer<br > MPlayer doc: tv_step_channel <channel><br > Select next/previous TV channel.<br >

  • tv_step_freq(<float>)<br > MPlayer command: tv_step_freq Float<br > MPlayer doc: tv_step_freq <frequency offset in MHz><br > Set the TV tuner frequency relative to current value.<br >

  • tv_step_norm()<br > MPlayer command: tv_step_norm<br > MPlayer doc: tv_step_norm<br > Change TV norm.<br >

  • use_master()<br > MPlayer command: use_master<br > MPlayer doc: use_master<br > Switch volume control between master and PCM.<br >

  • vo_border([<int>])<br > MPlayer command: vo_border [Integer]<br > MPlayer doc: vo_border [value]<br > Toggle/set borderless display.<br >

  • vo_fullscreen([<int>])<br > MPlayer command: vo_fullscreen [Integer]<br > MPlayer doc: vo_fullscreen [value]<br > Toggle/set fullscreen mode.<br >

  • vo_ontop([<int>])<br > MPlayer command: vo_ontop [Integer]<br > MPlayer doc: vo_ontop [value]<br > Toggle/set stay-on-top.<br >

  • vo_rootwin([<int>])<br > MPlayer command: vo_rootwin [Integer]<br > MPlayer doc: vo_rootwin [value]<br > Toggle/set playback on the root window.<br >

  • vobsub_lang([<int>])<br > MPlayer command: vobsub_lang [Integer]<br > MPlayer doc: vobsub_lang<br > This is a stub linked to sub_select for backwards compatibility.<br >

  • volume(<float>[, <int>])<br > MPlayer command: volume Float [Integer]<br > MPlayer doc: volume <value> [abs]<br > Increase/decrease volume or set it to <value> if [abs] is nonzero.<br >


##Constants

  • MPLAYER_PATH = 'mplayer' (Unix) | 'C:\mplayer\mplayer.exe' (Windows)
  • PIPE_PATH = os.path.join(gettempdir(), 'mplayer.pipe') (Only Unix)
  • STDOUT_PATH = os.path.join(gettempdir(), 'mplayer.stdout')
  • PID_PATH = os.path.join(gettempdir(), 'mplayer.pid')
⚠️ **GitHub.com Fallback** ⚠️