libav: switch from CODEC_ID to AV_CODEC_ID
[mplayer.git] / TOOLS / README
blob58c1adeb5643644a06ca532a9b97769125e732d6
1 README for the TOOLS directory
2 ==============================
4 Preamble
5 --------
7 In this directory you can find some nice scripts and code that makes
8 using MPlayer easier.
10 FIXME: Document the following tools:
12 bmovl-test
15 MPlayer scripts in the TOOLS dir
16 --------------------------------
18 edgedetect.fp, emboss.fp
20 Author:       Reimar Döffinger
22 Description:  Examples of custom fragment program for OpenGL video out driver
24 Usage:        mplayer -vo gl:yuv=4:customprog=edgedetect.fp
27 midentify.sh
29 Author:       Tobias Diedrich
31 Description:  Runs 'mplayer -identify' for all arguments while preventing
32               video window flashing.
34 Usage:        midentify.sh file1 [file2 ...]
37 mpconsole.sh
39 Author:       Rich Felker
41 Description:  Script to run MPlayer on the console (fbdev/mga_vid/etc.) without
42               the console text and/or flashing cursor getting in the way.
44 Usage:        mpconsole.sh [mplayer options]
47 mplmult.sh
49 Author:       Reimar Döffinger
51 Description:  Example how to output video on multiple windows in sync. Might
52               be even more useful in combination with -vo ggi to distribute
53               the video arbitrarily.
55 Usage:        mplmult.sh <n> <options>
56               n        Number of MPlayer instances that display the video.
57               options  Any options you would pass to MPlayer, more than
58                        one file will usually not work.
61 subsearch.sh
63 Author:       Alex Beregszaszi
65 Description:  Collects subtitle files from the directory given as argument
66               ('.' if none is given) and its subdirectories and prints
67               them as a comma separated list to stdout.
69 Usage:        subsearch.sh [directory]
70               mplayer -sub `subsearch.sh` movie
73 wma2ogg.pl
75 Author:       Peter Simon
77 Description:  Converts WMA files to Ogg or MP3.
79 Usage:        wma2ogg [options] <-f FILE1 | -f FILE2 ... | -a>
80               -f, -file   filename
81               -a          converts all WMA files in the current directory
82               -t          output filetype (ogg, mp3) [default=ogg]
83               -lame       I wanna use L.A.M.E. sure enough!
84               -br         bitrate (kb/s) [default=from the WMA]
85               -del        remove WMA file(s) after the transcoding
88 Tech scripts in the TOOLS dir
89 -----------------------------
91 calcbpp.pl
93 Author:       Moritz Bunkus
95 Description:  A script that calculates the $bpp for a movie, mentioned in
96               DOCS/tech/encoding-tips.txt, see that document for more info.
98 Usage:        calcbpp.pl <resolution> <aspect ratio> <bitrate> <fps>
99               resolution:    the cropped but unscaled resolution
100                              (use '-vf cropdetect')
101               aspect ratio:  the encoded aspect ratio. All DVDs come at
102                              720x576 but contain a flag that tells the player
103                              wether it should display the DVD at an aspect
104                              ratio of 4/3 (1.333) or at 16/9 (1.777). Have a
105                              look at MPlayer's output - there's something
106                              about 'prescaling'. That's what you are looking
107                              for.
108               bitrate:       the video bitrate in kbit/s
109               fps:           the fps
111               example: calcbpp.pl 720x440 16/9 896 25
114 countquant.pl
116 Author:       Moritz Bunkus
118 Description:  Counts the quantizers used for the encoding, mentioned in
119               DOCS/tech/encoding-tips.txt, see that document for more info.
121 Usage:        countquant.pl < divx2pass.log
122               It will print out which quantizer was used how often. If you see
123               that e.g. the lowest quantizer (vqmin=2) gets used for > 95% of
124               the frames then you can safely increase your picture size.
127 plotpsnr.pl
129 Author:       Jonas Jermann
131 Description:  Draw PSNR log graphs using gnuplot.
133 Usage:        plotpsnr.pl [options] <file>
134               -h, --help    Display this help message
135               -quant        Display quantizers
136               -size         Display size
137               -psnr         Display PSNR
138               -iframes      Display I-frames
139               -pframes      Display P-frames
140               -bframes      Display B-frames
141               -aframes      Display all frames in different colors
142               -cmp <file2>  Compare two files
143               -qs <style>   Quantizer style
144               -ss <style>   Size style
145               -ps <style>   PSNR style
147               Default: -quant -size -psnr -qs "p" -ss "i" -ps "p"
149 Note:         Requires gnuplot. Comparison is based on file2. Comparison
150               assumes that the frame numbers of both files fit.
153 psnr-video.sh
155 Author:       Matthias Wieser
157 Description:  Calculates the PSNR between two existing video files.
158               The PSNR is calculated frame by frame.
159               Also prints the overall PSNR.
160               The script can be used to:
161                * Compare different softwarescalers (should I use
162                  -sws 1 or -sws 2 ?)
163                * Compare different resolutions (is it better to scale
164                  down to 640x360 or to 560x320)
165                * Compare different deinterlacers
166                * Compare different video codecs
167                * Compare video filters (is it better to use -vf hqdn3d
168                  or lavcopts:nr=400)
169                * [...]
171 Usage:        psnr-video.sh <file1> <file2> [<frames>] [<options1>] [<options2>]
173               <file1> and <file2> are the video files for which the PSNR
174                 should be calculated.
175               [<frames>] is the number of frames to process, starting
176                 from frame 1.
177               [<options1>] are additional MPlayer options for <file1>
178               [<options2>] are additional MPlayer options for <file2>
180               A file called ./psnr.dat will be created with the following
181               content:
183               File;Y;Cb;Cr
184               00000001.ppm;34.23;39.54;40.06;35.426
185               00000002.ppm;33.03;38.71;39.26;34.271
186               00000003.ppm;33.45;38.91;39.28;34.655
187               00000004.ppm;32.72;38.69;38.85;33.972
188               [...]
189               00000247.ppm;35.55;40.84;42.15;36.785
190               PSNR:;35.9887
192 Note:         This script relies on the the tool "pnmpsnr" for the
193               frame-by-frame PSNR calculation.
194               Be aware that psnr-video.sh needs a lot of temporary space
195               in /tmp/.
198 asfinfo
200 Author:       Arpi
202 Description:  a simple ASF header display program
204 Usage:        asfinfo <filename.asf>
206 Note:         Also see MPlayer's -identify option.
209 avi-fix
211 Author:       Arpi
213 Description:  A simple tool to fix chunk sizes in RIFF AVI files.
215 Usage:        avi-fix [-fix] <badfile.avi>
217 Note:         It does not check or fix the index. You can try to fix it with
218               ffmpeg -i ... -acodec copy -vcodec copy.
221 checktree.sh
223 Author:       Ivo van Poorten
225 Description:  Check the source tree for anomalies.
227 Usage:        checktree.sh -help
229 Note:         This script is meant for developers to check the current
230               source tree and/or the patches they are working on.
233 mphelp_check.py
235 Author:       Uoti Urpala
237 Description:  Check console message translations for common errors.
239 Usage:        mphelp_check.py [--missing] <master file> <files to check>
241 Note:         Compares MPlayer translation files against a master file and
242               reports conflicting arguments, extra strings not present in
243               the base file and (optionally) missing strings.
246 cpuinfo
248 Author:       Jürgen Keil
250 Description:  the prototype ../cpuinfo.c
252 Note:         Used by configure to emulate /proc/cpuinfo on non-Linux systems.
255 dump_mp4
257 Author:       Arpi
259 Description:  MPEG4-ES stream inspector, dumps the stream startcodes.
262 fastmemcpybench
264 Author:       Felix Bünemann
266 Description:  benchmark/testbed for fastmemcpy stuff
268 Note:         Also see fastmem.sh.
271 movinfo
273 Author:       Arpi
275 Description:  Show QuickTime MOV file structure.
277 Usage:        movinfo <filename.mov>
280 vivodump
282 Author:       Arpi
284 Description:  Dump H.263 frame headers from VIVO files.
286 Usage:        vivodump <input_file> <output_file>
290 Miscellaneous scripts in the TOOLS dir
291 --------------------------------------
293 subedit.pl
295 Author:       Michael Klepikov
297 Description:  A script for pipelined editing of subtitle files.
299 Usage:        subedit.pl [switches]
300     -if,--input-format <fmt>   input format; supported: SRT (default: SRT)
301     -of,--output-format <fmt>  output format; supported: SRT
302                                (default: input format)
303     -s,--shift <time>          shift all subtitles by <time>
304                                (format: [-]hh:mm:ss,fraction)
305     -c,--scale <time>          scale by adding <time> to overall duration
306     -f,--split-from <time>     drop subtitles that end before <time>
307     -t,--split-to <time>       drop subtitles that start after <time> (will
308                                truncate timing if it overlaps a boundary)
309     -r,--renumber              renumber SRT subtitles in output
310     -d,--debug                 enable debug output
311     -h,--help                  help message
314 w32codec_dl.pl
316 Author:       Tom Lees
318 Description:  This script will use the Windows Media Player codec download
319               infrastructure to aquire the codecs listed in codecs.conf and put
320               them in a directory named "codecs/" below the current directory.
322 Usage:        w32codec_dl.pl <codecs.conf location>
324 Note:         You will need the libwww-perl stuff and the cabextract utility
325               which can be found at http://www.kyz.uklinux.net/cabextract.php3.
328 binary_codecs.sh
330 Author:       Andrea Menucci, thuglife
332 Description:  Downloads binary codecs from mplayerhq.hu and installs them
333               on a Debian system.
335 Usage:        binary_codecs.sh install
336               binary_codecs.sh uninstall
339 vobshift.py
341 Author:       Gábor Farkas
343 Description:  Adjust the time-info in vobsub files
345 Usage:        vobshift.py in.idx out.idx +8.3
346               Will shift the time by 8.3 seconds
349 subrip.c
351 Author:       Kim Minh Kaplan
353 Description:  Transform VOBsub subtitles into Subrip text subtitles using
354               GOCR/JOCR.
356 Usage:        subrip <vobsub basename> [subid [output filename] ]
358 Note:         Requires at least JOCR/GOCR 0.37.
359               You will have to change the 'vobsub_id' value if you want a
360               subtitle different from number 0. Hint: You can view the
361               subtitle that is being decoded with "display subtitle-*.pgm".
364 alaw-gen.c
366 Author:       Arpi
368 Description:  Generates alaw/ulaw tables.
370 Note:         Created to work around a past license issue, no longer useful.
373 avisubdump.c
375 Author:       Tobias Diedrich
377 Description:  Dumps vobsub soft subtitles streams embedded in AVI files.
379 Usage:        avisubdump <movie.avi>
382 vfw2menc.c
384 Author:       Gianluigi Tiesi
386 Description:  Creates a codec settings file from the Video for Windows codecs
387               found in the mplayer codec packs.
389 Usage:        vfw2menc -f <fourcc> -d <codec.dll> -s <settingsfile.mcf>
390               -h|--help            - displays this help
391               -d|--driver filename - dll or drv to load
392               -f|--fourcc fourcc   - fourcc of selected driver
393               -s|--save filename   - save settings to file
394               -c|--check filename  - load and show setting in filename
395               -v|--view            - displays the config dialog and do nothing
397 Notes:        Works on Windows/Linux x86 only.
400 modify_reg.c
402 Author:       Alan Nisota
404 Description:  Modifies registry file (usually ~/.mplayer/registry)
406 Usage:        modify_reg -r <registry_file> -l
407               modify_reg -r <registry_file> -k <key> [-d|-v <value>[-t <type>]]
408               -r|--registry - path to registry file
409               -l|--list     - shows all keys and values
410               -k|--key      - registry key
411               -d|--del      - delete key
412               -v|--value    - new value for key
413               -t|--type     - key type: string (default) or dword
415 Notes:        Necessary to use CoreAVC with MPlayer
418 compare.c
420 Author:       Michael Niedermayer
422 Description:  Simple file compare program that detects the number of rounding
423               errors and dies if the error is too large.
425 Usage:        compare <file1> <file2>
428 realcodecs/
430 Author:       miscellaneous
432 Description:  Wrappers for Linux Real binary codecs used to analyze, alter and
433               dump the data flow between RealPlayer and its codecs.
435 Usage:        - Set the path to the RealPlayer codecs directory in the C files.
436               - Run 'make realcodecs'.
437               - Rename the original codecs to match the names expected in the
438                 wrapper sources. The default is to give them a "real" prefix,
439                 e.g. realcook.so.6.0.
440               - Put the wrappers in the RealPlayer codecs directory.
442 Notes:        Known to work at least on Linux x86 with RealPlayer8.