----------------------------------------------------------------------
MPEG2AVI.EXE v0.16B35 11/10/99 QUICK DOCUMENTATION
HOMEPAGE : http://members.xoom.com/mpeg2avi mpeg2avi@xoom.com
----------------------------------------------------------------------
MPEG2AVI - MPEG1/MPEG2-video -> AVI converter
1) Overview
2) System requirements
3) Known limitations
4) Future versions
5) What's NEW in this release
6) What's CHANGED in this release
7) A few command line examples
Don't forget to read these other important documents:
mpeg2avi.txt - User's Guide
sample.lst - "streamlist" sample file
ivtc.txt - inverse telecine information, incomplete!
vfw_yuv.txt - MPEG2AVI FAQ and YUV-AVI information
----------------------------------------------------------------------
1) Overview of MPEG2AVI's abilities :
----------------------------------------------------------------------
MPEG2AVI is a command-line utility that will convert an MPEG-1/2 video
bitstream to a Video For Windows AVI file. MPEG-audio conversion is
not supported, so audiostreams (if present) will be ignored. MPEG2AVI
can only convert one bitstream at a time (multi-file input is not
supported), with limited video processing during the conversion.
"mpeg2avi.txt" contains a (preliminary) user's manual
Input features -
MPEG2AVI accepts the following formats:
1) elementary MPEG-1 video bitstreams (*.M1V)
2) MPEG-1 system bitstreams (*.MPG), VideoCD (*.DAT)
3) elementary MPEG-2 MP@ML video bitstreams (*.M1V)
4) MPEG-2 system bitstreams (*.MPG), unencrypted DVD (*.VOB)
Additional support for (*.VOB) files
a) MPEG2AVI can start decoding at any LBA offset.
b) MPEG2AVI can read a group of VOB files as one continuous
stream
(see sample.lst on using streamlists with MPEG2AVI)
Decoding features -
MPEG2AVI is a derivative program of the MSSG MPEG-2 video codec
(MPEG2V12) Some features, such as scalable MPEG-2 support, have been
removed in favor of faster performace.
1) Optional reference-quality floating-point IDCT algorithm
IEEE1180-1990 ***-bit double-precision FPU IDCT (slow)
*2) Standard high-quality MMX IDCT algorithm
IEEE1180-1990 32-bit MMX IDCT (fast)
3) Optional high-speed MMX IDCT algorithm (not IEEE1180
compliant)
4) accurate motion compensation routines (full-pel, half-pel)
(more accurate than XingMPEG/XingDVD player)
Processing features -
MPEG2AVI can perform the following operations on decoded video:
1) Centered cropping (X & Y), X & Y must be divisible by 8
2) Arbitrary downsizing (X & Y), X & Y must be divisible by 8
3) fast "half-resolution mode" (reduces decoded video to half its
original X & Y dimensions)
4) Inverse telecine (IVTC) function for better conversion of
film-material (24fps) coded @ MPEG-2 interlaced video (29.97)
5) Frame-skipping, every frame is deleted
6) Frame-range, a selected range of frames are processed
(useful for encoding a specific segment of a bitstream)
Output features -
MPEG2AVI can generate the following video files :
1) Video for Windows *.AVI
any VFW compressor which supports "RGB24"
uncompressed RGB24 AVI format
special YUV-output modes (YV12, YUY2) for faster AVI encoding
(the VFW compressor must support YV12/YUY2 input!)
----------------------------------------------------------------------
2) System Requirements
----------------------------------------------------------------------
Windows 9x/NT4 or later
Microsoft Video for Windows "Video Compression" library
32MB RAM
Pentium/MMX class processor (CPU must support MMX instructions)
On an Intel Celeron-450 PC, an MPEG-2 video (720x480) can be converted
directly (no video processing) to M-JPEG AVI at roughly 2/3 real-time
(15fps.) Resizing the decoded video degrades performance.
----------------------------------------------------------------------
3) KNOWN LIMITATIONS
----------------------------------------------------------------------
+ bad bitstreams can cause MPEG2AVI to crash
+ single-file input only (MPEG2AVI cannot convert a group of MPEG
files to one AVI file)
+ auto inverse telecine introduces visual artifacts during each coding
transition in the MPEG bitstream
+ no audio decoding
+ YUV AVI modes incompatible with some VFW compressors
+ codec-selection fails intermittently with Win2k systems
----------------------------------------------------------------------
4) FOR THE FUTURE
----------------------------------------------------------------------
+ Adobe Premiere Plug-In support
+ Closer study of the inverse-telecine operation
----------------------------------------------------------------------
5) What's *NEW* in this (pre)release
----------------------------------------------------------------------
+ Added IVTC "polarity" control ('-s0' - '-s9')
+ v0.16B34 experimental multithreaded read-ahead system.
The read-ahead system reads up to 256KB ahead of the current bitstream
Pointer. This should eliminate stalls induced by an empty read buffer.
+ v0.16B33 The default INT32 IDCT ('-r1') has been replaced with a faster
MMX32 iDCT. The MMX32 IDCT complies with IEEE-1180's accuracy
requirements. The older INT32 IDCT is still available as ('-r4'), but
it should be considered obsolete. The MMX32-IDCT is just as accurate,
and faster.
+ v0.16B31 auto inverse telecine function ('-sd'), helps convert
"troublesome" MPEG-2 (VOB) bitstreams which contain both interlaced and
progressive video. Reduces "A/V drift", but does not eliminate
audio/video missync entirely :(
+ v0.16B3 streamlist implemented as a C++ object.
+ v0.16B24 stream-VOB input (multiple VOB files from a "streamlist"
'-b strlist.lst' ( 'strlist' = name of streamlist )
Tells MPEG2AVI to parse a list of files from 'strlist.lst', then
decode the files as a single continuous mpeg-bitstream.
See the sample streamlist file 'sample.lst', for more info
+ v0.16B23 MMX optimized CSC (YUV -> RGB), (faster '-o6' and '-o7')
For bitstreams of CHROMA420 format, all output modes <-o6 -o7 -o8 -o9>
are MMX optimized. Half-resolution ('-2') and crop ('-1 ')
include MMX optimizations.
The downsizers -3X & -3Y, are not yet MMX :(
And of course HiQuality FIR filters ('-q0') are not MMX :(
+ v0.16B22 MMX optimizations, MPEG2AVI now requires an MMX-CPU!
+ v0.16B2 (Demuxer converted to C++, to support LBA seek, '-@ ')
'-@ ' - start @ LBA address (VOB demux only!)
Note, the specified LBA must contain a system header!
(otherwise the MPEG-decoder cannot sync)
'-b 0xID' - select stream-ID (VOB demux only!)
The StreamID is optional (default == 0xE0), if specified the
demuxer will decode video data from the specified stream ID.
'-*' - encode MPEG-data (watermark video),
The data will appear in the upper-left of the cropped area :
1) MPEG2AVI frame# (decoded frames, start from 0)
2) GOP timecode (MPEG GOP header time code XX:XX:XX:frame)
3) temporal reference (MPEG picture header)
4) address (LBA) of last valid SYSTEM HEADER (VOB only)
(Of this information, only (1), (2), and (4) are reliable.
The temporal reference is printed out-of-order (due to the
frame reordering performed by the MPEG-decoder.)
+ v0.16B1 (AVI-writer converted to C++, to support '-$ ' feature)
Several new features
'-$ ' - auto-split AVI-file after megabytes are written
'-! ' - skip 1 frame per decoded frames. (The nth frame
is decoded, but not sent to the output-routines.)
+ v0.15B51 hopefully fixed AVI-modes '-o8' and '-o9' (for real!)
added decoding-range control '-# '
(MPEG2AVI does not "seek" the starting-point, decodes and
examines every picture-header until it reaches the start-point.
You should expect MPEG2AVI to waste a lot of time reaching the
designated starting frame#.)
restored resize-granularity to 8 for all CHROMA modes (was 16 before)
+ v0.15B5 YUY2 AVI mode '-o9'
YUY2 mode has been successfully tested with PicVideo M-JPEG codec.
fixed KeyFrame-rate issue when Microsoft MPEG-4 codec is used with
the YUV AVI modes ('-o8' or '-o9')
+ v0.15B4 YV12 AVI mode '-o8'
Video-frames are sent to the video-codec as raw YUV bitmaps. YUV
mode is faster than the standard RGB24 mode.
---------------------------------------
6) *CHANGES* From Previous Versions
---------------------------------------
+ v0.16B35 moved cDemuxer to read-ahead thread, fixed resizer
"green-bar" bug introduced by B34. Auto-IVTC (-s0d, -s1d, etc.)
logic changed. It now uses "resume2"-mode.
+ MPEG2AVI v0.16B33 was supposed to default to the MMX32 IDCT, but
due to an error on my part, it still defaulted to the INT32 IDCT.
0.16B34 corrects this bug.
MPEG2AVI's file input is now handled using Win32 native filehandling
routines [ CreateFile(), ReadFile(), SetFilePointer(),
and CloseHandle() .]
+ The MMX IDCT functions ('-r2') and ('-r3') have been reworked.
The IEEE1180 test package revealed errors in the AAN. The reworked
MMXChen is slightly faster, and the MMX-AAN is less inaccurate.
Internal re-organization of certain source files (resizer, mpv_read)
All motion-compensation pel-cases use aligned reads.
Due to the new MMX32 IDCT ('-r1'), the older INT32 IDCT has been
moved to '-r4' (it's obsolete, so don't use it(
+ v0.16B32 MMX acceleration for vertical downsizing ('-3Y ')
Only the shrink420y() and shrink420xy() functions are MMX-optimized,
but so far I have not seen any 422 or 444 MPEG-2 bitstreams. The
MPEG-2 bitstream parser reads 32KB per call, and the VOB demuxer
reads ***KB per call. (This is 2X the buffering of previous versions.)
+ v0.16B31 better MMX optimization to the motion-compensation routines
most of the macroblock cases now read QWORD aligned addresses. The
auto-IVTC mode(s) have greater intelligence.
+ v0.16B3
The '-*' mpeg-statistics are more accurate. The temporal-reference
and GOP timecode should now be frame-accurate.
Altered user-interface routines to prevent MPEG2AVI from reading
"phantom keypresses."
The '-@ ' option can now seek to *any block* within a stream.
(It is no longer limited to the file#1 of the streamlist.)
MPEG2AVI now searches the beginning of VOB files for a valid
system-header (this is equivalent to '-@ 0')
+ v0.16B24, the file-I/O routines now use _read(), _open(), & _close(),
(instead of fopen, fread, fclose.) The BBDMUX's bitstream package
has been further tweaked to waste less time reading from the input
file.
+ Starting v0.16B23, the LBA-seek command '-@ ' enters the
bitstream at the user-specified LBA. If a system-header is not found,
MPEG2AVI scans forward in the VOB bitstream, until a header is
decoded. The '-@' no longer requires the "user's prior knowledge" of
these elusive system-headers.
The fastest MMX IDCT ('-r3') disables AVI-output. This was my
personal decision; I want MPEG2AVI to provide high-quality output,
and the AAN-IDCT function failed to deliver. If you really must have
light-speed VOB->AVI conversions, try something like XingDVD 2.0x and
Panasonic MPEG Encoder.
The crop command ('-1 ') requires horizontal increment of 8,
vertical increment of 2.
Some cosmetic changes to AVi progress reporting.
+ Starting v0.16B22,
**** MPEG2AVI NOW REQUIRES AN MMX-CPU ****
'-q1' (fast-filter) is now the default filter-mode. Most fast-filters
have been MMX-optimized, while *none* of the HiQ filters are MMX. The
HiQ mode is still available ('-q0'), but without MMX-optimizations
obviously. The front-end BBDMUX demuxer has been sped-up.
The meaning of the option '-r' has changed. ('-r' has replaced it)
'-r' picks an IDCT-function. The IDCT-function greatly influences
MPEG2AVI's SPEED and QUALITY.
The precision-IDCT ('-r0') uses ***-bit FPU calculations (overkill)
The default IDCT ('-r1') uses 32-bit integer calculations.
The faster IDCT ('-r2') is a 16-bit MMX version of the above.
The fastest IDCT ('-r3') uses 16-bit MMX calculations (low quality)
'-r2' is probably the best compromise between speed and image quality.
Depending on the CPU model, '-r3' may or may not be faster.
The MPEG2decoder's internal motion-compensation routines are all MMX.
The format-converters (YUV420 -> YUV422, YUV420 -> YUV444 ) are also
MMX optimized. The RGB24 output mode (-o6, -o7) is still integer :(
+ Starting v0.16B2, the demuxer has been upgraded to BBDMUX v1.2. It is
now encapsulated in a C++ object
Due to the new VOB LBA-seek ('-@ ') option, the behavior of the
frame-limit feature ('-# ') depends on -@. The LBA-seek
opens the bitstream at the specified . The first frame seen by
the MPEG-decoder, is the first-frame at the . Hence, frame '0'
is the first-frame decoded *AFTER* the
+ Starting v0.16B1, the AVI-writer is a C++ object. C++ code executes
slower than plain C-code, so you may experience a very slight
performance decrease.
+ Starting v0.16B1, the AVI-writer always operates in auto-split mode.
The default size-threshold is 2047MB. If an AVI-file exceeds this
length, MPEG2AVI automatically closes the current AVI-file and
opens a new one. (MPEG2AVI picks an arbitrary filename for the new
AVI.) The '-$ ' option can be used to change the default
size-threshold.
+ Starting v0.15B51, the MPEG-frame counter has been relocated to the
MPEG-decoder ( Get_Hdr() in getpic.c ), this may cause some problems
with bad bitstreams (i.e. an MPEG Picture with 3-interlaced fields
will only register as one frame.)
+ Starting v0.15B5, MPEG2AVI's output-processor has been internally
restructured. The order of operations is as follows :
Order: 1) 2) 3) 4)
|MPEG-decoder| -> | Resizer | -> | Half-resolution | -> | Crop & CSC |
MPEG2V12 (-3X, -3Y) ( -2) (-1 xxx yyy)
Note, these modifications affect the usage of -3X and -3Y (downscaling.)
The target-size for -3X or -3Y is always with respect to the MPEG-video
resolution. (In prior versions of MPEG2AVI, -3X and -3Y depended on
half-resolution mode '-2'.)
The -1 and -2 commands function as before.
(The resize-operation is now performed *first*. MPEG2AVI handles the
MPEG-frames in their native format. Color-space & pixel-format
conversion are now performed last, if necessary.)
+ Starting v0.15B4, the AVI-filewriter opens the codec-dialog with
ICCompressorChoose() instead of AVISaveOptions(). This is needed to
set the codec's input-format to YV12. This programming change
shouldn't affect the older ('-o7') RGB24 AVI mode.
+ Starting v0.15, half-res output ('-2') defaults to a low-pass (HiQ)
filter. This filter is slower than the pixel-averaging downsampler.
+ The older pixel-averager is now known as "fast filter."
The fast-filter can be activated via ('-q1')
+ AVI-writer now reports "MPEG Frame # : ". It used to report the output
frame#, causing confusion with the IVTC (since the IVTC deletes
frames.)
+ Starting v0.14, the AVI-writer uses a 32-bit integer IDCT, which is
up to 3X faster than the FP-IDCT. The FP-IDCT can still be used
via the command-line option "-r".
+ Starting v0.13, AVI-writing can be safely aborted. Type 'Q' to abort
the encoder. The AVI file will be properly closed (and readable.)
Unfortunately, aborted encoding jobs cannot be "resumed."
---------------------------------------
7) New Command-line usage examples (v0.15)
---------------------------------------
The abbreviation "pproc" means "post-processor"
1) MPEG2AVI.EXE -b titanic.vob -f0 -2 -1 352 240 -o9 tit_mjpg.avi -r2
-f0 -> AVI-writer : set 23.976fps, decoder : use frame-mode
-2 -> pproc half-resolution output mode
-1 -> crop the image (360x240) to 352x240
-o9 -> AVI-writer (YUY2 mode)
-r2 -> 16-bit MMX IDCT (fast, reasonable accuracy)
2) MPEG2AVI.EXE -b gotmail16_9.vob -f0 -3Y 416 -q1 -o8 gotmail4_3.avi
-o8 -> AVI-writer (YV12 mode)
-q1 -> pproc : set "fast filter"
-3Y -> pproc : downscale HEIGHT -> 416 pixels
(video aspect-ratio is resized from 720x480 -> 720x416)
(AVI-file : 720x480)
3) MPEG2AVI.EXE -b gotmail16_9.vob -f0 -3X 424 -q1 -2 -1 320 240 ...
-3X -> pproc : downscale X-resolution to 424 (output is 424x480)
-1 -> pproc : set crop window (viewport) to <320x240>
-o7 -> AVI-writer (RGB24 mode)
pproc performs operations in this order :
**1) downscaling ('-3X' or '-3Y ')
**2) resolution-halving ('-2')
3) output window cropping('-1')
** (starting with v0.15B5, downscaling is performed first!)
4) MPEG2AVI.EXE -b gotmail6_9.vob -# 100 500 -f0 ... (see next line)
-3X 424 -q1 -2 -1 320 240
-# 100 500 -> starting writing AVI @ MPEG-frame #100,
terminate AVI @ MPEG-frame #500
(AVI-file starts and ends with fr #100 and #500,
for a total of 401 frames written.)
------------------------------
8) Command-line usage examples
------------------------------
Please note that the user's manual (mpeg2avi.txt) thoroughly documents
each command-line parameter. But if you're too lazy to read it, here
are the rest of the features...
< display to screen, no inverse-telecine, half-resolution output >
MPEG2AVI.EXE -b -2 -f -o6
eg. MPEG2AVI.EXE -b clip04.vob -f -o6
MPEG2AVI.EXE -b -f -s -1 704 480 -o6
where = 0,1,2,3,4
eg. MPEG2AVI.EXE -b bighit.vob -s3 -f -o6
MPEG2AVI.EXE -b -f -2 -1 352 240 -o7