divxdec(1)

NAME

divxdec - decompose an avifile-compatible .avi file into lavtools-compatible data

SYNTAX

divxdec [options] [input AVI]

DESCRIPTION

This utility uses avifile to read an avi file and output various components of it. You may output lavtools-compatible MJPEGs, YUV4MPEG2 streams, PCM .wav files, or even playback on a MJPEG playback device.

Note that you must have avifile available in order to use this utility. If building from a CVS snapshot or copy, this will be detected at build time.

MJPEG playback is very CPU intensive. The video is decoded to YUV by avifile, then re-encoded using software MJPEG and output to the desired destination (often an MJPEG hardware playback device). software MJPEG is still slow. Expect a 352x240 avi to play back properly via "-p C" with quality 60 on an 800 MHz-class machine with 75+% CPU use. Using the default decimation I have been able to get 640x420 playback to work (barely) with quality 24 on an Athlon T-Bird 1400 MHz.

OPTIONS

For PCM .wav output:

-W [ <filename> ]

--wavefile [ <filename> ]
    The wave audio data from the avi file is written to filename. If omitted, stdout is assumed.

For YUV4MPEG2 output:

-Y [ <filename> ]

--yuvfile [ <filename> ]
    The video data from the avi file is output as YUV4MPEG2 data to filename. If omitted, stdout is assumed.

For LAV file output:

-L [ <filename> ]

--lavfile [ <filename> ]
    The avifile is re-encoded as an MJPEG file to filename. Format should be given by the -f option. (See further options below.

For MJPEG device playback:

-p { "S", "H", "C" }

--play { "S", "H", "C" }
    The avifile is re-encoded as an MJPEG and output through liblavplay. The argument indicates the destination of the playback (Software, Hardware or external device (C)).

Options for -L (LAV file) output.

-f, --format { "a", "A", "q", "m" }
    Specify the format of the output file. (a,A for avifile, m for movtar, q for quicktime)

-m, --maxfilesize <num>
    Specify the maximum size of an output LAV file, in MiB. Defaults to 1500. To be able to output multiple files, specify the -L option as a format string (e.g. "output-%02d.lav.avi" will generate "output-01.lav.avi", "output-02.lav.avi" etc).

Options for -L (LAV file) and -p (MJPEG device playback) output.

-q, --quality <num>
    Specify quality of the output, default 50.

Options for -p (MJPEG device playback):

-n, --norm { "p", "n" }
    Specifies the output norm for MJPEG playback. If -p is omitted, detection is attempted but it is not guaranteed.

-I, --interlace
    Identifies the treatment of avi files too large to be displayed non-interlaced. They will be displayed as interlaced if this option is asserted. Since MJPEG hardware playback uses software encoding of the JPEG data, the large frames become a significant performance problem. The default is not to use this option. If this option is not specified, MJPEG output will be decimated to fit in the hardware device's dimensions. Only really useful if the -p argument is "C" or "H".

-r, --rationalise
    Performs a quick filter on the video before output, to ensure all luma values are in the valid range 16-235. Values outside of this range can look odd on some output devices.

Options for all output types:

-e [ <num> ]

--endframe [ <num> ]
    Specify the frame number of the last frame to decode. Note that this is not the number of frames to decode.

-b [ <num> ]

--beginframe [ <num> ]
    Specify the frame number of the first frame to decode.

-V

--version
    Output version and exit.

-v <level>

--verbose <level>
    Specifies the level of verbosity on output. All output occurs to stderr. 2 shows progress and all logging, 1 shows informative output and 0 shows only important messages.

EXAMPLES

Save audio:

divxdec -W output.wav input.divx.avi

Output YUV and audio to files

divxdec -W output.wav -Y output.yuv input.divx.avi

Output to LAV files divxdec -L output-%02d.lav.mov -f q \
    -q 70 -m 1900 input.divx.avi

Output the second 500 frames to an MJPEG device:

divxdec -p C -n p -q 50 -r -b 500 -e 1000 input.divx.avi

Everything! Hope you've got a monster system to try this...
divxdec -L output-%02d.lav.mov -f q -q 70 -m 1900 \
    -W output.wav -Y output.yuv \
    input.divx.avi

BUGS

Output WAV and YUV files are not checked for sizes.  If your system and lavtools can handle files > 2GiB, you won't have a problem.  If not, you will get errors when you reach this size.

The whole MJPEG hardware playback thing is a hack.  It can certainly be improved.

<insert general pithy comment about additional hidden bugs remaining here>

AUTHOR

Shawn Sulma <lav2divx@athos.cx>
If you have questions, remarks, problems or you just want to contact the developers, the main mailing list for the MJPEG-tools is:
    mjpeg-users@lists.sourceforge.net
For more info, see our website at
    http://mjpeg.sourceforge.net/

SEE ALSO

yuv2divx(1), lav2yuv(1), lav2divx(1), lav2wav(1)