Contents
VMPEG (Version 1.7 Lite) Help Contents

Copyright

About VMPEG

Demo vs. Full version

Installing VMPEG

Loading an MPEG stream

Audio Configuration

Video Configuration

Controls

Information and Statistics

Supported MCI Commands

Troubleshooting

Known Bugs

References


Copyright

VMPEG 1.7 is copyrighted software, © Stefan Eckart, 1995. You may use, copy and distribute this program solely for demonstration purposes, only in  unmodified form and without charging money for it. Commercial use of this demonstration version is strictly prohibited.

Disclaimer: This program comes without any warranty. You are using it at your own risk.

The author can be can be reached by email:

stefan@chromatic.com

or by mail:

Stefan Eckart
555 W Middlefield Rd, Apt. K203
Mountain View, CA 94043
USA

Email is preferred. Suggestions for improvements and bug reports are highly appreciated. Although I can not answer all VMPEG related emails due to time constraints, all of them are taken into account for future releases.


About VMPEG

VMPEG is a fast software decoder for MPEG encoded video sequences. Both video and audio are decoded in real-time (with frame-dropping, if the processor is not fast enough) and output synchronously to the graphics card and sound card of the PC. There are currently two major application areas for MPEG-1 software decoding: Video CD playback and transmission of video via the Internet (e.g. World Wide Web). Video CD is by far the more ambitious task. You will need at least a Pentium 90, a PCI graphics card, and a 2x (better 4x) CD-ROM. Best results are obtained when using a DCI graphics cards accelarating some of the decoding steps with dedicated hardware.

VMPEG supports system layer MPEG streams (the type used on Video CDs), video only MPEG streams (many streams on the Internet are of this type), and video only MPEG streams accompanied by unencoded wave audio files (.wav files). The latter is not 'real' MPEG, it is not standardized by ISO/ITU-T, but it has been used for some applications in the past (it requires less computational resources than MPEG audio), and there are still a lot of such streams available. Audio only streams (*.mp2) are currently not supported.

Direct playback from harddisk, CD-ROM and Video CD are possible with VMPEG. Video CD format differs from CD-ROM by using more data (and less error-correction) per sector (2324 bytes instead of 2048), which improves the video quality because less compression is required. Video CD playback capability depends on the CD drive and the associated drivers to support reading this modified sector format. I can not guarantee that it will work with your CD drive. Just try it out. Playback of older CDs labeled 'Digital Video on CDi' but not showing the Video CD logo (Green Book format), are currently not supported.

VMPEG supports a variety of interfaces to the graphics card. GDI (Graphics Device Interface) is the slowest alternative, used only if none of the faster interfaces is available. WinG, which is included in the VMPEG archive, improves speed considerably for most graphics cards in 8 bit mode (256 colors). VMPEG also supports DrawDIB. This requires installation of the Video for Windows runtime system (msvideo.dll etc.). It slighlty improves TrueColor playback and comes with a 256 color dithering algorithm that works for arbitrary scale factors (but is much slower than the algorithms used by VMPEG internally). The third interface supported by VMPEG is DCI, which permits the use of certain hardware acceleration features of graphics cards (color space conversion, scaling).

VMPEG comes with an MCI driver which permits using the Media Player (and many other MCI based applications) to play MPEG files in a manner similar to Video for Windows AVI files. The most noticeable advantage of using the MCI driver is random access into the MPEG stream (via the position slider of the Media Player). The MCI driver now covers most of the applicable MCI commands from the MCI digital video extensions, the MPEG MCI command set (OM-1 Open MPEG Windows API), and even some of the AVI extensions..

The MPEG player also comes with a stand-alone user interface, which you can use instead (or in addition) to the Media Player. It does not support random access in the stream, but provides some useful menu options to obtain additional information on the MPEG stream and the playback performance.

VMPEG is a Windows 3.1 application, it requires no upgrades (like Win32s). It also runs in Windows 95. Using VMPEG on Windows NT is not recommended, it doesn't seem to run stable there.

While WinG is included in the full VMPEG archive, it is also available separately by anonymous ftp:

WinG:	ftp.microsoft.com:/developr/drg/WinG/WinG10.ZIP

The Video for windows runtime (currently version 1.1e) is at:

VfW runtime:	ftp.microsoft.com:/softlib/mslfiles/wv1160.exe

The 'official' distribution site for VMPEG is

ftp.netcom.com:/pub/cf/cfogg/vmpeg/

