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 all the stuff in the subdirectories.
15 MPlayer scripts in the TOOLS dir
16 --------------------------------
20 Author: Tobias Diedrich
22 Description: Runs 'mplayer -identify' for all arguments while preventing
23 video window flashing.
25 Usage: midentify file1 [file2 ...]
32 Description: Script to run MPlayer on the console (fbdev/mga_vid/etc.) without
33 the console text and/or flashing cursor getting in the way.
35 Usage: mpconsole [mplayer options]
40 Author: Reimar Döffinger
42 Description: Example how to output video on multiple windows in sync. Might
43 be even more useful in combination with -vo ggi to distribute
44 the video arbitrarily.
46 Usage: mplmult.sh <n> <options>
47 n number of MPlayer instances that display the video
48 options any options you would pass to MPlayer, more than
49 one file will usually not work
54 Author: Alex Beregszaszi
56 Description: Collects subtitle files from the directory given as argument
57 ('.' if none is given) and its subdirectories and prints
58 them as a comma separated list to stdout.
60 Usage: subsearch.sh [directory]
61 mplayer -sub `subsearch.sh` movie
68 Description: Converts the subtitles in the current directory into MPsub
69 format (subtitles go in ./converted-subtitles/).
76 Author: Felix Bünemann
78 Description: Small helper script that allows to play multiple files with
79 MPlayer. Wildcards are supported.
81 Usage: mp.pl <parameters> <files>
82 Where <parameters> are all possible command line switches
83 for MPlayer and <files> can be either a list of files,
84 like file1 file2 file3 and/or a wildcard definition,
87 example: mp.pl -vo x11 /dvd/VIDEO_TS/VTS_05_*.VOB movie.asf
94 Description: Converts WMA files to Ogg or MP3.
96 Usage: wma2ogg [options] <-f FILE1 | -f FILE2 ... | -a>
98 -a converts all WMA files in the current directory
99 -t output filetype (ogg, mp3) [default=ogg]
100 -lame I wanna use L.A.M.E. sure enough!
101 -br bitrate (kb/s) [default=from the WMA]
102 -del remove WMA file(s) after the transcoding
106 MEncoder scripts in the TOOLS dir
107 ---------------------------------
113 Description: A simple utility that creates an SVCD from a video in an AVI
116 Usage: divx2svcd <input_avi> [options]
117 see 'divx2svcd -h' for more info
122 Author: Felix Bünemann
124 Description: Helper script to ease MEncoder two pass encoding. Give it all
125 the encoding parameters you would pass to mencoder, but leave
126 out the (v)pass=<n> suboption.
128 Usage: menc2pass <options>
133 Author: Jürgen Hammelmann
135 Description: Converts DVD (or anything else that MPlayer plays) to (S)VCD
137 Usage: mencvcd <basename> [mencvcd options] [mplayer options]
138 see 'mencvcd -h' for more info
140 Note: Requires MPlayer, mjpegtools, VCDImager, cdrdao, and optionally
141 LAME, tooLAME and SoX.
146 Author: Florian Schilhabel
148 Description: Yet another DVD to divx helper script.
149 This script encodes a DVD track in three pass mode to MPEG-4 with
150 libavcodec. Optionally it writes the resulting movie file to
151 CD-ROM the corresponding audio track to MP3. It can also shut
152 down the computer when it finishes. If you like, you can
153 watch the MEncoder output on /dev/tty8.
155 Usage: --help show help
156 --abr (AudioBitRate) Please enter the desired bitrate this
157 can be either [96|128|192] kbit/sec (default: 128).
158 --lang Specify the Language of the audio track this can be
159 for example <en> or <de> (default: <de>).
160 --dvd Specify the DVD track you want to encode.
161 --cdsize Specify the size of your CD-ROM (default: 700MB).
162 --shutdown Shutdown the system, when the encoding process has
163 finished. Needs appropriate privileges.
164 --out Specify the name of your encoded movie. The file
165 extension will be appended automatically.
166 --writecd Takes the newly created movie and writes it to a
168 --writedev cdrecord device identifier, for example 0,1,0
169 --speed writing speed (default: 4)
170 --dvd-device device to pull the video off (default: /dev/dvd)
175 Author: Jonas Jermann
177 Description: A hack to allow MEncoder to read respectively encode from audio
180 Usage: aconvert <"input file"> <"output file"> <"options">
181 If no options are specified the following is assumed:
182 -oac lavc -lavcopts acodec=mp3:abitrate=192
184 Note: The script is probably bash dependent and it's just a quick
185 hack, feel free to improve it (or much better: fix mencoder ;).
191 Author: Reynaldo H. Verdejo Pinochet
193 Description: anything supported to VCD/SVCD PAL/NTSC converter
195 Usage: qepdvcd.sh file <options>
196 Run with no arguments to see the list of options.
198 Note: You will need vcdimager/cdrecord to master/burn the resulting
205 Author: Giacomo Comes
207 Description: Convert anything MPlayer can play to VCD/SVCD/DVD mpeg
209 Usage: encode2mpeglight -o <NAME> -n <NORM> [options] <source>
210 For help and documentation run:
213 encode2mpeglight -doc
215 Note: This script uses only MEncode/MPlayer. Check the final log
216 file for informations/warnings about the encoding process.
219 Tech scripts in the TOOLS dir
220 -----------------------------
226 Description: benchmark/testbed for fastmemcpy stuff
233 Author: Michael Niedermayer
235 Description: Very simple script to generate PNG images from a video with all
238 Usage: sws-test <video-file> <start-pos> <res>
240 example: sws-test abc.avi 10 160:120
245 Author: Moritz Bunkus
247 Description: A script that calculates the $bpp for a movie, mentioned in
248 DOCS/tech/encoding-tips.txt, see that document for more info.
250 Usage: calcbpp.pl <resolution> <aspect ratio> <bitrate> <fps>
251 resolution: the cropped but unscaled resolution
252 (use '-vf cropdetect')
253 aspect ratio: the encoded aspect ratio. All DVDs come at
254 720x576 but contain a flag that tells the player
255 wether it should display the DVD at an aspect
256 ratio of 4/3 (1.333) or at 16/9 (1.777). Have a
257 look at MPlayer's output - there's something
258 about 'prescaling'. That's what you are looking
260 bitrate: the video bitrate in kbit/s
263 example: calcbpp.pl 720x440 16/9 896 25
268 Author: Moritz Bunkus
270 Description: Counts the quantizers used for the encoding, mentioned in
271 DOCS/tech/encoding-tips.txt, see that document for more info.
273 Usage: countquant.pl < divx2pass.log
274 It will print out which quantizer was used how often. If you see
275 that e.g. the lowest quantizer (vqmin=2) gets used for > 95% of
276 the frames then you can safely increase your picture size.
281 Author: Felix Bünemann
283 Description: fastmemcpy benchmark script
290 Author: Jonas Jermann
292 Description: Draw PSNR log graphs using gnuplot.
294 Usage: plotpsnr.pl [options] <file>
295 -h, --help Display this help message
296 -quant Display quantizers
299 -iframes Display I-frames
300 -pframes Display P-frames
301 -bframes Display B-frames
302 -aframes Display all frames in different colors
303 -cmp <file2> Compare two files
304 -qs <style> Quantizer style
305 -ss <style> Size style
306 -ps <style> PSNR style
308 Default: -quant -size -psnr -qs "p" -ss "i" -ps "p"
310 Note: Requires gnuplot. Comparison is based on file2. Comparison
311 assumes that the frame numbers of both files fit.
316 Author: Matthias Wieser
318 Description: Calculates the PSNR between two existing video files.
319 The PSNR is calculated frame by frame.
320 Also prints the overall PSNR.
321 The script can be used to:
322 * Compare different softwarescalers (should I use
324 * Compare different resolutions (is it better to scale
325 down to 640x360 or to 560x320)
326 * Compare different deinterlacers
327 * Compare different video codecs
328 * Compare video filters (is it better to use -vf hqdn3d
332 Usage: psnr-video.sh <file1> <file2> [<frames>] [<options1>] [<options2>]
334 <file1> and <file2> are the video files for which the PSNR
335 should be calculated.
336 [<frames>] is the number of frames to process, starting
338 [<options1>] are additional MPlayer options for <file1>
339 [<options2>] are additional MPlayer options for <file2>
341 A file called ./psnr.dat will be created with the following
345 00000001.ppm;34.23;39.54;40.06;35.426
346 00000002.ppm;33.03;38.71;39.26;34.271
347 00000003.ppm;33.45;38.91;39.28;34.655
348 00000004.ppm;32.72;38.69;38.85;33.972
350 00000247.ppm;35.55;40.84;42.15;36.785
353 Note: This script relies on the the tool "pnmpsnr" for the
354 frame-by-frame PSNR calculation.
355 Be aware that psnr-video.sh needs a lot of temporary space
363 Description: a simple ASF header display program
365 Usage: asfinfo <filename.asf>
367 Note: Also see MPlayer's -identify option.
374 Description: A simple tool to fix chunk sizes in RIFF AVI files.
376 Usage: avi-fix [-fix] <badfile.avi>
378 Note: It does not check or fix the index, to do this use
379 'mencoder -forceidx -oac copy -ovc copy'.
386 Description: Extract your PC BIOS and save it to file.
388 Usage: As argument requires DOS interrupt number in hexadecimal form.
389 As output - will write 64KB file which will named:
391 where: SSSS - segment of BIOS interrupt handler
392 OOOO - offset of BIOS interrupt handler
393 XX - interrupt number which was passed as argument
398 Author: Ivo van Poorten
400 Description: Check the source tree for anomalies.
402 Usage: checktree.sh -help
404 Note: This script is meant for developers to check the current (CVS)
405 source tree and/or the patches they are working on.
412 Description: Check console message translations for common errors.
414 Usage: mphelp_check.py [--missing] <master file> <files to check>
416 Note: Compares MPlayer translation files against a master file and
417 reports conflicting arguments, extra strings not present in
418 the base file and (optionally) missing strings.
425 Description: the prototype ../cpuinfo.c
427 Note: Used by configure to emulate /proc/cpuinfo on non-Linux systems.
434 Description: MPEG4-ES stream inspector, dumps the stream startcodes.
439 Author: Felix Bünemann
441 Description: benchmark/testbed for fastmemcpy stuff
443 Note: Also see fastmem.sh.
450 Description: Dump memory block to file.
452 Usage: As argument requires absolute address of memory dump and its
453 length (in hexadecimal form).
454 As output - will write file which will be named:
456 where: ADDR - given address of memory
457 LEN - given length of memory
464 Description: Show QuickTime MOV file structure.
466 Usage: movinfo <filename.mov>
473 Description: PNG to RAW image converter, used by .raw font creators.
475 Usage: png2raw <file1> [file2...]
482 Description: Dump H.263 frame headers from VIVO files.
484 Usage: vivodump <input_file> <output_file>
488 Miscellaneous scripts in the TOOLS dir
489 --------------------------------------
493 Author: Michael Klepikov
495 Description: A script for pipelined editing of subtitle files.
497 Usage: subedit.pl [switches]
498 -if,--input-format <fmt> input format; supported: SRT (default: SRT)
499 -of,--output-format <fmt> output format; supported: SRT
500 (default: input format)
501 -s,--shift <time> shift all subtitles by <time>
502 (format: [-]hh:mm:ss,fraction)
503 -c,--scale <time> scale by adding <time> to overall duration
504 -f,--split-from <time> drop subtitles that end before <time>
505 -t,--split-to <time> drop subtitles that start after <time> (will
506 truncate timing if it overlaps a boundary)
507 -r,--renumber renumber SRT subtitles in output
508 -d,--debug enable debug output
509 -h,--help help message
516 Description: This script will use the Windows Media Player codec download
517 infrastructure to aquire the codecs listed in codecs.conf and put
518 them in a directory named "codecs/" below the current directory.
520 Usage: w32codec_dl.pl <codecs.conf location>
522 Note: You will need the libwww-perl stuff and the cabextract utility
523 which can be found at http://www.kyz.uklinux.net/cabextract.php3.
528 Author: Andrea Menucci, thuglife
530 Description: Downloads binary codecs from mplayerhq.hu and installs them
533 Usage: install-w32codecs.sh install
534 install-w32codecs.sh uninstall
541 Description: Adjust the time-info in vobsub files
543 Usage: vobshift.py in.idx out.idx +8.3
544 Will shift the time by 8.3 seconds
549 Author: Kim Minh Kaplan
551 Description: Transform VOBsub subtitles into Subrip text subtitles using
554 Usage: subrip <vobsub basename> [subid [output filename] ]
556 Note: Requires at least JOCR/GOCR 0.37.
557 You will have to change the 'vobsub_id' value if you want a
558 subtitle different from number 0. Hint: You can view the
559 subtitle that is being decoded with "display subtitle-*.pgm".
566 Description: Generates alaw/ulaw tables.
568 Note: Created to work around a past license issue, no longer useful.
573 Author: Tobias Diedrich
575 Description: Dumps vobsub soft subtitles streams embedded in avi files.
577 Usage: avisubdump <avi>
581 Format conversion scripts in the TOOLS dir
582 ------------------------------------------
586 Author: Reimar Döffinger
588 Description: Converts D-Cinema Audio (SMPTE 302M?) to WAV.
590 Usage: 302m_convert <in.302> <out.wav>
595 Author: Reimar Döffinger
597 Description: Converts D-Cinema Video (MPEG-2 in GXF, SMPTE 360M) to MPEG-ES.
598 Use -demuxer mpeges to play the converted file.
600 Usage: 360m_convert <in.gxf> <out.m2v>