Find file History
Pull request Compare This branch is 87 commits ahead, 3105 commits behind pigoz:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


README for the TOOLS directory


In this directory you can find some nice scripts and code that makes
using MPlayer and MEncoder easier, for example scripts for DVD track
encoding in three pass mode or creating SVCDs from a movie.

FIXME: Document the following tools:


MPlayer scripts in the TOOLS dir

edgedetect.fp, emboss.fp

Author:       Reimar Döffinger

Description:  Examples of custom fragment program for OpenGL video out driver

Usage:        mplayer -vo gl:yuv=4:customprog=edgedetect.fp

Author:       Tobias Diedrich

Description:  Runs 'mplayer -identify' for all arguments while preventing
              video window flashing.

Usage: file1 [file2 ...]

Author:       Rich Felker

Description:  Script to run MPlayer on the console (fbdev/mga_vid/etc.) without
              the console text and/or flashing cursor getting in the way.

Usage: [mplayer options]

Author:       Reimar Döffinger

Description:  Example how to output video on multiple windows in sync. Might
              be even more useful in combination with -vo ggi to distribute
              the video arbitrarily.

Usage: <n> <options>
              n        Number of MPlayer instances that display the video.
              options  Any options you would pass to MPlayer, more than
                       one file will usually not work.

Author:       Alex Beregszaszi

Description:  Collects subtitle files from the directory given as argument
              ('.' if none is given) and its subdirectories and prints
              them as a comma separated list to stdout.

Usage: [directory]
              mplayer -sub `` movie

Author:       Peter Simon

Description:  Converts WMA files to Ogg or MP3.

Usage:        wma2ogg [options] <-f FILE1 | -f FILE2 ... | -a>
              -f, -file   filename
              -a          converts all WMA files in the current directory
              -t          output filetype (ogg, mp3) [default=ogg]
              -lame       I wanna use L.A.M.E. sure enough!
              -br         bitrate (kb/s) [default=from the WMA]
              -del        remove WMA file(s) after the transcoding

MEncoder scripts in the TOOLS dir

Author:       Miklos Vajna

Description:  A simple utility that creates an SVCD from a video in an AVI

Usage: <input_avi> [options]
              see ' -h' for more info

Author:       Jürgen Hammelmann

Description:  Converts DVD (or anything else that MPlayer plays) to (S)VCD

Usage: <basename> [ options] [mplayer options]
              see ' -h' for more info

Note:         Requires MPlayer, mjpegtools, VCDImager, cdrdao, and optionally
              LAME, tooLAME and SoX.

Author:       Florian Schilhabel

Description:  Yet another DVD to divx helper script.
              This script encodes a DVD track in three pass mode to MPEG-4 with
              libavcodec. Optionally it writes the resulting movie file to
              CD-ROM the corresponding audio track to MP3. It can also shut
              down the computer when it finishes. If you like, you can
              watch the MEncoder output on /dev/tty8.

Usage:        --help       show help
              --abr        (AudioBitRate) Please enter the desired bitrate this
                           can be either [96|128|192] kbit/sec (default: 128).
              --lang       Specify the Language of the audio track this can be
                           for example <en> or <de> (default: <de>).
              --dvd        Specify the DVD track you want to encode.
              --cdsize     Specify the size of your CD-ROM (default: 700MB).
              --shutdown   Shutdown the system, when the encoding process has
                           finished. Needs appropriate privileges.
              --out        Specify the name of your encoded movie. The file
                           extension will be appended automatically.
              --writecd    Takes the newly created movie and writes it to a
              --writedev   cdrecord device identifier, for example 0,1,0
              --speed      writing speed (default: 4)
              --dvd-device device to pull the video off (default: /dev/dvd)

Author:       Jonas Jermann

Description:  A hack to allow MEncoder to read respectively encode from audio
              only files.

Usage: <"input file"> <"output file"> <"options">
              If no options are specified the following is assumed:
              -oac lavc -lavcopts acodec=mp3:abitrate=192

Note:         The script is probably bash dependent and it's just a quick
              hack, feel free to improve it (or much better: fix MEncoder ;).

Author:       Reynaldo H. Verdejo Pinochet

Description:  converter from any supported format to VCD/SVCD PAL/NTSC

Usage: file <options>
              Run with no arguments to see the list of options.

Note:         You will need vcdimager/cdrecord to master/burn the resulting

Tech scripts in the TOOLS dir

Author:       Moritz Bunkus

Description:  A script that calculates the $bpp for a movie, mentioned in
              DOCS/tech/encoding-tips.txt, see that document for more info.

