1 README for the TOOLS directory
2 ==============================
7 In this directory you can find some nice scripts and code that makes
8 using MPlayer and MEncoder easier, for example scripts for DVD track
9 encoding in three pass mode or creating SVCDs from a movie.
11 FIXME: Document the following tools:
16 MPlayer scripts in the TOOLS dir
17 --------------------------------
19 edgedetect.fp, emboss.fp
21 Author: Reimar Döffinger
23 Description: Examples of custom fragment program for OpenGL video out driver
25 Usage: mplayer -vo gl:yuv=4:customprog=edgedetect.fp
30 Author: Tobias Diedrich
32 Description: Runs 'mplayer -identify' for all arguments while preventing
33 video window flashing.
35 Usage: midentify.sh file1 [file2 ...]
42 Description: Script to run MPlayer on the console (fbdev/mga_vid/etc.) without
43 the console text and/or flashing cursor getting in the way.
45 Usage: mpconsole.sh [mplayer options]
50 Author: Reimar Döffinger
52 Description: Example how to output video on multiple windows in sync. Might
53 be even more useful in combination with -vo ggi to distribute
54 the video arbitrarily.
56 Usage: mplmult.sh <n> <options>
57 n Number of MPlayer instances that display the video.
58 options Any options you would pass to MPlayer, more than
59 one file will usually not work.
64 Author: Alex Beregszaszi
66 Description: Collects subtitle files from the directory given as argument
67 ('.' if none is given) and its subdirectories and prints
68 them as a comma separated list to stdout.
70 Usage: subsearch.sh [directory]
71 mplayer -sub `subsearch.sh` movie
78 Description: Converts WMA files to Ogg or MP3.
80 Usage: wma2ogg [options] <-f FILE1 | -f FILE2 ... | -a>
82 -a converts all WMA files in the current directory
83 -t output filetype (ogg, mp3) [default=ogg]
84 -lame I wanna use L.A.M.E. sure enough!
85 -br bitrate (kb/s) [default=from the WMA]
86 -del remove WMA file(s) after the transcoding
90 MEncoder scripts in the TOOLS dir
91 ---------------------------------
97 Description: A simple utility that creates an SVCD from a video in an AVI
100 Usage: divx2svcd.sh <input_avi> [options]
101 see 'divx2svcd.sh -h' for more info
106 Author: Jürgen Hammelmann
108 Description: Converts DVD (or anything else that MPlayer plays) to (S)VCD
110 Usage: mencvcd.sh <basename> [mencvcd.sh options] [mplayer options]
111 see 'mencvcd.sh -h' for more info
113 Note: Requires MPlayer, mjpegtools, VCDImager, cdrdao, and optionally
114 LAME, tooLAME and SoX.
119 Author: Florian Schilhabel
121 Description: Yet another DVD to divx helper script.
122 This script encodes a DVD track in three pass mode to MPEG-4 with
123 libavcodec. Optionally it writes the resulting movie file to
124 CD-ROM the corresponding audio track to MP3. It can also shut
125 down the computer when it finishes. If you like, you can
126 watch the MEncoder output on /dev/tty8.
128 Usage: --help show help
129 --abr (AudioBitRate) Please enter the desired bitrate this
130 can be either [96|128|192] kbit/sec (default: 128).
131 --lang Specify the Language of the audio track this can be
132 for example <en> or <de> (default: <de>).
133 --dvd Specify the DVD track you want to encode.
134 --cdsize Specify the size of your CD-ROM (default: 700MB).
135 --shutdown Shutdown the system, when the encoding process has
136 finished. Needs appropriate privileges.
137 --out Specify the name of your encoded movie. The file
138 extension will be appended automatically.
139 --writecd Takes the newly created movie and writes it to a
141 --writedev cdrecord device identifier, for example 0,1,0
142 --speed writing speed (default: 4)
143 --dvd-device device to pull the video off (default: /dev/dvd)
148 Author: Jonas Jermann
150 Description: A hack to allow MEncoder to read respectively encode from audio
153 Usage: aconvert.sh <"input file"> <"output file"> <"options">
154 If no options are specified the following is assumed:
155 -oac lavc -lavcopts acodec=mp3:abitrate=192
157 Note: The script is probably bash dependent and it's just a quick
158 hack, feel free to improve it (or much better: fix MEncoder ;).
164 Author: Reynaldo H. Verdejo Pinochet
166 Description: converter from any supported format to VCD/SVCD PAL/NTSC
168 Usage: qepdvcd.sh file <options>
169 Run with no arguments to see the list of options.
171 Note: You will need vcdimager/cdrecord to master/burn the resulting
176 Tech scripts in the TOOLS dir
177 -----------------------------
181 Author: Moritz Bunkus
183 Description: A script that calculates the $bpp for a movie, mentioned in
184 DOCS/tech/encoding-tips.txt, see that document for more info.
186 Usage: calcbpp.pl <resolution> <aspect ratio> <bitrate> <fps>
187 resolution: the cropped but unscaled resolution
188 (use '-vf cropdetect')
189 aspect ratio: the encoded aspect ratio. All DVDs come at
190 720x576 but contain a flag that tells the player
191 wether it should display the DVD at an aspect
192 ratio of 4/3 (1.333) or at 16/9 (1.777). Have a
193 look at MPlayer's output - there's something
194 about 'prescaling'. That's what you are looking
196 bitrate: the video bitrate in kbit/s
199 example: calcbpp.pl 720x440 16/9 896 25
204 Author: Moritz Bunkus
206 Description: Counts the quantizers used for the encoding, mentioned in
207 DOCS/tech/encoding-tips.txt, see that document for more info.
209 Usage: countquant.pl < divx2pass.log
210 It will print out which quantizer was used how often. If you see
211 that e.g. the lowest quantizer (vqmin=2) gets used for > 95% of
212 the frames then you can safely increase your picture size.
217 Author: Jonas Jermann
219 Description: Draw PSNR log graphs using gnuplot.
221 Usage: plotpsnr.pl [options] <file>
222 -h, --help Display this help message
223 -quant Display quantizers
226 -iframes Display I-frames
227 -pframes Display P-frames
228 -bframes Display B-frames
229 -aframes Display all frames in different colors
230 -cmp <file2> Compare two files
231 -qs <style> Quantizer style
232 -ss <style> Size style
233 -ps <style> PSNR style
235 Default: -quant -size -psnr -qs "p" -ss "i" -ps "p"
237 Note: Requires gnuplot. Comparison is based on file2. Comparison
238 assumes that the frame numbers of both files fit.
243 Author: Matthias Wieser
245 Description: Calculates the PSNR between two existing video files.
246 The PSNR is calculated frame by frame.
247 Also prints the overall PSNR.
248 The script can be used to:
249 * Compare different softwarescalers (should I use
251 * Compare different resolutions (is it better to scale
252 down to 640x360 or to 560x320)
253 * Compare different deinterlacers
254 * Compare different video codecs
255 * Compare video filters (is it better to use -vf hqdn3d
259 Usage: psnr-video.sh <file1> <file2> [<frames>] [<options1>] [<options2>]
261 <file1> and <file2> are the video files for which the PSNR
262 should be calculated.
263 [<frames>] is the number of frames to process, starting
265 [<options1>] are additional MPlayer options for <file1>
266 [<options2>] are additional MPlayer options for <file2>
268 A file called ./psnr.dat will be created with the following
272 00000001.ppm;34.23;39.54;40.06;35.426
273 00000002.ppm;33.03;38.71;39.26;34.271
274 00000003.ppm;33.45;38.91;39.28;34.655
275 00000004.ppm;32.72;38.69;38.85;33.972
277 00000247.ppm;35.55;40.84;42.15;36.785
280 Note: This script relies on the the tool "pnmpsnr" for the
281 frame-by-frame PSNR calculation.
282 Be aware that psnr-video.sh needs a lot of temporary space
290 Description: a simple ASF header display program
292 Usage: asfinfo <filename.asf>
294 Note: Also see MPlayer's -identify option.
301 Description: A simple tool to fix chunk sizes in RIFF AVI files.
303 Usage: avi-fix [-fix] <badfile.avi>
305 Note: It does not check or fix the index, to do this use
306 'mencoder -forceidx -oac copy -ovc copy'.
311 Author: Ivo van Poorten
313 Description: Check the source tree for anomalies.
315 Usage: checktree.sh -help
317 Note: This script is meant for developers to check the current
318 source tree and/or the patches they are working on.
325 Description: Check console message translations for common errors.
327 Usage: mphelp_check.py [--missing] <master file> <files to check>
329 Note: Compares MPlayer translation files against a master file and
330 reports conflicting arguments, extra strings not present in
331 the base file and (optionally) missing strings.
338 Description: the prototype ../cpuinfo.c
340 Note: Used by configure to emulate /proc/cpuinfo on non-Linux systems.
347 Description: MPEG4-ES stream inspector, dumps the stream startcodes.
352 Author: Felix Bünemann
354 Description: benchmark/testbed for fastmemcpy stuff
356 Note: Also see fastmem.sh.
363 Description: Show QuickTime MOV file structure.
365 Usage: movinfo <filename.mov>
372 Description: Dump H.263 frame headers from VIVO files.
374 Usage: vivodump <input_file> <output_file>
378 Miscellaneous scripts in the TOOLS dir
379 --------------------------------------
383 Author: Michael Klepikov
385 Description: A script for pipelined editing of subtitle files.
387 Usage: subedit.pl [switches]
388 -if,--input-format <fmt> input format; supported: SRT (default: SRT)
389 -of,--output-format <fmt> output format; supported: SRT
390 (default: input format)
391 -s,--shift <time> shift all subtitles by <time>
392 (format: [-]hh:mm:ss,fraction)
393 -c,--scale <time> scale by adding <time> to overall duration
394 -f,--split-from <time> drop subtitles that end before <time>
395 -t,--split-to <time> drop subtitles that start after <time> (will
396 truncate timing if it overlaps a boundary)
397 -r,--renumber renumber SRT subtitles in output
398 -d,--debug enable debug output
399 -h,--help help message
406 Description: This script will use the Windows Media Player codec download
407 infrastructure to aquire the codecs listed in codecs.conf and put
408 them in a directory named "codecs/" below the current directory.
410 Usage: w32codec_dl.pl <codecs.conf location>
412 Note: You will need the libwww-perl stuff and the cabextract utility
413 which can be found at http://www.kyz.uklinux.net/cabextract.php3.
418 Author: Andrea Menucci, thuglife
420 Description: Downloads binary codecs from mplayerhq.hu and installs them
423 Usage: binary_codecs.sh install
424 binary_codecs.sh uninstall
431 Description: Adjust the time-info in vobsub files
433 Usage: vobshift.py in.idx out.idx +8.3
434 Will shift the time by 8.3 seconds
439 Author: Kim Minh Kaplan
441 Description: Transform VOBsub subtitles into Subrip text subtitles using
444 Usage: subrip <vobsub basename> [subid [output filename] ]
446 Note: Requires at least JOCR/GOCR 0.37.
447 You will have to change the 'vobsub_id' value if you want a
448 subtitle different from number 0. Hint: You can view the
449 subtitle that is being decoded with "display subtitle-*.pgm".
456 Description: Generates alaw/ulaw tables.
458 Note: Created to work around a past license issue, no longer useful.
463 Author: Tobias Diedrich
465 Description: Dumps vobsub soft subtitles streams embedded in AVI files.
467 Usage: avisubdump <movie.avi>
472 Author: Gianluigi Tiesi
474 Description: Creates a codec settings file from the Video for Windows codecs
475 found in the mplayer codec packs.
477 Usage: vfw2menc -f <fourcc> -d <codec.dll> -s <settingsfile.mcf>
478 -h|--help - displays this help
479 -d|--driver filename - dll or drv to load
480 -f|--fourcc fourcc - fourcc of selected driver
481 -s|--save filename - save settings to file
482 -c|--check filename - load and show setting in filename
483 -v|--view - displays the config dialog and do nothing
485 Notes: Works on Windows/Linux x86 only.
492 Description: Modifies registry file (usually ~/.mplayer/registry)
494 Usage: modify_reg -r <registry_file> -l
495 modify_reg -r <registry_file> -k <key> [-d|-v <value>[-t <type>]]
496 -r|--registry - path to registry file
497 -l|--list - shows all keys and values
498 -k|--key - registry key
499 -d|--del - delete key
500 -v|--value - new value for key
501 -t|--type - key type: string (default) or dword
503 Notes: Necessary to use CoreAVC with MPlayer
508 Author: Michael Niedermayer
510 Description: Simple file compare program that detects the number of rounding
511 errors and dies if the error is too large.
513 Usage: compare <file1> <file2>
518 Author: miscellaneous
520 Description: Wrappers for Linux Real binary codecs used to analyze, alter and
521 dump the data flow between RealPlayer and its codecs.
523 Usage: - Set the path to the RealPlayer codecs directory in the C files.
524 - Run 'make realcodecs'.
525 - Rename the original codecs to match the names expected in the
526 wrapper sources. The default is to give them a "real" prefix,
527 e.g. realcook.so.6.0.
528 - Put the wrappers in the RealPlayer codecs directory.
530 Notes: Known to work at least on Linux x86 with RealPlayer8.
534 netstream - access remote streams
535 ---------------------------------
537 netstream allows you to access most MPlayer stream types from a remote host.
538 The main purpose of this feature is to make it possible to directly use the
539 CD or DVD drive of another computer on the network (provided you have the
540 required bandwidth). On the downside some stream types (currently TV and MF)
541 are not usable remotely because they are implemented at the demuxer level.
543 Be aware that currently the server is not secure at all.
545 Compile the server by running 'make TOOLS/netstream' ('make TOOLS/netstream.exe'
546 on windows) from the root of mplayer source and then copy the netstream binary
547 to the right place on your system (usually /usr/local/bin on Unix). Start the
548 netstream server on the computer you intend to access remotely. There are no
549 command line arguments.
551 Play the second track of a VCD on the server with:
553 mplayer -cache 5000 mpst://servername/vcd://2
555 Access files on this server with:
557 mplayer -cache 5000 mpst://servername//usr/local/movies/lol.avi
559 Note that paths which do not start with a / will be interpreted as relative to
560 the directory where the server is running. The '-cache' option is not needed
561 but highly recommended.
563 netstream will not take -dvd-device, so you must either symlink
564 your drive to /dev/dvd/ or use the dvd:///path/to/dvd.
565 for example: mpst://audioserver/dvd:////dev/optical/lg_black_dvd