Refer to this location for the most recent release of VMPEG.


MPEG (Moving Pictures Expert Group) is a video compression algorithm standardized by the International Organization for Standardization (ISO) and the International Electrotechnical Commission (IEC) as ISO/IEC IS 11172.  Main application of MPEG is the storage and retrieval of video on/from Compact Disc at a rate of about 1.5 Mbit/sec.


Demonstration vs. Full Version

VMPEG 1.7 Lite is a demonstration version. While video playback is unlimited, Video CD playback and audio is restricted to the first 60 seconds of an MPEG sequence.

The full version of VMPEG provides unrestricted stereo audio output and Video CD support. This commercial version is not yet available, however.


The Display Control Interface (DCI), defined by Intel and Microsoft, is a driver-level interface providing device-independent access to video output related graphics card features like color-space conversion, image sizing (interpolation to full-screen), and graphics overlays. It may be superseded by a different API (DirectDraw) in the near future.


The Media Control Interface is part of the Windows Multimedia API. It allows the unified control of multimedia devices (CD audio discs,MIDI synthesizers, waveform sound data in- and output, etc.) by high-level commands. These may either be text strings (e.g. "play test.mpg") or program calls using predefined data structures.


Installing VMPEG

To install VMPEG,

•	create a temporary directory, e.g.

MD VMPEG.INS

•	change to this directory

CD VMPEG.INS

•	run the self-extracting zip-archive VMPEG17.EXE

..\VMPEG17

(or use PKUNZIP ..\VMPEG17.EXE)

