fix usage info
[HTML5TV.git] / docs / slave.txt
1 SLAVE MODE PROTOCOL
2 -------------------
3
4 The -slave option switches on slave mode, in which MPlayer works as a backend
5 for other programs. Instead of intercepting keyboard events, MPlayer will read
6 commands separated by a newline (\n) from stdin.
7
8 To try slave mode out by hand, run
9
10   mplayer -slave -quiet <movie>
11
12 and type slave commands into the console window.
13
14 You can also use a fifo file (named pipe):
15
16   mkfifo </tmp/fifofile>
17   mplayer -slave -input file=</tmp/fifofile> <movie>
18
19 Most slave mode commands are equivalent to command line options, though not
20 necessarily under the same name. Detailed descriptions can be found in the
21 man page.
22
23 All commands can be prefixed with one of "pausing ", "pausing_keep ", or
24 "pausing_toggle ". "pausing " tells MPlayer to pause as soon as possible
25 after processing the command. "pausing_keep " tells MPlayer to do so only if
26 it was already in paused mode. "pausing_toggle " tells MPlayer to do so
27 only if it was not already in paused mode. Please note that "as soon as
28 possible" can be before the command is fully executed.
29 As a temporary hack, there is also the _experimental_ "pausing_keep_force "
30 prefix, with which MPlayer will not exit the pause loop at all.
31 Like this you can avoid the "frame stepping" effect of "pausing_keep "
32 but most commands will either not work at all or behave in unexpected ways.
33 For "set_mouse_pos" and "key_down_event", "pausing_keep_force" is the default
34 since other values do not make much sense for them.
35
36
37 Available commands ('mplayer -input cmdlist' will print a list):
38
39
40 alt_src_step <value> (ASX playlist only)
41     When more than one source is available it selects the next/previous one.
42
43 audio_delay <value> [abs]
44     Set/adjust the audio delay.
45     If [abs] is not given or is zero, adjust the delay by <value> seconds.
46     If [abs] is nonzero, set the delay to <value> seconds.
47
48 [brightness|contrast|gamma|hue|saturation] <value> [abs]
49     Set/adjust video parameters.
50     If [abs] is not given or is zero, modifies parameter by <value>.
51     If [abs] is non-zero, parameter is set to <value>.
52     <value> is in the range [-100, 100].
53
54 change_rectangle <val1> <val2>
55     Change the position of the rectangle filter rectangle.
56         <val1>
57             Must be one of the following:
58                 0 = width
59                 1 = height
60                 2 = x position
61                 3 = y position
62         <val2>
63             If <val1> is 0 or 1:
64                 Integer amount to add/subtract from the width/height.
65                 Positive values add to width/height and negative values
66                 subtract from it.
67             If <val1> is 2 or 3:
68                 Relative integer amount by which to move the upper left
69                 rectangle corner. Positive values move the rectangle
70                 right/down and negative values move the rectangle left/up.
71
72 dvb_set_channel <channel_number> <card_number>
73     Set DVB channel.
74
75 dvdnav <button_name>
76     Press the given dvdnav button.
77         up
78         down
79         left
80         right
81         menu
82         select
83         prev
84         mouse
85
86 edl_mark
87     Write the current position into the EDL file.
88
89 frame_drop [value]
90     Toggle/set frame dropping mode.
91
92 get_audio_bitrate
93     Print out the audio bitrate of the current file.
94
95 get_audio_codec
96     Print out the audio codec name of the current file.
97
98 get_audio_samples
99     Print out the audio frequency and number of channels of the current file.
100
101 get_file_name
102     Print out the name of the current file.
103
104 get_meta_album
105     Print out the 'Album' metadata of the current file.
106
107 get_meta_artist
108     Print out the 'Artist' metadata of the current file.
109
110 get_meta_comment
111     Print out the 'Comment' metadata of the current file.
112
113 get_meta_genre
114     Print out the 'Genre' metadata of the current file.
115
116 get_meta_title
117     Print out the 'Title' metadata of the current file.
118
119 get_meta_track
120     Print out the 'Track Number' metadata of the current file.
121
122 get_meta_year
123     Print out the 'Year' metadata of the current file.
124
125 get_percent_pos
126     Print out the current position in the file, as integer percentage [0-100).
127
128 get_property <property>
129     Print out the current value of a property.
130
131 get_sub_visibility
132     Print out subtitle visibility (1 == on, 0 == off).
133
134 get_time_length
135     Print out the length of the current file in seconds.
136
137 get_time_pos
138     Print out the current position in the file in seconds, as float.
139
140 get_vo_fullscreen
141     Print out fullscreen status (1 == fullscreened, 0 == windowed).
142
143 get_video_bitrate
144     Print out the video bitrate of the current file.
145
146 get_video_codec
147     Print out the video codec name of the current file.
148
149 get_video_resolution
150     Print out the video resolution of the current file.
151
152 screenshot <value>
153     Take a screenshot. Requires the screenshot filter to be loaded.
154         0 Take a single screenshot.
155         1 Start/stop taking screenshot of each frame.
156
157 gui_[about|loadfile|loadsubtitle|play|playlist|preferences|skinbrowser|stop]
158     GUI actions
159
160 key_down_event <value>
161     Inject <value> key code event into MPlayer.
162
163 loadfile <file|url> <append>
164     Load the given file/URL, stopping playback of the current file/URL.
165     If <append> is nonzero playback continues and the file/URL is
166     appended to the current playlist instead.
167
168 loadlist <file> <append>
169     Load the given playlist file, stopping playback of the current file.
170     If <append> is nonzero playback continues and the playlist file is
171     appended to the current playlist instead.
172
173 loop <value> [abs]
174     Adjust/set how many times the movie should be looped. -1 means no loop,
175     and 0 forever.
176
177 menu <command>
178     Execute an OSD menu command.
179         up     Move cursor up.
180         down   Move cursor down.
181         ok     Accept selection.
182         cancel Cancel selection.
183         hide   Hide the OSD menu.
184
185 set_menu <menu_name>
186     Display the menu named <menu_name>.
187
188 mute [value]
189     Toggle sound output muting or set it to [value] when [value] >= 0
190     (1 == on, 0 == off).
191
192 osd [level]
193     Toggle OSD mode or set it to [level] when [level] >= 0.
194
195 osd_show_property_text <string> [duration] [level]
196     Show an expanded property string on the OSD, see -playing-msg for a
197     description of the available expansions. If [duration] is >= 0 the text
198     is shown for [duration] ms. [level] sets the minimum OSD level needed
199     for the message to be visible (default: 0 - always show).
200
201 osd_show_text <string> [duration] [level]
202     Show <string> on the OSD.
203
204 panscan <-1.0 - 1.0> | <0.0 - 1.0> <abs>
205     Increase or decrease the pan-and-scan range by <value>, 1.0 is the maximum.
206     Negative values decrease the pan-and-scan range.
207     If <abs> is != 0, then the pan-and scan range is interpreted as an
208     absolute range.
209
210 pause
211     Pause/unpause the playback.
212
213 frame_step
214     Play one frame, then pause again.
215
216 pt_step <value> [force]
217     Go to the next/previous entry in the playtree. The sign of <value> tells
218     the direction.  If no entry is available in the given direction it will do
219     nothing unless [force] is non-zero.
220
221 pt_up_step <value> [force]
222     Similar to pt_step but jumps to the next/previous entry in the parent list.
223     Useful to break out of the inner loop in the playtree.
224
225 quit [value]
226     Quit MPlayer. The optional integer [value] is used as the return code
227     for the mplayer process (default: 0).
228
229 radio_set_channel <channel>
230     Switch to <channel>. The 'channels' radio parameter needs to be set.
231
232 radio_set_freq <frequency in MHz>
233     Set the radio tuner frequency.
234
235 radio_step_channel <-1|1>
236     Step forwards (1) or backwards (-1) in channel list. Works only when the
237     'channels' radio parameter was set.
238
239 radio_step_freq <value>
240     Tune frequency by the <value> (positive - up, negative - down).
241
242 seek <value> [type]
243     Seek to some place in the movie.
244         0 is a relative seek of +/- <value> seconds (default).
245         1 is a seek to <value> % in the movie.
246         2 is a seek to an absolute position of <value> seconds.
247
248 seek_chapter <value> [type]
249     Seek to the start of a chapter.
250         0 is a relative seek of +/- <value> chapters (default).
251         1 is a seek to chapter <value>.
252
253 switch_angle <value>
254     Switch to the angle with the ID [value]. Cycle through the
255     available angles if [value] is omitted or negative.
256
257 set_mouse_pos <x> <y>
258     Tells MPlayer the coordinates of the mouse in the window.
259     This command doesn't move the mouse!
260
261 set_property <property> <value>
262     Set a property.
263
264 speed_incr <value>
265     Add <value> to the current playback speed.
266
267 speed_mult <value>
268     Multiply the current speed by <value>.
269
270 speed_set <value>
271     Set the speed to <value>.
272
273 step_property <property> [value] [direction]
274     Change a property by value, or increase by a default if value is
275     not given or zero. The direction is reversed if direction is less
276     than zero.
277
278 stop
279     Stop playback.
280
281 sub_alignment [value]
282     Toggle/set subtitle alignment.
283         0 top alignment
284         1 center alignment
285         2 bottom alignment
286
287 sub_delay <value> [abs]
288     Adjust the subtitle delay by +/- <value> seconds or set it to <value>
289     seconds when [abs] is nonzero.
290
291 sub_load <subtitle_file>
292     Loads subtitles from <subtitle_file>.
293
294 sub_log
295     Logs the current or last displayed subtitle together with filename
296     and time information to ~/.mplayer/subtitle_log. Intended purpose
297     is to allow convenient marking of bogus subtitles which need to be
298     fixed while watching the movie.
299
300 sub_pos <value> [abs]
301     Adjust/set subtitle position.
302
303 sub_remove [value]
304     If the [value] argument is present and non-negative, removes the subtitle
305     file with index [value]. If the argument is omitted or negative, removes
306     all subtitle files.
307
308 sub_select [value]
309     Display subtitle with index [value]. Turn subtitle display off if
310     [value] is -1 or greater than the highest available subtitle index.
311     Cycle through the available subtitles if [value] is omitted or less
312     than -1. Supported subtitle sources are -sub options on the command
313     line, VOBsubs, DVD subtitles, and Ogg and Matroska text streams.
314     This command is mainly for cycling all subtitles, if you want to set
315     a specific subtitle, use sub_file, sub_vob, or sub_demux.
316
317 sub_source [source]
318     Display first subtitle from [source]. Here [source] is an integer:
319     SUB_SOURCE_SUBS   (0) for file subs
320     SUB_SOURCE_VOBSUB (1) for VOBsub files
321     SUB_SOURCE_DEMUX  (2) for subtitle embedded in the media file or DVD subs.
322     If [source] is -1, will turn off subtitle display. If [source] less than -1,
323     will cycle between the first subtitle of each currently available sources.
324
325 sub_file [value]
326     Display subtitle specifid by [value] for file subs. The [value] is
327     corresponding to ID_FILE_SUB_ID values reported by '-identify'.
328     If [value] is -1, will turn off subtitle display. If [value] less than -1,
329     will cycle all file subs.
330
331 sub_vob [value]
332     Display subtitle specifid by [value] for vobsubs. The [value] is
333     corresponding to ID_VOBSUB_ID values reported by '-identify'.
334     If [value] is -1, will turn off subtitle display. If [value] less than -1,
335     will cycle all vobsubs.
336
337 sub_demux [value]
338     Display subtitle specifid by [value] for subtitles from DVD or embedded
339     in media file. The [value] is corresponding to ID_SUBTITLE_ID values
340     reported by '-identify'. If [value] is -1, will turn off subtitle display.
341     If [value] less than -1, will cycle all DVD subs or embedded subs.
342
343 sub_scale <value> [abs]
344     Adjust the subtitle size by +/- <value> or set it to <value> when [abs]
345     is nonzero.
346
347 vobsub_lang
348     This is a stub linked to sub_select for backwards compatibility.
349
350 sub_step <value>
351     Step forward in the subtitle list by <value> steps or backwards if <value>
352     is negative.
353
354 sub_visibility [value]
355     Toggle/set subtitle visibility.
356
357 forced_subs_only [value]
358     Toggle/set forced subtitles only.
359
360 switch_audio [value] (currently MPEG*, AVI, Matroska and streams handled by libavformat)
361     Switch to the audio track with the ID [value]. Cycle through the
362     available tracks if [value] is omitted or negative.
363
364 switch_angle [value] (DVDs only)
365     Switch to the DVD angle with the ID [value]. Cycle through the
366     available angles if [value] is omitted or negative.
367
368 switch_ratio [value]
369     Change aspect ratio at runtime. [value] is the new aspect ratio expressed
370     as a float (e.g. 1.77778 for 16/9).
371     There might be problems with some video filters.
372
373 switch_title [value] (DVDNAV only)
374     Switch to the DVD title with the ID [value]. Cycle through the
375     available titles if [value] is omitted or negative.
376
377 switch_vsync [value]
378     Toggle vsync (1 == on, 0 == off). If [value] is not provided,
379     vsync status is inverted.
380
381 teletext_add_digit <value>
382     Enter/leave teletext page number editing mode and append given digit to
383     previously entered one.
384     0..9 - Append apropriate digit. (Enables editing mode if called from normal
385            mode, and switches to normal mode when third digit is entered.)
386     -    - Delete last digit from page number. (Backspace emulation, works only
387            in page number editing mode.)
388
389 teletext_go_link <1-6>
390     Follow given link on current teletext page.
391
392 tv_start_scan
393     Start automatic TV channel scanning.
394
395 tv_step_channel <channel>
396     Select next/previous TV channel.
397
398 tv_step_norm
399     Change TV norm.
400
401 tv_step_chanlist
402     Change channel list.
403
404 tv_set_channel <channel>
405     Set the current TV channel.
406
407 tv_last_channel
408     Set the current TV channel to the last one.
409
410 tv_set_freq <frequency in MHz>
411     Set the TV tuner frequency.
412
413 tv_step_freq <frequency offset in MHz>
414     Set the TV tuner frequency relative to current value.
415
416 tv_set_norm <norm>
417     Set the TV tuner norm (PAL, SECAM, NTSC, ...).
418
419 tv_set_brightness <-100 - 100> [abs]
420     Set TV tuner brightness or adjust it if [abs] is set to 0.
421
422 tv_set_contrast <-100 -100> [abs]
423     Set TV tuner contrast or adjust it if [abs] is set to 0.
424
425 tv_set_hue <-100 - 100> [abs]
426     Set TV tuner hue or adjust it if [abs] is set to 0.
427
428 tv_set_saturation <-100 - 100> [abs]
429     Set TV tuner saturation or adjust it if [abs] is set to 0.
430
431 use_master
432     Switch volume control between master and PCM.
433
434 vo_border [value]
435     Toggle/set borderless display.
436
437 vo_fullscreen [value]
438     Toggle/set fullscreen mode.
439
440 vo_ontop [value]
441     Toggle/set stay-on-top.
442
443 vo_rootwin [value]
444     Toggle/set playback on the root window.
445
446 volume <value> [abs]
447     Increase/decrease volume or set it to <value> if [abs] is nonzero.
448
449
450 The following commands are really only useful for OSD menu console mode:
451
452 help
453     Displays help text, currently empty.
454
455 exit
456     Exits from OSD menu console. Unlike 'quit', does not quit MPlayer.
457
458 hide
459     Hides the OSD menu console. Clicking a menu command unhides it. Other
460     keybindings act as usual.
461
462 run <value>
463     Run <value> as shell command. In OSD menu console mode stdout and stdin
464     are through the video output driver.
465
466
467 Available properties:
468
469 name               type      min     max     get set step comment
470 =================================================================
471
472 osdlevel           int       0       3       X   X   X    as -osdlevel
473 speed              float     0.01    100     X   X   X    as -speed
474 loop               int       -1              X   X   X    as -loop
475 pause              flag      0       1       X            1 if paused, use with pausing_keep_force
476 filename           string                    X            file playing wo path
477 path               string                    X            file playing
478 demuxer            string                    X            demuxer used
479 stream_pos         pos       0               X   X        position in stream
480 stream_start       pos       0               X            start pos in stream
481 stream_end         pos       0               X            end pos in stream
482 stream_length      pos       0               X            (end - start)
483 chapter            int       0               X   X   X    select chapter
484 chapters           int                       X            number of chapters
485 angle              int       0               X   X   X    select angle
486 length             time                      X            length of file in seconds
487 percent_pos        int       0       100     X   X   X    position in percent
488 time_pos           time      0               X   X   X    position in seconds
489 metadata           str list                  X            list of metadata key/value
490 metadata/*         string                    X            metadata values
491 volume             float     0       100     X   X   X    change volume
492 balance            float     -1      1       X   X   X    change audio balance
493 mute               flag      0       1       X   X   X
494 audio_delay        float     -100    100     X   X   X
495 audio_format       int                       X
496 audio_codec        string                    X
497 audio_bitrate      int                       X
498 samplerate         int                       X
499 channels           int                       X
500 switch_audio       int       -2      255     X   X   X    select audio stream
501 switch_angle       int       -2      255     X   X   X    select DVD angle
502 switch_title       int       -2      255     X   X   X    select DVD title
503 fullscreen         flag      0       1       X   X   X
504 deinterlace        flag      0       1       X   X   X
505 ontop              flag      0       1       X   X   X
506 rootwin            flag      0       1       X   X   X
507 border             flag      0       1       X   X   X
508 framedropping      int       0       2       X   X   X    1 = soft, 2 = hard
509 gamma              int       -100    100     X   X   X
510 brightness         int       -100    100     X   X   X
511 contrast           int       -100    100     X   X   X
512 saturation         int       -100    100     X   X   X
513 hue                int       -100    100     X   X   X
514 panscan            float     0       1       X   X   X
515 vsync              flag      0       1       X   X   X
516 video_format       int                       X
517 video_codec        string                    X
518 video_bitrate      int                       X
519 width              int                       X            "display" width
520 height             int                       X            "display" height
521 fps                float                     X
522 aspect             float                     X
523 switch_video       int       -2      255     X   X   X    select video stream
524 switch_program     int       -1      65535   X   X   X    (see TAB default keybind)
525 sub                int       -1              X   X   X    select subtitle stream
526 sub_source         int       -1      2       X   X   X    select subtitle source
527 sub_file           int       -1              X   X   X    select file subtitles
528 sub_vob            int       -1              X   X   X    select vobsubs
529 sub_demux          int       -1              X   X   X    select subs from demux
530 sub_delay          float                     X   X   X
531 sub_pos            int       0       100     X   X   X    subtitle position
532 sub_alignment      int       0       2       X   X   X    subtitle alignment
533 sub_visibility     flag      0       1       X   X   X    show/hide subtitles
534 sub_forced_only    flag      0       1       X   X   X
535 sub_scale          float     0       100     X   X   X    subtitles font size
536 tv_brightness      int       -100    100     X   X   X
537 tv_contrast        int       -100    100     X   X   X
538 tv_saturation      int       -100    100     X   X   X
539 tv_hue             int       -100    100     X   X   X
540 teletext_page      int       0       799     X   X   X
541 teletext_subpage   int       0       64      X   X   X
542 teletext_mode      flag      0       1       X   X   X    0 - off, 1 - on
543 teletext_format    int       0       3       X   X   X    0 - opaque,
544                                                           1 - transparent,
545                                                           2 - opaque inverted,
546                                                           3 - transp. inv.
547 teletext_half_page int       0       2       X   X   X    0 - off, 1 - top half,
548                                                           2- bottom half
549