Usage: <resolution> <aspect ratio> <bitrate> <fps>
              resolution:    the cropped but unscaled resolution
                             (use '-vf cropdetect')
              aspect ratio:  the encoded aspect ratio. All DVDs come at
                             720x576 but contain a flag that tells the player
                             wether it should display the DVD at an aspect
                             ratio of 4/3 (1.333) or at 16/9 (1.777). Have a
                             look at MPlayer's output - there's something
                             about 'prescaling'. That's what you are looking
              bitrate:       the video bitrate in kbit/s
              fps:           the fps

              example: 720x440 16/9 896 25

Author:       Moritz Bunkus

Description:  Counts the quantizers used for the encoding, mentioned in
              DOCS/tech/encoding-tips.txt, see that document for more info.

Usage: < divx2pass.log
              It will print out which quantizer was used how often. If you see
              that e.g. the lowest quantizer (vqmin=2) gets used for > 95% of
              the frames then you can safely increase your picture size.

Author:       Jonas Jermann

Description:  Draw PSNR log graphs using gnuplot.

Usage: [options] <file>
              -h, --help    Display this help message
              -quant        Display quantizers
              -size         Display size
              -psnr         Display PSNR
              -iframes      Display I-frames
              -pframes      Display P-frames
              -bframes      Display B-frames
              -aframes      Display all frames in different colors
              -cmp <file2>  Compare two files
              -qs <style>   Quantizer style
              -ss <style>   Size style
              -ps <style>   PSNR style

              Default: -quant -size -psnr -qs "p" -ss "i" -ps "p"

Note:         Requires gnuplot. Comparison is based on file2. Comparison
              assumes that the frame numbers of both files fit.

Author:       Matthias Wieser

Description:  Calculates the PSNR between two existing video files.
              The PSNR is calculated frame by frame.
              Also prints the overall PSNR.
              The script can be used to:
               * Compare different softwarescalers (should I use
                 -sws 1 or -sws 2 ?)
               * Compare different resolutions (is it better to scale
                 down to 640x360 or to 560x320)
               * Compare different deinterlacers
               * Compare different video codecs
               * Compare video filters (is it better to use -vf hqdn3d
                 or lavcopts:nr=400)
               * [...]

Usage: <file1> <file2> [<frames>] [<options1>] [<options2>]

              <file1> and <file2> are the video files for which the PSNR
                should be calculated.
              [<frames>] is the number of frames to process, starting
                from frame 1.
              [<options1>] are additional MPlayer options for <file1>
              [<options2>] are additional MPlayer options for <file2>

              A file called ./psnr.dat will be created with the following


Note:         This script relies on the the tool "pnmpsnr" for the
              frame-by-frame PSNR calculation.
              Be aware that needs a lot of temporary space
              in /tmp/.


Author:       Arpi

Description:  a simple ASF header display program

Usage:        asfinfo <filename.asf>

Note:         Also see MPlayer's -identify option.


Author:       Arpi

Description:  A simple tool to fix chunk sizes in RIFF AVI files.

Usage:        avi-fix [-fix] <badfile.avi>

Note:         It does not check or fix the index, to do this use
              'mencoder -forceidx -oac copy -ovc copy'.

Author:       Ivo van Poorten

Description:  Check the source tree for anomalies.

Usage: -help

Note:         This script is meant for developers to check the current
              source tree and/or the patches they are working on.

Author:       Uoti Urpala

Description:  Check console message translations for common errors.

Usage: [--missing] <master file> <files to check>

Note:         Compares MPlayer translation files against a master file and
              reports conflicting arguments, extra strings not present in
              the base file and (optionally) missing strings.


Author:       Jürgen Keil

Description:  the prototype ../cpuinfo.c

Note:         Used by configure to emulate /proc/cpuinfo on non-Linux systems.


Author:       Arpi

Description:  MPEG4-ES stream inspector, dumps the stream startcodes.


Author:       Felix Bünemann

Description:  benchmark/testbed for fastmemcpy stuff

Note:         Also see


Author:       Arpi

Description:  Show QuickTime MOV file structure.

Usage:        movinfo <>


Author:       Arpi

Description:  Dump H.263 frame headers from VIVO files.

Usage:        vivodump <input_file> <output_file>

Miscellaneous scripts in the TOOLS dir

Author:       Michael Klepikov

Description:  A script for pipelined editing of subtitle files.