•	if you have got VMPEG17.ZIP instead of VMPEG17.EXE (some ftp archives don't accept self-extracting files):

PKUNZIP ..\VMPEG17.ZIP

•	run the setup program (from either DOS or Windows)

SETUP

The setup program will ask if you want to install the WinG runtime libraries. Installing them usually improves performance considerably. On the the other hand there are some graphics cards which are not entirely compatible with WinG. In this case you may have to de-install WinG as described below. WinG is not necessary for good performance in Windows 95 (provided Windows 95 graphics drivers are available for your card).

Be aware that the installation of WinG may overwrite an existing dva.386 in the windows\system directory. It may be a good idea to make a backup of this file before installing WinG. Otherwise you might have to re-install the Windows drivers for your graphics card (in case you run into problems with WinG).

If you start VMPEG (or any other program using WinG) for the first time, a performance test window appears which adapts and optimizes WinG for the VGA in your PC. This may take several minutes.

The setup program performs the following steps:

if you choose to install WinG:

1.	copies the files wing.dll, wing32.dll, wingde.dll, wingdib.drv, and wingpal.wnd to the windows\system directory.

2.	copies dva.386 to the windows\system directory and adds a line 'device=D:\WINDOWS\SYSTEM\dva.386' to the [386Enh] section of system.ini (only for Windows 3.1x)

In any case:

3.	copies vmpegwin.exe, vmpeg.hlp, readme.txt, oemsetup.inf, and mcivmpeg.inf to the directory you have been prompted for

4.	copies the files vmpeg.dll, mcivmpeg.drv, and ctl3d.dll to the windows\system directory.

5.	creates a program group and program entries for VMPEG, the associated help file and for the readme file in the program manager

6.	registers the MCI driver with Windows (by modifying SYSTEM.INI, CONTROL.INI, and WIN.INI)

7.	associates .MPG, .DAT (and some other) extensions with the Media Player by adding entries to the registry database and WIN.INI.

8.	asks you to restart Windows (only if dva.386 is installed and has not been installed earlier)

To de-install VMPEG and/or WinG simply reverse these steps manually.

You can now use the Media Player to play MPEG files. Double-clicking on MPEG files will automatically launch the MPEG player. You can also embed MPEG files into documents via OLE. It is recommended to use the improved version of the Media Player included in the Video for Windows runtime rather than the original one included in Windows 3.1 and 3.11.

The MCI driver can be uninstalled via the control panel. In this case you should also delete the lines 'mpg=MpegVideo' and 'dat=MpegVideo' from the [mci extensions] sections of the WIN.INI file in the Windows directory.

WinG (including the development kit) is also available separately from:

ftp.microsoft.com:/developr/drg/WinG/WinG10.ZIP

and via CompuServe.

The MCI driver is automatically installed by the setup program. You can re-install it by running the setup program again, or from the control panel drivers applet:

1.	from the Drivers dialog box, choose the Add button

2.	select Unlisted or Updated Driver and click OK

3.	enter the path name of your installation directory (containing the file oemsetup.inf) or click Browse... to locate this directory, then click OK

4.	select the '[MCI] VMPEG MPEG Player' from the list of drivers (actually this is the only one), and choose the OK button

5.	quit the Drivers dialog box

You can now use the Media Player to play MPEG files. It is recommended to use the improved version included in the Video for Windows runtime rather than the original one included in Windows 3.1 and 3.11.

The MCI driver can be uninstalled via the control panel. In this case you should also delete the lines 'mpg=MpegVideo' and 'dat=MpegVideo' from the [mci extensions] sections of the WIN.INI file in the Windows directory.

To re-install the MCI driver in Windows 95 (much more user-friendly than in Windows 3.x...):

1.	select 'Add New Hardware' (isn't the Windows 95 user interface intuitive...) from the Control Panel (in Start->Settings)

2.	skip to the hardware selection dialog with the Next button

3.	check 'Install specific hardware'

4.	double-click the 'Sound, video and game controllers' list entry

5.	press the 'Have Disk' button,

6.	enter the path of the VMPEG directory (or use the Browse... button to select it)

7.	press OK to leave the 'Install From Disk' dialog,

8.	double-click [MCI] VMPEG MPEG Player in the 'Select Device' dialog,

9.	press finish to start the actual installation

10.	you may modify the VMPEG configurations with the displayed configuration boxes, or do this later

11.	select yes to the question if you want to restart Windows


Loading an MPEG stream

Use the File->Open... menu item to select an MPEG stream for playback. This will stop and close the previously selected stream.

The second method for loading an MPEG stream is by starting VMPEG with a command line containing the file name of the stream as a parameter. This is for example used for playing MPEG files from a WWW browser. VMPEG recognizes the two command line options /play and /close (similar to the Media Player). /play automatically starts playback (the default is to display the first frame in paudes mode), /close exits the program after the video sequence has finished. Example:

VMPEGWIN /PLAY /CLOSE DEMO.MPG

If you register the .mpg extension with the file manager, you can play MPEG files simply by double clicking them.


Audio Configuration

Enter the audio configuration dialog by selecting the Configure->Audio... menu item.

Audio On / Off lets you turn audio on or off. This, like the other audio configuration options, becomes only effective after the next Play command.

The 8 bit / 16 bit option determines the data format of the decoded audio. As the speed penalty for 16 bit audio is negligible, the only use for this option is to cope with 8 bit sound cards which don't support 16 bit waveform data.

The -12dB / 0dB / +12dB option controls playback volume. This may be useful to avoid distortion with audio data recorded at a very high level or quantization noise with very low volume audio (especially in 8 bit mode).

Mono / Left / Right / Stereo selects the channel for multi-channel audio (stereo or dual channel). Mono plays the sum of both channels.

Fixed / Float selects the arithmetic used in the decoder. Fixed is faster on 486 CPUs, while Float has higher performance on Pentium machines.


Video Configuration

Enter the video configuration dialog by selecting the Configure->Video... menu item.

Gray / 8 bit / 8 bit 4x / 24 bit selects the display format. Grayscale display is fastest while 24 bit gives best quality. 8 bit display is in most cases the best choice, combining high display speed with moderate color reproduction. The 8 bit 4x mode stretches the display by a factor of 2 in each direction.

Sync / Sync I/P / All / I&P / I / fps determines which frames are to be displayed and at what speed. Sync selects synchronous display, achieved by either repeatedly displaying or by skipping frames. Sync mode is required for synchronous playback of video and audio. Sync I/P is similar to Sync, but skips all B frames. This sometimes leads to smoother playback. fps permits manual setting of the playback speed in the range of 1 to 60 frames per second (fps). The All option displays all frames at maximum speed, I&P skips B frames, I skips both B and P frames.

The Disable DCI / Disable DrawDib / Disable WinG checkboxes selectively disable one or more of the graphics interfaces. You can use this to optimze playback speed versus quality or to disable an API which doesnt work properly on your system. To find out, which API is actually used, look at the Performance Stats... output. DCI requires a graphics cards which supports DCI, DrawDib requires installation of Video for Windows, WinG requires installation of the WinG runtime system.


Controls

The main window of VMPEG contains four buttons: Stop, Play, Pause, Step. These are used to control playback of the selected MPEG stream. The same functions are also available as menu items in the Control menu.

Press Stop (or F5) to end playback of the MPEG stream. This will rewind the stream to the beginning. You can also stop playback by closing the video window (by double clicking the system menu button).

Press Play (or F6) to start playback of a stopped MPEG stream or to continue playback of a paused stream.

Press Pause (or F7) to temporarily stop playback of the MPEG stream. To continue playback, press Play. To step forward through the sequence press Step.

Press Step (or F8) to step forward through a paused MPEG stream. Each step will advance to the next video frame.


Information and Statistics

The Help menu contains two entries providing additional information.

The Stream Info... item displays information contained in the headers of the video and audio streams. The coding pattern shows the picture types used for the first couple of frames in the sequence (I = intra coded pictures, P = predictive coded pictures, B = bidirectionaly interpolated pictures). Sequence headers are denoted by an s, Group of Pictures headers by a g.

The Performance Stats... item shows the effective frame rate of the most recently played MPEG stream. It is only updated if the stream is stopped (not paused) or played completely. The output includes an estimate of how much time was spend for reading data, graphics display output and audio decoding.


MCI Commands

                          MCI command list for VMPEG MCI driver

                          =====================================

Details about how to use the MCI command set can be found in:

- Windows 3.1 SDK Multimedia Reference

- Digital Video MCI Command Set Specification

- MPEG MCI Command Set Specification

which are available from Microsoft.

All commands support the following flags:

           notify

           test (except open and close commands)

           wait

capability

           can eject

           can freeze

           can lock

           can play

           can record

           can reverse

           can save

           can stretch

           can stretch input

           can test

           compound device

           device type

           has audio

           has still

           has video

           maximum play rate

           minimum play rate

           uses files

           uses palettes

           windows

close

configure

info

           file

           product

           version

           window text

open 'element'

           alias 'alias'

           parent 'hwnd'

           style 'StyleValue'

           type 'device_type'

pause

play

           from 'position'

           to 'position'

put

           destination

           destination at 'rectangle'

           source

           source at 'rectangle'

           window

           window at 'rectangle'

           window client

           window client at 'rectangle'

realize

seek

           to 'position'

           to start

set

           time format [milliseconds | ms | frames]

           video [on | off]

setvideo

           on

           off

signal

           cancel

           at 'position'

           every 'interval'

           return position

           uservalue 'id'

status

           current track

           forward

           frames skipped

           length

           mode

           number of tracks

           palette handle

           pause mode

           position

           position track 'TrackNo'

           ready

           seek exactly

           start position

           time format

           video

           video bitrate

           video maxbitrate

           video streams

           window handle

           window maximized

           window minimized

           window visible

           (audio streams)

           (audio bitrate)

step

stop

update

           hdc 'hdc'

where

           destination

           destination max

           source

           source min

           source max

           window

           window max

window

           handle 'hwnd'

           handle default

           state [hide | minimize | restore | show | show maximized | show minimzed |

                  show min noactive | show na | show normal]


Troubleshooting

Here are some hints of what to do if you get unexpected results:

In case of performance problems, look at the Performance Stats... output to find out which part of the player takes most of the time.

Add a line 'Debug=1' to the VMPEG.INI files. This generates messages boxes for a variety of potential problems, which are otherwise silently accepted.

If you get bad graphics performance, try to disable some of the graphics output APIs (DCI, DrawDib, WinG), to find out which works best on your platform (unfortunately there are no general guidelines for this).

If you get bad CD playback speed, try to turn of CD caching (SMARTDRV).

If audio doesn't work with 16 bit, switch to 8 bit output via the Audio Configuration dialog.

Look at the list of known bugs for limitations of the current release.

If everything else fails report the problem to me (stefan@chromatic.com).


Known Bugs

Known bugs and limitations of this release:

- only one instance of VMPEG can be run simultaneously

- CDi (green book) can only be played via the MCI driver,

  but not from applications using a file selector box to

  get the MPEG file name (like Media Player)

- D pictures are not yet supported (you will have a hard time

  to find a D pictures MPEG stream anyway)

- audio layer I streams do not work correctly

- MPEG audio rates other than 44.1 kHz don't work

- VMPEG sometimes crashes when exiting the program after doing seeks

  in the stream

- VMPEG somtimes crashes when exiting the program after changing

  the video configuration during playback

- the seek command always seeks to the next key-frame after the given

  position instead of before the given position or the exact position

- DCI support is limited to YV12 format and only tested with the

  Diamond Viper Pro Video

- VMPEG sometimes crashes Windows under low memory conditions

  (unfortunately this seems to be a bug of the compiler runtime

  library, not VMPEG itself)

- changing audio settings via the Media Player Configure...

  menu item only becomes effective after closing and re-opening

  the MPEG file

- Video CD playback may require turning off SMARTDRV caching for

  the CD-ROM (/U option); this is at least the case for Mitsumi

  IDE (ATAPI) drives (as is mentioned in the Mitsumi CD-ROM driver

  docs)

- extracting frames for OLE based embedding of MPEG streams into

  documents does not work if DrawDib or DCI is used for output

- seek does not properly resynchronize .wav audio files to video

  (would require a frame directory or pre-scanning the stream)


References

1.	Coding of moving pictures and associated audio for digital storage media up to about 1,5 Mbit/s, International Standard ISO/IEC IS 11172, 1993.

2.	Stefan Eckart, High performance software MPEG video player for PCs, Proceedings of the IS&T/SPIE Symposium on Electronic Imaging: Science & Technology / Digital Video Compression: Algorithms and Technologies 1995.

3.	Documentation of the MSSG MPEG-2 codec (mpeg2codec, see below).

4.	Documentation of the PVRG MPEG software: a thorough overview covering many aspects of MPEG.

Related Software

Note: this list is perhaps not quite up-to-date

This list is definitely incomplete, but it's all I have at my fingertips. Of course there are programs for other systems as well (Mac, Amiga etc.). A variety of additional MPEG related resources are listed in

ftp.netcom.com:/pub/cf/cfogg/other_ftp_sites

mpeg2codec	MPEG-1 and MPEG-2 codec from the MPEG Software Simulation Group
Authors: Stefan Eckart, Chad Fogg, Cheung Aeyung, Sorin Papuc
Includes source code for Unix X11 and Windows (Win32s / NT) and compiled versions for PC.
ftp.netcom.com:/pub/cf/cfogg/mpeg2/*

mpeg2play	a speed optimized version of the decoder from mpeg2codec
ftp.netcom.com:/pub/cf/cfogg/mpeg2/mpeg2play*

mpeg_play	MPEG Video Software Decoder (Version 2.0; Jan 27, 1993)
Authors: Lawrence A. Rowe, Ketan Patel, and Brian Smith, Computer Science Division-EECS, Univ. of Calif. at Berkeley
s2k-ftp.cs.berkeley.edu:/pub/multimedia/mpeg/mpeg-2.0.tar.Z

cmpeg	an MPEG encoder for the PC (DOS, 640K, no '386 req.) for Targa, PBMPLUS and Alchemy RAW images
Author: Stefan Eckart
garbo.uwasa.fi:/pc/graphics/cmpeg10.zip

dmpeg	MPEG decoder and player for the PC (DOS, 640K, VGA)
Author: Stefan Eckart
garbo.uwasa.fi:/pc/graphics/dmpeg11.zip

mpegwin	Port of mpeg_play for MS-Windows
Author: Michael Simmons, msimmons@ecel.uwa.edu.au
ftp.ecel.uwa.edu.au:/users/michael/mpegw32h.zip
(US mirror: ftp.netcom.com:/pub/ms/msimmons/mpegw32h.zip)
(HiColor & TrueColor support, Shareware)

mpeg.exe	DOS MPEG player from Xing Technologies (XingIt V2.1)
(high speed, but decodes only a small subset of the MPEG standard, audio (.WAV,.MP2) support, Windows)
mpegview.zip (available from many ftp sites)

MPEGv1.1/1.2alpha	MPEG Software Encoder/Decoder
Authors: Portable Video Research Group (PVRG)
havefun.stanford.edu:/pub/mpeg/MPEGv*.tar.Z

display	a display program for pictures and animations including MPEG (based on mpeg_play)
Author: Jih-Shin Ho, u7711501@bicmos.ee.nctu.edu.tw
NCTUCCCA.edu.tw:/PC/graphics/disp/disp*.zip

mplex	an MPEG-1 system layer multiplexer; combines separate MPEG-1 encoded video and audio into a single multiplexed system layer stream
Author: Christoph Moar, moar@informatik.tu-muenchen.de
ftp.informatik.tu-muenchen.de:/pub/comp/graphics/mpeg/mplex/mplex-1.0a_beta.tar.gz

musicin, musicout	ISO MPEG committee audio codec, supports layer I and II
sunsite.unc.edu:/pub/electronic-publications/IUMA/audio_utils/converters/