<HTML>
<HEAD>
<TITLE>MPlayer Tools Documetation</TITLE>
</HEAD>
<BODY>
<center><h1><b><u>MPlayer Tools</u></b></h1><font color=-1>Powered by:</font><br>
<a href="http://sourceforge.net"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=167791&type=1" width="88" height="31" border="0" alt="SourceForge.net Logo" /></a>
</center><br><br>
The main purpose of this package is to ease you the use of MPlayer.<br>
The sofware package focuses on four different areas:
<ol>
<li><a href='mcatcher'>mcatcher</a>
<ul>
<li><a href='mcatcher_cmd'>Available commands</a>
<li><a href='mcatcher_desc'>How it works</a>
<li><a href='mcatcher_log'>The mcatcher logfile</a>
<li><a href='mcatcher_conf'>The mcatcher config file</a>
<li><a href='mcatcher_series'>Movie series detection</a>
<li><a href='mcatcher_perl'>Optional PERL modules</a>
</ul>
<li><a href='tv'>TV utilities</a>
<ul>
<li><a href='tv_cmd'>Available commands</a>
<li><a href='tv_lirc'>Minimal lirc configuration</a>
<li><a href='tv_conf'>Configuration options</a>
</ul>
<li><a href='sub'>subtitle manipulations</a>
<li><a href='#stat'>statistical tools</a>
</ol>
<a name=mcatcher>1) <u>mcatcher</u></a><br> <p>The scripts automatically save the movie you are watching and next time start mplayer with the same movie from the saved position using a tiny `cdm;mstart' command. You don't even have to start the X server yourself. And there is more.</p>
<p><a name=mcatcher_cmd><u>Available commands</u></a><br>
<ul>
<li><b>mplayer</b><br>at install mplayer-tools overrides the mplayer command,
the new command starts the mcatcher utility and then it calls
the original mplayer to play the movie. If you have no running
X server, then it starts one and plays the movie on it
(if there is a running X server, it uses that one)
<li><b>mstart</b><br><ul><li>if you give parameters for mstart will behave like the mplayer command
except that it will force the position saving of the movie you start. (Otherwise
the movie position will be saved only if you watch the movie for more then 12 mins
or whatever is set into MCATCHER_MINTIME.)
<li>if the first parameter is `all' the behaviour described above is changed:
mstart will pass along only the files which are not yet played. This means that you can
watch a list of movies but you can start mplayer with the very same command every time. Ex:
<br> mplay all 1.avi 2.avi 3.avi 4.avi<br>
No matter how many times you quit the command will resume like if the four files
were only one stream. If no files are specified (only `mplay all') mstart works with all
media files from the current directory.<br>
You can use the -shuffle mplayer option to play the files in random order but in this case
the playback will not be continued with the file you stopped.
<li>without parameters mstart will start the first movie saved into ~/.mplayer/currentmovie
but only movies from the current directory. If there are no movies saved from the current
directory mstart will start the first movie from the current firectory in lexical order
which was not watched yet (according to the mcatcher logfile).</ul><br>
This description may sound confusig, but take a look at the following example:<br>
Let's say you have two files:<br>
/mnt/moviepartition/Movie 1/Movie CD1.avi<br>
/mnt/moviepartition/Movie 1/Movie CD2.avi<br>
If you type the following commands:<br>
cd /mnt/moviepartition/Movie\ 1/<br>
mstart<br>
you will watch the movie called "Movie CD1.avi". But let's say you don't have time to
finish the movie, so you exit mplayer and stop your computer. Then you start it again,
and you type the following commands:<br>
cdm<br>
mstart<br>
and "Movie CD1.avi" will continue. Now let's say "Movie CD1.avi" terminates. The next
mstart command (without any parameters) will start "Movie CD2.avi" if you are in the
/mnt/moviepartition/Movie 1/ directory.<br>
And what's even cooler is that you can say:<br>
cdm<br>
mstart all<br>
every time when you want to continue watching the two files and you don't have to type
another mstart command if "Movie CD1.avi" terminates (you don't have to stand up :-) )<br>
Hopefully you will find this clear and comfortable enough.
<li><b>mplay</b><br>This is an alias to mstart but it starts the mcatcher utility
in Player Mode. In this mode mplayer's output is supressed
and a more reticent output is displayed:<br>
[FLAGS] POS [LENGTH] REMAIN [BUFLEVEL]<br>
FLAGS are:<br>
S - mcatcher will save position<br>
D - position saving is disabled<br>
P - movie is paused<br>
B - A-V sync is broked<br>
Just try it and you will understand it. Be aware that Player Mode will not
work properly if you use the `quiet' or `really-quiet' mplayer options.
<li><b>mswitch</b><br>switches between Player Mode/normal display in the current terminal, except if you call
mplayer via mplay. It does NOT work with mc! You have to use it before you start mc.
<li><b>cdm</b><br>cd into the current movie's directory<br>
the scripts can save any number of movies<br>
you can type a number after the command i.e.<br>
cdm 1<br>
changes to the second movie but it also moves the
movie into the first position so mstart will start this movie from this directory
<li><b>mlist</b><br>lists all the saved movies and the associated numbers you can use with the cdm command. <li><b>mlists</b><br>lists your movie series, the number of watched episodes, the last episodes,
and (if you still have it in your mcatcher log file) the directories containing movie series.<br>
You can type a regex to narrow the listing, ex: mlists Desperate Housewives<br>
but saying "mlists despe" will probably do the same thing.
<li><b>cds</b><br>this is a wrapper to mlists. The last directory is not displayed but cd into.<br>
ex: "cds despe" will change directory to Desperate Housewives<br>
a simple cds without parameters will go to the last watched show.
<li><b>setxlayout</b><br>set the ServerLayout for xmplayer (by manipulating the environment)<br>
Server Layouts can be configured in your X config file.<br>
edit /etc/profile.d/mplayer-tools.sh to change the value permanently.<br>
The special value "off" disables xmplayer.
<li><b>msave</b><br>force position saving of the currently played movie.<br>
Put the following line in your ~/.mplayer/input.conf file:<br>
KP_ENTER run "msave"<br>
This way you will be able to force the position saving with a single keypress.
<li><b>mcancel</b><br>cancels any running timeouts and disables the position saving of the movies being
watched. Once you give this command no movie positions will be saved by the running
mcacther scripts except if you explicitely force it by an msave command.<br>
Maybe you want to put a line like<br>
ESC run "mcancel"<br>
into your input.conf file.
<li><b>mdisable</b><br>disable mcatcher temporarily only on the current terminal.<br>
When mcatcher is disabled the regex and shortcut options are still available
and the mplayeropts will still be passed for the existing movie series
but no new movie series will be detected.
<li><b>menable</b><br>enable mcatcher temporarily only on the current terminal. <li><b>mstrip</b><br>strips the mcatcher logfile. You might want to run this periodically if you use
maxloglines=0 in the mcatcher config file, maybe from a cron job.<br>
It's options are described under the mcatcher config file, global section.<br>
You can give parameters to mstrip. mstrip passes them to msum, a utility described under
the statistical tools. This way every line selected by the msum utility will be removed
from the logfile. You might want to run msum first to see which lines will be removed.
If you don't install the stat components the parameters will have no effect.
</ul>
<u>Internal commands</u>
<br>(a.k.a. use them only if you know what you are doing)
<ul>
<li><b>mcatcher</b><br>this is the wrapper script that saves the movie position.<br>
Use it if the wrapper bash function is not working (and send me a bug report). <li><b>xmplayer</b><br>also a wrapper but you can call it yourself too<br>
starts an X server without a window manager and starts playing the movie on it.<br>
Use it if you are already running an X server but for some reason
you want the movie to be started on a new X server.
<li><b>mgetdir</b><br>cdm calls it.<br>
Call it from the command line if you don't want to change directory<br>
but you want to clean ~/.mplayer/currentmovie from a deleted entry.
</ul></p>
<p><a name=mcatcher_desc><u>How it works</u></a><br> The msave command sends an ALRM signal to every instance of mcatcher. If there is no mcatcher running it sets the environment signalling to the next mcatcher that it has to save the movie position no matter how long you watch the movie. The menable and mdisable also operates the environment. Be aware that the environment `signalling' WILL NOT WORK OVER TERMINALS.<br> The mcatcher wrapper script analyses mplayer's output to determine the current file being played and the current movie position. The filename is saved into ~/.mplayer/currentmovie the position into an mplayer .conf file next to the movie or into your ~/.mplayer directory. The script decides to save the movie position on exit only if you watch the movie continuously for 12 mins (this value is configurable in /etc/profile.d/mplayer-tools.sh) or if you run the msave utility. The script signals that it will save the movie position with a message to stdout and with a flashing Scroll Lock led action using `xset led 3' commands. It also signals that A-V sync is broken with a continuously turned on Scroll Lock led.<br> MPlayer states the End Of File condition only on exit so if you play more media files with video streams from a single mplayer command (like `mstart all') you will need the -identify mplayer option for mcatcher so mcatcher can determine the movie's length and can determine whether you finished the movie or not. For example:<br> mplayer -identify MovieCD1.avi MovieCD2.avi<br> The audio-only files does not need the identify option if you use MPlayer 1.0pre8 or above.</p>
<p><a name=mcatcher_log><u>The mcatcher logfile</u></a><br> The mcatcher log file (~/.mplayer/mcatcher.log):<br> mcatcher logs every movie you watched. File format:<br> mplayer startup datetime|playtime|filename<br> You are free to delete any line at any time but be aware that mlists (and cds) uses this file to determine directories, mcatcher uses it to detect movie series and mstart/mplay uses it to determine which movie was not yet started. </p>
<p><a name=mcatcher_conf><u>The mcatcher config file</u></a><br>
The mcatcher config file (~/.mplayer/mcatcher):<br>
<ul>
<li>the [global] section:<ul>
<li>banneddirs<br>a list of directories (separated by :) where mcatcher prefers not to save movie .conf files.<br>
This is useful if don't want other people to see your conf file or if you have a directory
in your memory (like /dev/shm) where you copied a movie and you don't want to loose
the .conf file across a restart (remount). The .conf files will also not be saved in any
subdirectory i.e. if you set banneddirs=/ every .conf file will be saved into ~/.mplayer
<li>maxloglines<br>max how many lines to store in the logfile. 0 means infinite and it is somewhat faster but
you will have to clean the logfile either yourself or with mstrip because it will grow.<br>
mcatcher uses a minimum of 10 loglines.
<li>regex<br>examples:<br>
regex \.(avi|mpe?g?|wmv|asf|ogm|ram|m[o2]v|vob)$=-identify<br>
regex \.(mp3|ogg|wma|lse)$=-af equalizer=4:0:3:0:-3:-3:0:1:2:3<br>
regex ^(http|ftp|smb):=-cache 1024<br>
if a movie name matches this regex the options after the first `=' are passed to mplayer<br>
Be aware that all regex-es are evaluated for a movie, mcatcher does not stop after the first match.<br>
The first example enables the <i>identify</i> option for the movies so mcatcher will be able to determine
their length. (for audio-only files this is not necessary for MPlayer >= 1.0pre8)<br>
The second example enables the equalizer for the audio files. The values are set up for my speakers,
you might want to try other values.<br>
The third example sets the cache size for some livestreams.<br>
The first and second examples are added to config file by default.
<li>noseries<br>examples:<br>
noseries1=^Video-\d+-\d+(\d+)?\.avi$<br>
noseries2=^verycommonmovie_name<br>
You have to specify a decimal even if you have only one noseries option.<br>
The movies matching any of these options will never be treated as an episode.<br>
For example the first one matches the files created by tvrecord and it is added
to the config file by default.
<li>shortcut<br>You can configure shortcuts for some files or livestream so you can start them without
remembering their complete path/name. Example: if you put the following line in the config file:<br>
shortcut 1.fm=http://212.72.186.10:8050<br>
then typing the command:<br>
mplayer 1.fm<br>
will start "mplayer http://212.72.186.10:8050"
<li>term_width<br>Set it to the number of columns of your terminal. If you have installed the Curses perl module
this can be autodetected. The default value is the standard 80 chars.
<li>dcop_width<br>Set it to have max length for the kde window titles (using DCOP)<br>
If unset or less than 2 mcatcher uses unlimited.
<li>disable_led<br>Set this option to 1 if you don't want any led action (maybe conserving some CPU time) when
mcatcher states that it will save the movie position or when it signals the broken A/V sync
<li>pos_adjustment<br>
MPlayer cannot pinpoint the exact position in every types of movies so to make sure that
when you restart a movie the playback will continue from a point you already saw mcatcher
saves the current position minus 10 sec by default. This may also help you remember the movie
but if bothers you, set this value to 0. The default is -10 but you can set it to anything i.e.:
<table cellpadding=0 cellspacing=0 width=80%><tr><td rowspan=4> </td><td>pos_adjustment=-0.1</td><td rowspan=4> </td><td>to go backward just a tiny bit</td></tr>
<tr><td>pos_adjustment=-60</td><td>if you need a few seconds to remember the movie</td></tr>
<tr><td>pos_adjustment=10</td><td>to go forward in the movie (I don't see the point to use this but who knows)</td></tr>
<tr><td>pos_adjustment=0</td><td>disable this feature</td></tr></table>
<li>osdfont
Try xlsfonts. Default values are lightgreen,-misc-fixed-medium-r-normal--32-0-100-100-c-0-iso8859-1
<li>osd_timeout<br>Set the timeout for osd messages produced by mcatcher and mcounter. Set it to 0 to disable them completely.<br>
Note that mcounter's osd output cannot be disabled,
it will use the default value (which is 5 sec) if you try to disable it.
<li>rem_timeout<br>On the second launch of msave, mcatcher displays how many time remains from the current file
(or the current position if mcatcher is unable to determine the movie's length, try putting
identify=yes in your mplayer config file). This option sets the timeout while this is displayed.
The default is 5 sec, set it to 0 to disable this feature.
<li>mstrip_* <br>These are options used by the mstrip utility (evaluated in the order they are listed here):<ul>
<li>mstrip_removeinexistent<br>values are 1 or 0. If it's 1 then every movie that is deleted is also
removed from the log file. It's 0 (missing from the file) by default.
<li>mstrip_minlength<br>any entry shorter than this (playtime) will be removed from the log.
It's 60 (seconds) by default.
<li>mstrip_lastepisode<br>values are 1 or 0. If it's 1 then for every movie series found
in config file mstrip will keep only the last watched episode.<br>
This way cds will still work correctly.<br>
It is 0 by default so mstart/mplay will also work correctly.
<li>mstrip_gather<br>values are 1 or 0. If it's 1 then mstrip gathers all the entries describing
the same movie into one entry with the last date and with the summarized length.<br>
It's 1 by default.
<li>mstrip_maxsize<br>the maximal size of the logfile in kilobytes. The default is one megabytes (1024).</ul>
</ul>
<li>all the other sections:<br>
These are sections for movie series. Every one of them has three options:
<ul>
<li>episodelist<br>the episodes you already watched (mcatcher puts them there)
<li>display<br>mcatcher guesses the name of the series based on the filename.
You can override it with this option.<br>
This value will be used all the time even if the file has an 'Artist' Clip Info.
<li>mplayeropts<br>options to pass to mplayer.
mcatcher puts a default one when it creates the section, you might want to edit it.
<li>mintime<br>if playing an episode from this show and mcatcher is enabled than lower MCATCHER_MINTIME to this value
</ul>
</ul>
Note that any other (invalid) options in every section is also preserved (but not used or complained about).
</p>
<p><a name=mcatcher_series><u>Movie series detection</u></a><br>
The detection is based on filenames.<br>
The filename must be formatted like this (the parts in [] are optional):<br>
name [-] episode [anything].avi<br>
Examples:<br>
<i>Desperate Housewives - 1x15 - Impossible.avi<br>
Friends 312 - TOW All the Jealousy.avi<br>
Stargate.SG1.S09E06.Beachhead.avi</i><br>
If you have series in other (reasonable) format mail me!<br>
If you play a file in this format mcatcher checks you log file if you have already watched a movie
with the same name but with different episode. If you did then mcatcher creates the section for the movie.
</p>
<p><a name=mcatcher_perl><u>Optional perl modules</u></a><br>
You can get them from <a href='http://www.cpan.org/' target=blank>CPAN</a>.
<ul>
<li>Curses<br>
download and install it if you use the PlayerMode and you change your terminal's size.<br> If installed mcatcher autodetects the size at every startup so you don't have to edit the termwidth option every time you change your terminal's width.<br> The module is also used to clear the unused parts of the screen in PlayerMode at startup and by the moviesizes script. <li>Sys::Proctitle<br>
if you install it mcatcher will set it's proctitle to the currently played movie and hides the ugly parameter list.<br>You can see this with a command like this:<br> ps -Af|grep mcatcher|grep -v grep<br> or the apposite `cmdline' file in the proc filesystem. <li>Time::HiRes<br>
the moviesizes script estimates how much time it has left before it finishes it's job.<br> Download and install this module so that this estimation will be more precise. </ul></p>
<a name=tv>2) <u>TV utilities</u></a><br>
MPlayer has built-in v4l capabilities however I find it uncomfortable to use them.<br>
So here is a set of programs to make it easier.<br><br>
<a name=tv_cmd><u>Available commands</u></a>
<ul>
<li><b>tv</b><br>Start the TV Player.<br>
Use the option --tune or -t while you are searching for channels.
This option disables setting the channel names from your already existing
channel list file and disables tvconf's channel related options.<br>
In every other cases the parameters are considered as a TV channel name.
If the script find a channel with this name, starts it, otherwise the parameters
are evaluated as a regex to find the TV channel you want to watch.<br>
If the parameter list starts with -s or --set only the channel is set but there will
be no playback. This is useful to set the channel for a teletext browser like alevt.
Ex: <i>tv -s rtl klub && alevt</i>
<li><b>tvcancel</b><br>Force the scripts to abort immediately<br>
This is for emergencies if something goes wrong.
<li><b>tvserver</b><br>A really simple TV server for only one client.<br>
<u>Options:</u><br> -d or --daemon: start in background, supress stdout,
log stderr into either /var/log/tvserver.log or ~/.mplayer/tvserver.log<br>
-p or --port: use this port for incoming connections (default: 55555)<br>
-n or --card<br>
-c or --control: set volume to max,mute and select for capture the card
when new client arrives using amixer. Defaults to card 0, control Aux.<br>
Here are some examples showing how to connect to the tvserver:<br>
mplayer http://localhost:55555/<br>
mplayer http://linuxbox.net:55555/SR5
<li><b>tvchannels.cgi</b><br>This is a CGI script to advertise your TV server.<br>
It lists the channels and provides a playlist called tv.pls<br>
The clients must open them using: <i>mplayer -playlist tv.pls</i><br>
You have to copy or symlink this into a cgi-bin directory.<br>
You have to set the tvserver port and the channel list file
by hand on the beginning of the script.
<li><b>tvconf</b><br> A configuration file called ~/.mplayer/tvconfig holds a number
of configuration options. tvconf is a way to modify and check them.<br>
Some options like the brightness can be modified only when
the TV player is running to prevent accidental modifying.<br>
Some command line options (the others are described under TV Config Options):<br>
<table cellpadding=0 cellspacing=0><tr><td>
list [regex] </td><td> - </td><td> list number,channel,channel name of the channels
matching regex (or all of them if no regex specified)</td></tr><tr><td>
xosd </td><td> - </td><td> display using osd_cat a brief report in the following form:
</td></tr></table>
<center>Channel Name<br>
channel,brightness,contrast,saturation</center>
<li><b>tvrecord</b><br>Records TV programs. It has two presets: hi and low quality.
(ex: tvconf q hi) Type --help or -h for a quick usage info.<br>
Type the --silent (or -s or -q or --quiet) parameter
if you don't want to see what is being recorded (conserving CPU time).<br>
Type one moment to specify when to stop recording. Ex: tvrecord 21:20<br>
Type two moments to specify an interval. Ex: tvrecord 21:00 23:00<br>
You can also specify the channel (ex: SE16) to record
otherwise the last watched channel will be recorded.<br>
Any unrecognized parameter will be treated as a final command to execute
on the end of recording (but only if it reaches the timeout not if you
stop recording earlier). For example the command:<br>
tvrecord -s 21:00 23:00 SE16 'init 0'<br>
will wait until 9pm, record until the SE16 channel until 11pm then
it will shut down the computer if you have root privileges.<br>
If the recorded file's size reaches 4GB tvrecord will start another file
with the same name but with a postfix, ex: Video-20060704-223538_2.avi<br>
You probably want to reencode the recorded file(s) because
the hi preset is 640x480 6000kbit mpeg2 and
the lo preset is 512x384 3000kbit mpeg2.<br>
For example use the following script to reencode your files
(maybe you want to lessen the vbitrate):<pre>
#!/bin/sh
file="Video-20060704-223538.avi"
encodepar="-force-avi-aspect 4:3 -vf hqdn3d=2:1:2 -ovc lavc -lavcopts vbitrate=1400:mbd=1:trell:v4mv"
mencoder "$file" $encodepar:turbo:vpass=1 -oac copy -o /dev/null
mencoder "$file" $encodepar:vpass=2 -oac copy -o "Reencoded-$file"
rm -f divx2pass.log
</pre>
<li><b>tvtimeshift</b><br>TV Time Shifting. Start it, press the pause button
and you can go to the bathroom without missing anything :-)<br>
If you have a memory FS, you can use it to spare your hdd.<br>
EX: tvconf memdir /tmp OR tvconf memdir /dev/shm<br>
Unfortunately you cannot seek while timeshifting or recording.<br>
Try using the speed_set command as a fast forward, but be aware that
the speed_set command may result in really high CPU usage which will
ultimately cause mencoder to drop video or even audio frames.<br>
The script deletes immediately the already watched parts of the
tv program so it uses only as many disk space (or RAM) as you are timeshifted.
<li><b>tvtsinfo</b><br>Displays approximately how much you are timeshifted.<br>
The parameter -q or --quiet suppresses the error message when
tvtimeshift is not running.
<li><b>tvvolume</b><br>MPlayer prefers to pass the sound directly from TV tuner to your
soundcard. Configure the card number and the mixer control using
tvconf (defaults: card=0 and control=Aux) and this script allows you
to control the volume of the sound. It also draws a lame looking slide.
If you don't see the slide, you probably don't have the specified font.
Open tvvolume and edit the osd_cat font value. Try xlsfonts.
</ul>
<a name=tv_lirc><u>Recommended minimal lirc configuration</u></a><br>
I recommend the following minimal lirc configuration. You can put them for example in your ~/.lircrc file.
<br>You may need to change the button names as this configuration was created for my remote.
<pre>
begin
button = REC
prog = mplayer
config = run tvrecord\nquit
end
begin
button = TIMESHIFT
prog = mplayer
config = run tvtimeshift\nquit
end
begin
button = STOP
prog = mplayer
config = run "killall -q -INT tvtimeshift tvrecord"\nquit
end
begin
button = DISPLAY
prog = mplayer
config = run "tvtsinfo -q"
end
begin
button = ENTER
prog = mplayer
config = run "tvconf xosd"
end
begin
button = VOL_UP
prog = mplayer
config = run "tvvolume +"
end
begin
button = VOL_DOWN
prog = mplayer
config = run "tvvolume -"
end
begin
button = SNAPSHOT
prog = mplayer
config = screenshot\nosd_show_text ">>> SCREENSHOT"
end
begin
button = BOSS_KEY
prog = mplayer
config = run "mcounter;xset dpms force standby;xset +dpms"\npause
config = seek -10\nrun "xset dpms force on;xset -dpms;killall -q -HUP mcounter"
end
</pre>
Please refer to lirc documentation (http://www.lirc.org/) if you don't know what these lines mean.<br> Of course this is very basic, you might also want to put another <i>config=volume +1</i> and <i>config=volume -1</i> entries with a different buttons or in a different mode.<br><br>
<a name='tv_conf'><u>Configuration Options</u></a><br>
(to use with tvconf):
<ul>
<li><b>brightness</b>, <b>contrast</b>, <b>saturation</b>:<br>example of usage:
<pre>
begin
button = GREEN
prog = mplayer
config = run "tvconf brightness -20"\nosd_show_text "TV Brightness: -20"\ntv_set_brightness -20
config = run "tvconf brightness 0"\nosd_show_text "TV Brightness: 0"\ntv_set_brightness 0
end
</pre>
<li><b>dir</b><br>a place to save images, videos, thimeshift chunks.
<li><b>memdir</b>,<b>control</b>,<b>card</b>,<b>q</b><br>These options are explained above.
<li><b>pp</b><br>image postprocessing filter to use. The default is<br> lb/ha/va/dr/tn:128:256:512/al:f<br> which makes a pretty good job.
<li><b>chlist</b><br>filename containing the list of channels. Must contain lines like: <pre>SR7 National Geographic</pre>
<li><b>vo</b><br>video output to use with TV. Currently accepts only sdl, xv or x11
<li><b>xlayout</b><br>X server layout to use when starting new X servers (the same effect as setxlayout has on mcatcher)
<li><b>lircconf</b><br>if you want to use a different lirc config file for the tv player here is the place to set it's filename
<li><b>osdcolor</b>,<b>osdfont</b><br>color and font passed to osd_cat (to display channel,volume,timeshift info).<br>
Try xlsfonts. Default values are lightgreen,-misc-fixed-medium-r-normal--32-0-100-100-c-0-iso8859-1
<li><b>+</b>,<b>-</b>,<b>@</b><br>next channel,previous channel and recall channel. Example:
<pre>
begin
button = CH_UP
prog = mplayer
config = tv_step_channel 1\nrun "tvconf +"
end
begin
button = CH_DOWN
prog = mplayer
config = tv_step_channel -1\nrun "tvconf -"
end
begin
button = RECALL
prog = mplayer
config = tv_last_channel\nrun "tvconf @"
end
</pre>
<li>And finally you can use channel presets like this:
<pre>
begin
button = 9
prog = mplayer
config = tv_set_channel 50\nrun "tvconf 50"
end
</pre>
which will jump to the 50th item in the channel list file.
</ul>
<a name=sub>3) <u>Subtitle manipulation scripts</u></a><br>
<ul>
<li><b>sub2srt</b><br>a simple script that converts a .sub into an .srt<br>
usage:<br>
sub2srt [framerate] file [[framerate] file ...]<br>
The default framerate is 23.976<br>
<li><b>srtshift</b><br>see srtshift --help for a list of parameters<br>
Examples:<br>
shift with 2 seconds:<br>
srtshift 2 subtitles.srt<br>
shift with -2 seconds starting from 21 minutes<br>
srtshift -2 21:00 subtitles.srt<br>
change fps and put the result in output.srt<br>
srtshift 23.976-25 subtitles.srt output.srt<br>
Sometimes the only problem with an SRT is that it was converted from a SUB with the
wrong fps value. In this case either 23.976-25 or 25-23.976 will correct the file.
If not, try different combinations with framerates 23.976, 24, 25 and 29.97<br>
Some subtitle files contain really long lines that can take up the whole screen.
In this case try breaking these long entries like this:<br>
srtshift -b subtitles.srt<br>
This feature is very experimental. The script can decide at which charater to break the long
entry but there is no way it could determine correctly where to break the time interval
so try using:<br>
srtshift -b -m subtitles.srt<br>
which will leave a strange looking mark at every broken subtitle.<br>
Now you can adjust the timing by hand. When you are done a simple<br>
srtshift subtitles.srt<br>
will remove the marks.<br>
<li><b>srtadjust</b><br>sometimes to correct a subtitle file you would have to say for example:<br>
srtshift 13.42 29.97-23.976 subtitles.srt<br>
These parameters are really hard to guess or calculate. In this case:<br>
cp subtitles.srt subtitles.csrt<br>
Then open subtitles.csrt with a text editor and on the beginning of the file
put a line containing 4 time values for example:<pre>00:00:55,522 00:02:46,410 01:36:59,580 01:47:30,400</pre>
The first 2 means where the first entry starts and where it should start,<br>
the last 2 means where the last entry starts and where it should start.<br>
You can determine these values by watching the movie's beginning and end.<br>
There is no need to put exactly the first and last entries but the longest the
distance between the entries the more precise the adjustment will be.<br>
When you are done just type:<br>
srtadjust<br>
and the subtitles.srt file will contain the correct subtitle file.<br>
Of course this only works if the subtitle file was created for the movie version you have.<br>
If there are extra or missing subtitles in the file your work is not over yet.
</ul>
<a name=stat>4) <u>Statistical tools</u></a><br>
<ul>
<li><b>mcounter</b><br>a small script that measures a time interval until it receives
a HUP signal, then displays the measured time using osd_cat.<br>
For an example of usage see the BOSS_KEY above.
<li><b>msum</b><br>summarizes the second entries (playtime) from your mcatcher.log file.
You can give any number of regular expressions to filter the summarized entries. Example:<br>
msum 'Stargate SG1' '!3x'<br>
summarizes all watched Stargate episodes except season 3.<br>
msum 'comedy|action'<br>
summarizes all movies containing (in the filename) either `comedy' or `action'.<br>
Dirnames in the regexes are normalized to their full path.
For example if you are in the /mnt/Movies/ directory then:<br>
msum ./Friends.+avi<br>
has the same effect as<br>
msum /mnt/Movies/Friends.+avi<br>
Use the --head or -h and --tail or -t options summarize only the first or last part of the
results. They can be repeated as many times as you want, i.e.:<br>
msum --head 100 -t 3 --head 1<br>
If you give a negative number to the head or tail parameter it will be interpreted as the
number of total lines minus the parameter ex:<br>
msum -h -1<br>
will summarize every entry except the last one.
<li><b>moviesize</b><br>creates a file called moviesizes.txt in the current directory. The file will contain a list
of movie files and/or directories containing movie files together with their properties
sorted by length. Just go to a directory containing movies/music or a directory containing
subdirectories with movies (movies broken into several files generaly are stored
in one directory), type moviesizes and you will understand.
</ul>
This is the whole story in a nutshell. If you find any bugs (which you probably will) or have any ideas regarding to the package, do not hesitate to contact me. My email address can be found in the AUTHORS file in the package.
<hr>
mplayer-tools Copyright © 2006 Soos Gergely<br>
mplayer-tools comes with ABSOLUTELY NO WARRANTY.<br>
This is free software, and you are welcome to redistribute it under certain conditions.<br><br>
</BODY>
</HTML>
