1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
|
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<chapter id="usage">
<title>Usage</title>
<sect1 id="commandline">
<title>Command line</title>
<para>
<application>MPlayer</application> utilizes a complex playtree. Options passed
on the command line can apply to all files/URLs or just to specific ones
depending on their position. For example
<screen>mplayer -vfm ffmpeg movie1.avi movie2.avi</screen>
will use FFmpeg decoders for both files, but
<screen>
mplayer -vfm ffmpeg <replaceable>movie1.avi</replaceable> <replaceable>movie2.avi</replaceable> -vfm dmo
</screen>
will play the second file with a DMO decoder.
</para>
<para>
You can group filenames/URLs together using <literal>{</literal> and
<literal>}</literal>. It is useful with option <option>-loop</option>:
<screen>mplayer { 1.avi -loop 2 2.avi } -loop 3</screen>
The above command will play files in this order: 1, 1, 2, 1, 1, 2, 1, 1, 2.
</para>
<para>
Playing a file:
<synopsis>
<command>mplayer</command><!--
--> [<replaceable>options</replaceable>]<!--
--> [<replaceable>path</replaceable>/]<replaceable>filename</replaceable>
</synopsis>
</para>
<para>
Another way to play a file:
<synopsis>
<command>mplayer</command><!--
--> [<replaceable>options</replaceable>]<!--
--> <replaceable>file:///uri-escaped-path</replaceable>
</synopsis>
</para>
<para>
Playing more files:
<synopsis>
<command>mplayer</command><!--
--> [<replaceable>default options</replaceable>]<!--
--> [<replaceable>path</replaceable>/]<replaceable>filename1</replaceable><!--
--> [<replaceable>options for filename1</replaceable>]<!--
--> <replaceable>filename2</replaceable><!--
--> [<replaceable>options for filename2</replaceable>] ...
</synopsis>
</para>
<para>
Playing VCD:
<synopsis>
<command>mplayer</command> [<replaceable>options</replaceable>]<!--
--> vcd://<replaceable>trackno</replaceable><!--
--> [-cdrom-device <replaceable>/dev/cdrom</replaceable>]
</synopsis>
</para>
<para>
Playing DVD:
<synopsis>
<command>mplayer</command> [<replaceable>options</replaceable>]<!--
--> dvd://<replaceable>titleno</replaceable><!--
--> [-dvd-device <replaceable>/dev/dvd</replaceable>]
</synopsis>
</para>
<para>
Playing from the WWW:
<synopsis>
<command>mplayer</command> [<replaceable>options</replaceable>]<!--
--> http://<replaceable>site.com/file.asf</replaceable>
</synopsis>
(playlists can be used, too)
</para>
<para>
Playing from RTSP:
<synopsis>
<command>mplayer</command> [<replaceable>options</replaceable>]<!--
--> rtsp://<replaceable>server.example.com/streamName</replaceable>
</synopsis>
</para>
<para>
Examples:
<screen>
mplayer -vo x11 <replaceable>/mnt/Films/Contact/contact2.mpg</replaceable>
mplayer vcd://<replaceable>2</replaceable> -cdrom-device <replaceable>/dev/hdc</replaceable>
mplayer -afm 3 <replaceable>/mnt/DVDtrailers/alien4.vob</replaceable>
mplayer dvd://<replaceable>1</replaceable> -dvd-device <replaceable>/dev/hdc</replaceable>
mplayer -abs 65536 -delay -0.4 -nobps <replaceable>~/movies/test.avi</replaceable><!--
--></screen>
</para>
</sect1>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<sect1 id="subosd">
<title>Subtitles and OSD</title>
<para>
<application>MPlayer</application> can display subtitles along with movie files.
Currently the following formats are supported:
<itemizedlist>
<listitem><para>VOBsub</para></listitem>
<listitem><para>OGM</para></listitem>
<listitem><para>CC (closed caption)</para></listitem>
<listitem><para>MicroDVD</para></listitem>
<listitem><para>SubRip</para></listitem>
<listitem><para>SubViewer</para></listitem>
<listitem><para>Sami</para></listitem>
<listitem><para>VPlayer</para></listitem>
<listitem><para>RT</para></listitem>
<listitem><para>SSA</para></listitem>
<listitem><para>PJS (Phoenix Japanimation Society)</para></listitem>
<listitem><para>MPsub</para></listitem>
<listitem><para>AQTitle</para></listitem>
<listitem><para>
<ulink url="http://unicorn.us.com/jacosub/">JACOsub</ulink>
</para></listitem>
</itemizedlist>
</para>
<para>
<application>MPlayer</application> can dump the previously listed subtitle
formats (<emphasis role="bold">except the three first</emphasis>) into the
following destination formats, with the given options:
<itemizedlist>
<listitem><para>MPsub: <option>-dumpmpsub</option></para></listitem>
<listitem><para>SubRip: <option>-dumpsrtsub</option></para></listitem>
<listitem><para>MicroDVD: <option>-dumpmicrodvdsub</option></para></listitem>
<listitem><para>JACOsub: <option>-dumpjacosub</option></para></listitem>
<listitem><para>Sami: <option>-dumpsami</option></para></listitem>
</itemizedlist>
</para>
<para>
<application>MEncoder</application> can dump DVD subtitles into
<link linkend="menc-feat-extractsub">VOBsub</link> format.
</para>
<para>
The command line options differ slightly for the different formats:
</para>
<formalpara>
<title>VOBsub subtitles</title>
<para>
VOBsub subtitles consist of a big (some megabytes) <filename>.SUB</filename>
file, and optional <filename>.IDX</filename> and/or <filename>.IFO</filename>
files. If you have files like
<filename><replaceable>sample.sub</replaceable></filename>,
<filename><replaceable>sample.ifo</replaceable></filename> (optional),
<filename><replaceable>sample.idx</replaceable></filename> - you have to pass
<application>MPlayer</application> the <option>-vobsub sample
[-vobsubid <replaceable>id</replaceable>]</option> options
(full path optional). The <option>-vobsubid</option> option is like
<option>-sid</option> for DVDs, you can choose between subtitle tracks
(languages) with it. In case that <option>-vobsubid</option> is omitted,
<application>MPlayer</application> will try to use the languages given by the
<option>-slang</option> option and fall back to the
<systemitem>langidx</systemitem> in the <filename>.IDX</filename> file to set
the subtitle language. If it fails, there will be no subtitles.
</para>
</formalpara>
<formalpara>
<title>Other subtitles</title>
<para>
The other formats consist of a single text file containing timing,
placement and text information. Usage: If you have a file like
<filename><replaceable>sample.txt</replaceable></filename>,
you have to pass the option <option>-sub
<replaceable>sample.txt</replaceable></option> (full path optional).
</para>
</formalpara>
<variablelist>
<title>Adjusting subtitle timing and placement:</title>
<varlistentry>
<term><option>-subdelay <replaceable>sec</replaceable></option></term>
<listitem><para>
Delays subtitles by <option><replaceable>sec</replaceable></option> seconds.
Can be negative. The value is added to movie's time position counter.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-subfps <replaceable>RATE</replaceable></option></term>
<listitem><para>
Specify frame/sec rate of subtitle file (float number).
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-subpos <replaceable>0-100</replaceable></option></term>
<listitem><para>
Specify the position of subtitles.
</para></listitem>
</varlistentry>
</variablelist>
<para>
If you experience a growing delay between the movie and the subtitles when
using a MicroDVD subtitle file, most likely the framerate of the movie and
the subtitle file are different. Please note that the MicroDVD subtitle
format uses absolute frame numbers for its timing, but there is no fps
information in it, and therefore the <option>-subfps</option> option should
be used with this format. If you like to solve this problem permanently,
you have to manually convert the subtitle file framerate.
<application>MPlayer</application> can do this
conversion for you:
<screen>
mplayer -dumpmicrodvdsub -fps <replaceable>subtitles_fps</replaceable> -subfps <replaceable>avi_fps</replaceable> \
-sub <replaceable>subtitle_filename</replaceable> <replaceable>dummy.avi</replaceable>
</screen>
</para>
<para>
About DVD subtitles, read the <link linkend="dvd">DVD</link> section.
</para>
</sect1>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<sect1 id="control">
<title>Control</title>
<para>
<application>MPlayer</application> has a fully configurable, command
driven, control layer which lets you control
<application>MPlayer</application> with keyboard, mouse, joystick or remote
control (using LIRC). See the man page for the complete list of keyboard controls.
</para>
<!-- ********** -->
<sect2 id="ctrl-cfg">
<title>Controls configuration</title>
<para>
<application>MPlayer</application> allows you bind any key/button to any
<application>MPlayer</application> command using a simple config file.
The syntax consist of a key name followed by a command. The default config file location is
<filename>$HOME/.mplayer/input.conf</filename> but it can be overridden
using the <option>-input <replaceable>conf</replaceable></option> option
(relative path are relative to <filename>$HOME/.mplayer</filename>).
</para>
<para>
You can get a full list of supported key names by running
<command>mplayer -input keylist</command>
and a full list of available commands by running
<command>mplayer -input cmdlist</command>.
</para>
<example id="input_control_file">
<title>A simple input control file</title>
<programlisting>
##
## MPlayer input control file
##
RIGHT seek +10
LEFT seek -10
- audio_delay 0.100
+ audio_delay -0.100
q quit
> pt_step 1
< pt_step -1
ENTER pt_step 1 1<!--
--></programlisting>
</example>
</sect2>
<!-- ********** -->
<sect2 id="lirc">
<title>Control from LIRC</title>
<para>
Linux Infrared Remote Control - use an easy to build home-brewed IR-receiver,
an (almost) arbitrary remote control and control your Linux box with it!
More about it on the <ulink url="http://www.lirc.org">LIRC homepage</ulink>.
</para>
<para>
If you have the LIRC package installed, <filename>configure</filename> will
autodetect it. If everything went fine, <application>MPlayer</application>
will print "<systemitem>Setting up LIRC support...</systemitem>"
on startup. If an error occurs it will tell you. If there is no message about
LIRC there is no support compiled in. That's it :-)
</para>
<para>
The application name for <application>MPlayer</application> is - surprise -
<filename>mplayer</filename>. You can use any <application>MPlayer</application>
commands and even pass more than one command by separating them with
<literal>\n</literal>.
Do not forget to enable the repeat flag in <filename>.lircrc</filename> when
it makes sense (seek, volume, etc). Here is an excerpt from a sample
<filename>.lircrc</filename>:
</para>
<programlisting>
begin
button = VOLUME_PLUS
prog = mplayer
config = volume 1
repeat = 1
end
begin
button = VOLUME_MINUS
prog = mplayer
config = volume -1
repeat = 1
end
begin
button = CD_PLAY
prog = mplayer
config = pause
end
begin
button = CD_STOP
prog = mplayer
config = seek 0 1\npause
end<!--
--></programlisting>
<para>
If you do not like the standard location for the lirc-config file
(<filename>~/.lircrc</filename>) use the <option>-lircconf
<replaceable>filename</replaceable></option> switch to specify another
file.
</para>
</sect2>
<!-- ********** -->
<sect2 id="slave-mode">
<title>Slave mode</title>
<para>
The slave mode allows you to build simple frontends to
<application>MPlayer</application>. When run with the
<option>-slave</option> option <application>MPlayer</application> will
read commands separated by a newline (\n) from stdin.
The commands are documented in the
<ulink url="../../tech/slave.txt">slave.txt</ulink> file.
</para>
</sect2>
</sect1>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<sect1 id="streaming">
<title>Streaming from network or pipes</title>
<para>
<application>MPlayer</application> can play files from the network, using the
HTTP, FTP, MMS or RTSP/RTP protocol.
</para>
<para>
Playing works simply by passing the URL on the command line.
<application>MPlayer</application> honors the <envar>http_proxy</envar>
environment variable, using a proxy if available. Proxies can also be forced:
<screen>
mplayer <replaceable>http_proxy://proxy.micorsops.com:3128/http://micorsops.com:80/stream.asf</replaceable>
</screen>
</para>
<para>
<application>MPlayer</application> can read from stdin
(<emphasis>not</emphasis> named pipes). This can for example be used to
play from FTP:
<screen>
wget <replaceable>ftp://micorsops.com/something.avi</replaceable> -O - | mplayer -
</screen>
</para>
<note><para>
It is also recommended to enable <option>-cache</option> when playing
from the network:
<screen>
wget <replaceable>ftp://micorsops.com/something.avi</replaceable> -O - | mplayer -cache 8192 -
</screen>
</para></note>
<!-- ********** -->
<sect2 id="streaming-save">
<title>Saving streamed content</title>
<para>
Once you succeed in making <application>MPlayer</application> play
your favorite internet stream, you can use the option
<option>-dumpstream</option> to save the stream into a file.
For example:
<screen>
mplayer <replaceable>http://217.71.208.37:8006</replaceable> -dumpstream -dumpfile <replaceable>stream.asf</replaceable>
</screen>
will save the content streamed from
<replaceable>http://217.71.208.37:8006</replaceable> into
<replaceable>stream.asf</replaceable>.
This works with all protocols supported by
<application>MPlayer</application>, like MMS, RTSP, and so forth.
</para>
</sect2>
</sect1>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<sect1 id="edl" xreflabel="Edit Decision Lists (EDL)">
<title>Edit Decision Lists (EDL)</title>
<para>
The edit decision list (EDL) system allows you to automatically skip
or mute sections of videos during playback, based on a movie specific
EDL configuration file.
</para>
<para>
This is useful for those who may want to watch a film in "family-friendly"
mode. You can cut out any violence, profanity, Jar-Jar Binks .. from a movie
according to your own personal preferences. Aside from this, there are other
uses, like automatically skipping over commercials in video files you watch.
</para>
<para>
The EDL file format is pretty bare-bones. There is one command per line that
indicates what to do (skip/mute) and when to do it (using pts in seconds).
</para>
<!-- ********** -->
<sect2 id="edl_using">
<title>Using an EDL file</title>
<para>
Include the <option>-edl <filename></option> flag when you run
<application>MPlayer</application>, with the name of the EDL file you
want applied to the video.
</para>
</sect2>
<!-- ********** -->
<sect2 id="edl_making">
<title>Making an EDL file</title>
<para>
The current EDL file format is:
<programlisting>[begin second] [end second] [action]</programlisting>
Where the seconds are floating-point numbers and the action is either
<literal>0</literal> for skip or <literal>1</literal> for mute. Example:
<programlisting>
5.3 7.1 0
15 16.7 1
420 422 0
</programlisting>
This will skip from second 5.3 to second 7.1 of the video, then mute at
15 seconds, unmute at 16.7 seconds and skip from second 420 to second 422
of the video. These actions will be performed when the playback timer
reaches the times given in the file.
</para>
<para>
To create an EDL file to work from, use the <option>-edlout
<filename></option> flag. During playback, just hit <keycap>i</keycap> to
mark the beginning and end of a skip block.
A corresponding entry will be written to the file for that time.
You can then go back and fine-tune the generated EDL file as well as
change the default operation which is to skip the block described by each line.
</para>
</sect2>
</sect1>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<sect1 id="advaudio" xreflabel="Advanced Audio">
<title>Advanced audio</title>
<sect2 id="advaudio-surround">
<title>Surround/Multichannel playback</title>
<sect3 id="advaudio-surround-DVD">
<title>DVDs</title>
<para>
Most DVDs and many other files include surround sound.
<application>MPlayer</application> supports surround playback but does not
enable it by default because stereo equipment is by far more common. To play a
file that has more than two channels of audio use <option>-channels</option>.
For example, to play a DVD with 5.1 audio:
<screen>mplayer dvd://1 -channels 6</screen>
Note that despite the name "5.1" there are actually six discrete channels.
If you have surround sound equipment it is safe to put the
<option>channels</option> option in your <application>MPlayer</application>
configuration file <filename>~/.mplayer/config</filename>. For example, to make
quadraphonic playback the default, add this line:
<programlisting>channels=4</programlisting>
<application>MPlayer</application> will then output audio in four channels when
all four channels are available.
</para>
</sect3>
<sect3 id="advaudio-surround-stereoinfour">
<title>Playing stereo files to four speakers</title>
<para>
<application>MPlayer</application> does not duplicate any channels by default,
and neither do most audio drivers. If you want to do that manually:
<screen>mplayer <replaceable>filename</replaceable> -af channels=2:2:0:1:0:0</screen>
See the section on
<link linkend="advaudio-channels-copying">channel copying</link> for an
explanation.
</para>
</sect3>
<sect3 id="advaudio-surround-passthrough">
<title>AC-3/DTS Passthrough</title>
<para>
DVDs usually have surround audio encoded in AC-3 (Dolby Digital) or DTS
(Digital Theater System) format. Some modern audio equipment is capable of
decoding these formats internally. <application>MPlayer</application> can be
configured to relay the audio data without decoding it. This will only work if
you have a S/PDIF (Sony/Philips Digital Interface) jack in your sound card.
</para>
<para>
If your audio equipment can decode both AC-3 and D
|