Mercurial > mplayer.hg
annotate DOCS/xml/en/usage.xml @ 10643:ec69923456d1
Fix '- loop' to '-loop' option into example
author | nauj27 |
---|---|
date | Sun, 17 Aug 2003 14:09:27 +0000 |
parents | b6c63ab184a4 |
children | 8ec62402a8a3 |
rev | line source |
---|---|
9675 | 1 <?xml version="1.0" encoding="iso-8859-1"?> |
2 <chapter id="usage"> | |
3 <title>Usage</title> | |
4 | |
5 <sect1 id="commandline"> | |
6 <title>Command line</title> | |
7 | |
8 <para> | |
9 <application>MPlayer</application> utilizes a complex playtree. It consists | |
10 of global options written as first, for example | |
11 | |
12 <screen>mplayer -vfm 5</screen> | |
13 | |
14 and options written after filenames, that apply only to the given | |
15 filename/URL/whatever, for example: | |
16 | |
17 <screen>mplayer -vfm 5 movie1.avi movie2.avi -vfm 4</screen> | |
18 </para> | |
19 | |
20 <para> | |
21 You can group filenames/URLs together using <literal>{</literal> and | |
22 <literal>}</literal>. It's useful with option <option>-loop</option>: | |
23 | |
10643 | 24 <screen>mplayer { 1.avi -loop 2 2.avi } -loop 3</screen> |
9675 | 25 |
26 The above command will play files in this order: 1, 1, 2, 1, 1, 2, 1, 1, 2. | |
27 </para> | |
28 | |
29 <para> | |
30 Playing a file: | |
31 <synopsis> | |
32 <command>mplayer</command><!-- | |
33 --> [<replaceable>options</replaceable>]<!-- | |
34 --> [<replaceable>path</replaceable>/]<replaceable>filename</replaceable> | |
35 </synopsis> | |
36 </para> | |
37 | |
38 <para> | |
39 Playing more files: | |
40 <synopsis> | |
41 <command>mplayer</command><!-- | |
42 --> [<replaceable>default options</replaceable>]<!-- | |
43 --> [<replaceable>path</replaceable>/]<replaceable>filename1</replaceable><!-- | |
44 --> [<replaceable>options for filename1</replaceable>]<!-- | |
45 --> <replaceable>filename2</replaceable><!-- | |
46 --> [<replaceable>options for filename2</replaceable>] ... | |
47 </synopsis> | |
48 </para> | |
49 | |
50 <para> | |
51 Playing VCD: | |
52 <synopsis> | |
53 <command>mplayer</command> [<replaceable>options</replaceable>]<!-- | |
10184
b6c63ab184a4
Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents:
10144
diff
changeset
|
54 --> vcd://<replaceable>trackno</replaceable><!-- |
9675 | 55 --> [-cdrom-device <replaceable>/dev/cdrom</replaceable>] |
56 </synopsis> | |
57 </para> | |
58 | |
59 <para> | |
60 Playing DVD: | |
61 <synopsis> | |
62 <command>mplayer</command> [<replaceable>options</replaceable>]<!-- | |
10184
b6c63ab184a4
Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents:
10144
diff
changeset
|
63 --> dvd://<replaceable>titleno</replaceable><!-- |
9675 | 64 --> [-dvd-device <replaceable>/dev/dvd</replaceable>] |
65 </synopsis> | |
66 </para> | |
67 | |
68 <para> | |
69 Playing from the WWW: | |
70 <synopsis> | |
71 <command>mplayer</command> [<replaceable>options</replaceable>]<!-- | |
72 --> http://<replaceable>site.com/file.asf</replaceable> | |
73 </synopsis> | |
74 (playlists can be used, too) | |
75 </para> | |
76 | |
77 <para> | |
78 Playing from RTSP: | |
79 <synopsis> | |
80 <command>mplayer</command> [<replaceable>options</replaceable>]<!-- | |
81 --> rtsp://<replaceable>server.example.com/streamName</replaceable> | |
82 </synopsis> | |
83 </para> | |
84 | |
85 <para> | |
86 Latest versions of <application>MPlayer</application> also accepts VCD and | |
10144 | 87 DVD tracks in URL style, just like <application>xine</application> does: |
9675 | 88 <screen>mplayer dvd://1</screen> |
89 or | |
90 <screen>mplayer vcd://1</screen> | |
91 </para> | |
92 | |
93 <para> | |
94 Examples: | |
95 <screen> | |
96 mplayer -vo x11 /mnt/Films/Contact/contact2.mpg | |
10184
b6c63ab184a4
Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents:
10144
diff
changeset
|
97 mplayer vcd://2 -cd-rom-device /dev/hdc |
9675 | 98 mplayer -afm 3 /mnt/DVDtrailers/alien4.vob |
10184
b6c63ab184a4
Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents:
10144
diff
changeset
|
99 mplayer dvd://1 -dvd-device /dev/hdc |
9675 | 100 mplayer -abs 65536 -delay -0.4 -nobps ~/movies/test.avi<!-- |
101 --></screen> | |
102 </para> | |
103 </sect1> | |
104 | |
105 | |
106 <sect1 id="control"> | |
107 <title>Control</title> | |
108 | |
109 <para> | |
110 <application>MPlayer</application> has a fully configurable, command | |
111 driven, control layer which lets you control | |
112 <application>MPlayer</application> with keyboard, mouse, joystick or remote | |
113 control (using LIRC). See the man page for the complete list of keyboard controls. | |
114 </para> | |
115 | |
116 | |
117 <sect2 id="ctrl-cfg"> | |
118 <title>Controls configuration</title> | |
119 | |
120 <para> | |
121 <application>MPlayer</application> allows you bind any key/button to any | |
122 MPlayer command using a simple config file. The syntax consist of a key | |
123 name followed by a command. The default config file location is | |
124 <filename>$HOME/.mplayer/input.conf</filename> but it can be overridden | |
125 using the <option>-input <replaceable>conf</replaceable></option> option | |
126 (relative path are relative to <filename>$HOME/.mplayer</filename>). | |
127 </para> | |
128 | |
129 <example> | |
130 <title>A simple input control file</title> | |
131 <programlisting> | |
132 ## | |
133 ## MPlayer input control file | |
134 ## | |
135 | |
136 RIGHT seek +10 | |
137 LEFT seek -10 | |
138 - audio_delay 0.100 | |
139 + audio_delay -0.100 | |
140 q quit | |
141 > pt_step 1 | |
142 < pt_step -1 | |
143 ENTER pt_step 1 1<!-- | |
144 --></programlisting> | |
145 </example> | |
146 | |
147 | |
148 <sect3 id="ctrl-cfg-keys"> | |
149 <title>Key names</title> | |
150 | |
151 <para> | |
152 You can have a full list by running | |
153 <command>mplayer -input keylist</command>. | |
154 </para> | |
155 | |
156 <itemizedlist> | |
157 <title>Keyboard</title> | |
158 <listitem><simpara>Any printable character</simpara></listitem> | |
159 <listitem><simpara><literal>SPACE</literal></simpara></listitem> | |
160 <listitem><simpara><literal>ENTER</literal></simpara></listitem> | |
161 <listitem><simpara><literal>TAB</literal></simpara></listitem> | |
162 <listitem><simpara><literal>CTRL</literal></simpara></listitem> | |
163 <listitem><simpara><literal>BS</literal></simpara></listitem> | |
164 <listitem><simpara><literal>DEL</literal></simpara></listitem> | |
165 <listitem><simpara><literal>INS</literal></simpara></listitem> | |
166 <listitem><simpara><literal>HOME</literal></simpara></listitem> | |
167 <listitem><simpara><literal>END</literal></simpara></listitem> | |
168 <listitem><simpara><literal>PGUP</literal></simpara></listitem> | |
169 <listitem><simpara><literal>PGDWN</literal></simpara></listitem> | |
170 <listitem><simpara><literal>ESC</literal></simpara></listitem> | |
171 <listitem><simpara><literal>RIGHT</literal></simpara></listitem> | |
172 <listitem><simpara><literal>LEFT</literal></simpara></listitem> | |
173 <listitem><simpara><literal>UP</literal></simpara></listitem> | |
174 <listitem><simpara><literal>DOWN</literal></simpara></listitem> | |
175 </itemizedlist> | |
176 | |
177 <itemizedlist> | |
178 <title>Mouse (only supported under X)</title> | |
179 <listitem><simpara> | |
180 <literal>MOUSE_BTN0</literal> (Left button)</simpara></listitem> | |
181 <listitem><simpara> | |
182 <literal>MOUSE_BTN1</literal> (Right button)</simpara></listitem> | |
183 <listitem><simpara> | |
184 <literal>MOUSE_BTN2</literal> (Middle button)</simpara></listitem> | |
185 <listitem><simpara> | |
186 <literal>MOUSE_BTN3</literal> (Wheel)</simpara></listitem> | |
187 <listitem><simpara> | |
188 <literal>MOUSE_BTN4</literal> (Wheel)</simpara></listitem> | |
189 <listitem><simpara>...</simpara></listitem> | |
190 <listitem><simpara><literal>MOUSE_BTN9</literal></simpara></listitem> | |
191 </itemizedlist> | |
192 | |
193 <itemizedlist> | |
194 <title>Joystick (support must be enabled at compile time)</title> | |
195 <listitem><simpara> | |
196 <literal>JOY_RIGHT</literal> or | |
197 <literal>JOY_AXIS0_PLUS</literal></simpara></listitem> | |
198 <listitem><simpara> | |
199 <literal>JOY_LEFT</literal> or | |
200 <literal>JOY_AXIS0_MINUS</literal></simpara></listitem> | |
201 <listitem><simpara> | |
202 <literal>JOY_UP</literal> or | |
203 <literal>JOY_AXIS1_MINUS</literal></simpara></listitem> | |
204 <listitem><simpara> | |
205 <literal>JOY_DOWN</literal> or | |
206 <literal>JOY_AXIS1_PLUS</literal></simpara></listitem> | |
207 <listitem><simpara><literal>JOY_AXIS2_PLUS</literal></simpara></listitem> | |
208 <listitem><simpara><literal>JOY_AXIS2_MINUS</literal></simpara></listitem> | |
209 <listitem><simpara>...</simpara></listitem> | |
210 <listitem><simpara><literal>JOY_AXIS9_PLUS</literal></simpara></listitem> | |
211 <listitem><simpara><literal>JOY_AXIS9_MINUS</literal></simpara></listitem> | |
212 </itemizedlist> | |
213 </sect3> | |
214 | |
215 | |
216 <sect3 id="ctrl-cfg-commands"> | |
217 <title>Commands</title> | |
218 | |
219 <para> | |
220 You can have a full list of known commands by running | |
221 <command>mplayer -input cmdlist</command>. | |
222 </para> | |
223 | |
224 <itemizedlist> | |
225 <listitem><para><literal>seek</literal> (int) val [(int) type=0]</para> | |
226 <para> | |
227 Seek to some place in the movie. | |
228 Type <literal>0</literal> is a relative seek of +/- val seconds. | |
229 Type <literal>1</literal> seek to val % in the movie. | |
230 </para></listitem> | |
231 <listitem><para><literal>audio_delay</literal> (float) val</para> | |
232 <para> | |
233 Adjust the audio delay of val seconds | |
234 </para></listitem> | |
235 <listitem><para><literal>quit</literal></para> | |
236 <para> | |
237 Quit <application>MPlayer</application> | |
238 </para></listitem> | |
239 <listitem><para><literal>pause</literal></para> | |
240 <para> | |
241 Pause/unpause the playback | |
242 </para></listitem> | |
243 <listitem><para><literal>grap_frames</literal></para> | |
244 <para> | |
245 Somebody know ? | |
246 </para></listitem> | |
247 <listitem><para><literal>pt_step</literal> (int) val [(int) force=0]</para> | |
248 <para> | |
249 Go to next/previous entry in playtree. Val sign tell the direction. If | |
250 no other entry is available in the given direction it won't do anything | |
251 unless force is non 0. | |
252 </para></listitem> | |
253 <listitem><para><literal>pt_up_step</literal> (int) val [(int) force=0]</para> | |
254 <para> | |
255 Like pt_step but it jump to next/previous in the parent list. It's useful | |
256 to break inner loop in the playtree. | |
257 </para></listitem> | |
258 <listitem><para><literal>alt_src_step</literal> (int) val</para> | |
259 <para> | |
260 When more than one source is available it select the next/previous one | |
261 (only supported by asx playlist). | |
262 </para></listitem> | |
263 <listitem><para><literal>sub_delay</literal> (float) val [(int) abs=0]</para> | |
264 <para> | |
265 Adjust the subtitles delay of +/- val seconds or set it to val seconds | |
266 when abs is non zero. | |
267 </para></listitem> | |
268 <listitem><para><literal>osd</literal> [(int) level=-1]</para> | |
269 <para> | |
270 Toggle osd mode or set it to level when level > 0. | |
271 </para></listitem> | |
272 <listitem><para><literal>volume</literal> (int) dir</para> | |
273 <para>Increase/decrease volume | |
274 </para></listitem> | |
275 <listitem><simpara><literal>contrast</literal> (int) val [(int) abs=0] | |
276 </simpara></listitem> | |
277 <listitem><simpara><literal>brightness</literal> (int) val [(int) abs=0] | |
278 </simpara></listitem> | |
279 <listitem><simpara><literal>hue</literal> (int) val [(int) abs=0] | |
280 </simpara></listitem> | |
281 <listitem><para><literal>saturation</literal> (int) val [(int) abs=0]</para> | |
282 <para> | |
283 Set/Adjust video parameters. Val range from -100 to 100. | |
284 </para></listitem> | |
285 <listitem><para><literal>frame_drop</literal> [(int) type=-1]</para> | |
286 <para> | |
287 Toggle/Set frame dropping mode. | |
288 </para></listitem> | |
289 <listitem><para><literal>sub_visibility</literal></para> | |
290 <para> | |
291 Adjust subtitles visibility. | |
292 </para></listitem> | |
293 <listitem><para><literal>sub_pos</literal> (int) val</para> | |
294 <para> | |
295 Adjust subtitles position. | |
296 </para></listitem> | |
297 <listitem><para><literal>vobsub_lang</literal></para> | |
298 <para> | |
299 Change the language of VobSub subtitles. | |
300 </para></listitem> | |
301 <listitem><para><literal>vo_fullscreen</literal></para> | |
302 <para> | |
303 Switch fullscreen mode. | |
304 </para></listitem> | |
305 <listitem><para><literal>tv_step_channel</literal> (int) dir</para> | |
306 <para> | |
307 Select next/previous tv channel. | |
308 </para></listitem> | |
309 <listitem><para><literal>tv_step_norm</literal></para> | |
310 <para> | |
311 Change TV norm. | |
312 </para></listitem> | |
313 <listitem><para><literal>tv_step_chanlist</literal></para> | |
314 <para> | |
315 Change channel list. | |
316 </para></listitem> | |
317 <listitem><simpara><literal>gui_loadfile</literal></simpara></listitem> | |
318 <listitem><simpara><literal>gui_loadsubtitle</literal></simpara></listitem> | |
319 <listitem><simpara><literal>gui_about</literal></simpara></listitem> | |
320 <listitem><simpara><literal>gui_play</literal></simpara></listitem> | |
321 <listitem><simpara><literal>gui_stop</literal></simpara></listitem> | |
322 <listitem><simpara><literal>gui_playlist</literal></simpara></listitem> | |
323 <listitem><simpara><literal>gui_preferences</literal></simpara></listitem> | |
324 <listitem><para><literal>gui_skinbrowser</literal></para> | |
325 <para> | |
326 GUI actions | |
327 </para></listitem> | |
328 </itemizedlist> | |
329 </sect3> | |
330 </sect2> | |
331 | |
332 | |
333 <sect2 id="lirc"> | |
334 <title>Control from LIRC</title> | |
335 | |
336 <para> | |
337 Linux Infrared Remote Control - use an easy to build home-brewn IR-receiver, | |
338 an (almost) arbitrary remote control and control your linux box with it! | |
339 More about it at <ulink url="http://www.lirc.org">www.lirc.org</ulink>. | |
340 </para> | |
341 | |
342 <para> | |
343 If you have installed the lirc-package, configure will autodetect it. If | |
344 everything went fine, <application>MPlayer</application> will print a | |
345 message like "<computeroutput>Setting up lirc support...</computeroutput>" | |
346 on startup. If an error occurs it will tell you. If it doesn't tell you | |
347 anything about LIRC there's no support compiled in. That's it :-) | |
348 </para> | |
349 | |
350 <para> | |
351 The application name for <application>MPlayer</application> is - oh wonder | |
352 - <filename>mplayer</filename>. You can use any mplayer commands and even | |
353 pass more than one command by separating them with <literal>\n</literal>. | |
354 Don't forget to enable the repeat flag in <filename>.lircrc</filename> when | |
355 it make sense (seek, volume, etc). Here's an excerpt from my | |
356 <filename>.lircrc</filename>: | |
357 </para> | |
358 | |
359 <programlisting> | |
360 begin | |
361 button = VOLUME_PLUS | |
362 prog = mplayer | |
363 config = volume 1 | |
364 repeat = 1 | |
365 end | |
366 | |
367 begin | |
368 button = VOLUME_MINUS | |
369 prog = mplayer | |
370 config = volume -1 | |
371 repeat = 1 | |
372 end | |
373 | |
374 begin | |
375 button = CD_PLAY | |
376 prog = mplayer | |
377 config = pause | |
378 end | |
379 | |
380 begin | |
381 button = CD_STOP | |
382 prog = mplayer | |
383 config = seek 0 1\npause | |
384 end<!-- | |
385 --></programlisting> | |
386 | |
387 <para> | |
388 If you don't like the standard location for the lirc-config file | |
389 (<filename>~/.lircrc</filename>) use the <option>-lircconf | |
390 <replaceable>filename</replaceable></option> switch to specify another | |
391 file. | |
392 </para> | |
393 </sect2> | |
394 | |
395 | |
396 <sect2 id="slave-mode"> | |
397 <title>Slave mode</title> | |
398 <para> | |
399 The slave mode allow you to build simple frontend to | |
400 <application>MPlayer</application>. When enabled (with the | |
401 <option>-slave</option> option) <application>MPlayer</application> will | |
402 read commands separated by new line (\n) from stdin. | |
403 </para> | |
404 </sect2> | |
405 </sect1> | |
406 | |
407 | |
408 <sect1 id="streaming"> | |
409 <title>Streaming from network or pipes</title> | |
410 | |
411 <para> | |
412 <application>MPlayer</application> can play files from network, using the | |
413 HTTP or MMS protocol. | |
414 </para> | |
415 | |
416 <para> | |
417 Playing goes by simply using adding the URL to the command line. | |
418 <application>MPlayer</application> also honors the | |
419 <envar>http_proxy</envar> environment variable, and uses proxy if | |
420 available. Proxy usage can also be forced: | |
421 <screen>mplayer http_proxy://proxy.micorsops.com:3128/http://micorsops.com:80/stream.asf</screen> | |
422 </para> | |
423 | |
424 <para> | |
425 <application>MPlayer</application> can read from stdin | |
426 (<emphasis>not</emphasis> named pipes). This can be for example used to | |
427 play from FTP: | |
428 <screen>wget ftp://micorsops.com/something.avi -O - | mplayer -</screen> | |
429 </para> | |
430 | |
431 <para> | |
432 Note: it's also recommended to enable CACHE when playback from network: | |
433 <screen>wget ftp://micorsops.com/something.avi -O - | mplayer -cache 8192 -</screen> | |
434 </para> | |
435 </sect1> | |
9966 | 436 |
437 <sect1 id="mpst" xreflabel="Remote streams"> | |
438 <title>Remote streams</title> | |
439 | |
440 <para> | |
441 Remote streams allow you to access most <application>MPlayer</application> | |
442 stream type from a remote host. The main purpose of this feature is to make | |
443 it possible to directly use the CD or DVD drive of another computer on the | |
444 network (provided you have the required bandwidth). On the downside some | |
445 stream type (currently TV and MF) are not useable remotely because they are | |
446 implemented at the demuxer level. It's sad for MF but TV stream would anyway | |
447 require an insane amount of bandwith. | |
448 </para> | |
449 | |
450 <sect2 id="compile_mpst_server"> | |
451 <title>Compiling the server</title> | |
452 <para> | |
453 After having compiled <application>MPlayer</application> go to the | |
454 <filename>TOOLS/netstream</filename> directory and enter | |
455 <application>make</application> to build the server binary. | |
456 You can then copy the <application>netstream</application> binary | |
9969 | 457 to the right place on your system (usually |
458 <filename class="directory">/usr/local/bin</filename> on Linux). | |
9966 | 459 </para> |
460 </sect2> | |
461 | |
462 <sect2 id="use_mpst"> | |
463 <title>Using remote streams</title> | |
464 <para> | |
465 First you have to start the server on the computer you intend to remotely | |
466 access. Currently the server is very basic and doesn't have any commands | |
467 line arguments so just enter <filename>netstream</filename>. Now you can | |
468 for example play the second track of a VCD on the server with : | |
469 <screen> | |
470 mplayer -cache 5000 mpst://servername/vcd://2 | |
471 </screen> | |
472 You can also access files on this server : | |
473 <screen> | |
474 mplayer -cache 5000 mpst://servername//usr/local/movies/lol.avi | |
475 </screen> | |
476 Note that paths wich aren't starting with a / will be relative to | |
477 the directory where the server is running. The cache option is not | |
478 needed but highly recommended. | |
479 </para> | |
480 | |
481 <para> | |
482 Be aware that currently the server is not secure at all. So don't complain | |
483 about the numerous exploits wich are possible through this. Instead send | |
484 some (good) patch to make it better or start writing your own server. | |
485 </para> | |
486 | |
487 </sect2> | |
488 | |
489 </sect1> | |
9675 | 490 </chapter> |