Usage: [switches]
    -if,--input-format <fmt>   input format; supported: SRT (default: SRT)
    -of,--output-format <fmt>  output format; supported: SRT
                               (default: input format)
    -s,--shift <time>          shift all subtitles by <time>
                               (format: [-]hh:mm:ss,fraction)
    -c,--scale <time>          scale by adding <time> to overall duration
    -f,--split-from <time>     drop subtitles that end before <time>
    -t,--split-to <time>       drop subtitles that start after <time> (will
                               truncate timing if it overlaps a boundary)
    -r,--renumber              renumber SRT subtitles in output
    -d,--debug                 enable debug output
    -h,--help                  help message

Author:       Tom Lees

Description:  This script will use the Windows Media Player codec download
              infrastructure to aquire the codecs listed in codecs.conf and put
              them in a directory named "codecs/" below the current directory.

Usage: <codecs.conf location>

Note:         You will need the libwww-perl stuff and the cabextract utility
              which can be found at

Author:       Andrea Menucci, thuglife

Description:  Downloads binary codecs from and installs them
              on a Debian system.

Usage: install

Author:       Gábor Farkas

Description:  Adjust the time-info in vobsub files

Usage: in.idx out.idx +8.3
              Will shift the time by 8.3 seconds


Author:       Kim Minh Kaplan

Description:  Transform VOBsub subtitles into Subrip text subtitles using

Usage:        subrip <vobsub basename> [subid [output filename] ]

Note:         Requires at least JOCR/GOCR 0.37.
              You will have to change the 'vobsub_id' value if you want a
              subtitle different from number 0. Hint: You can view the
              subtitle that is being decoded with "display subtitle-*.pgm".


Author:       Arpi

Description:  Generates alaw/ulaw tables.

Note:         Created to work around a past license issue, no longer useful.


Author:       Tobias Diedrich

Description:  Dumps vobsub soft subtitles streams embedded in AVI files.

Usage:        avisubdump <movie.avi>


Author:       Gianluigi Tiesi

Description:  Creates a codec settings file from the Video for Windows codecs
              found in the mplayer codec packs.

Usage:        vfw2menc -f <fourcc> -d <codec.dll> -s <settingsfile.mcf>
              -h|--help            - displays this help
              -d|--driver filename - dll or drv to load
              -f|--fourcc fourcc   - fourcc of selected driver
              -s|--save filename   - save settings to file
              -c|--check filename  - load and show setting in filename
              -v|--view            - displays the config dialog and do nothing

Notes:        Works on Windows/Linux x86 only.


Author:       Alan Nisota

Description:  Modifies registry file (usually ~/.mplayer/registry)

Usage:        modify_reg -r <registry_file> -l
              modify_reg -r <registry_file> -k <key> [-d|-v <value>[-t <type>]]
              -r|--registry - path to registry file
              -l|--list     - shows all keys and values
              -k|--key      - registry key
              -d|--del      - delete key
              -v|--value    - new value for key
              -t|--type     - key type: string (default) or dword

Notes:        Necessary to use CoreAVC with MPlayer


Author:       Michael Niedermayer

Description:  Simple file compare program that detects the number of rounding
              errors and dies if the error is too large.

Usage:        compare <file1> <file2>


Author:       miscellaneous

Description:  Wrappers for Linux Real binary codecs used to analyze, alter and
              dump the data flow between RealPlayer and its codecs.

Usage:        - Set the path to the RealPlayer codecs directory in the C files.
              - Run 'make realcodecs'.
              - Rename the original codecs to match the names expected in the
                wrapper sources. The default is to give them a "real" prefix,
              - Put the wrappers in the RealPlayer codecs directory.

Notes:        Known to work at least on Linux x86 with RealPlayer8.

netstream - access remote streams

netstream allows you to access most MPlayer stream types from a remote host.
The main purpose of this feature is to make it possible to directly use the
CD or DVD drive of another computer on the network (provided you have the
required bandwidth). On the downside some stream types (currently TV and MF)
are not usable remotely because they are implemented at the demuxer level.

Be aware that currently the server is not secure at all.

Compile the server by running 'make TOOLS/netstream' ('make TOOLS/netstream.exe'
on windows) from the root of mplayer source and then copy the netstream binary
to the right place on your system (usually /usr/local/bin on Unix). Start the
netstream server on the computer you intend to access remotely. There are no
command line arguments.

Play the second track of a VCD on the server with:

  mplayer -cache 5000 mpst://servername/vcd://2

Access files on this server with:

  mplayer -cache 5000 mpst://servername//usr/local/movies/lol.avi

Note that paths which do not start with a / will be interpreted as relative to
the directory where the server is running. The '-cache' option is not needed
but highly recommended.

netstream will not take -dvd-device, so you must either symlink
your drive to /dev/dvd/ or use the dvd:///path/to/dvd.
for example: mpst://audioserver/dvd:////dev/optical/lg_black_dvd