7.6. Encoding with the `Video For Windows` codec family
Indietro | Capitolo 7. La codifica con MEncoder | Avanti

## 7.6. Encoding with the `Video For Windows` codec family

Video for Windows provides simple encoding by means of binary video codecs. You can encode with the following codecs (if you have more, please tell us!)

Note that support for this is very experimental and some codecs may not work correctly. Some codecs will only work in certain colorspaces, try `-vf format=bgr24` and `-vf format=yuy2` if a codec fails or gives wrong output.

### 7.6.1. Video for Windows supported codecs

Video codec file name | Description (FourCC) | md5sum | Comment
--- | --- | --- | ---
aslcodec_vfw.dll | Alparysoft lossless codec vfw (ASLC) | 608af234a6ea4d90cdc7246af5f3f29a |
avimszh.dll | AVImszh (MSZH) | 253118fe1eedea04a95ed6e5f4c28878 | needs `-vf format`
avizlib.dll | AVIzlib (ZLIB) | 2f1cc76bbcf6d77d40d0e23392fa8eda |
divx.dll | DivX4Windows-VFW | acf35b2fc004a89c829531555d73f1e6 |
huffyuv.dll | HuffYUV (lossless) (HFYU) | b74695b50230be4a6ef2c4293a58ac3b |
iccvid.dll | Cinepak Video (cvid) | cb3b7ee47ba7dbb3d23d34e274895133 |
icmw_32.dll | Motion Wavelets (MWV1) | c9618a8fc73ce219ba918e3e09e227f2 |
jp2avi.dll | ImagePower MJPEG2000 (IPJ2) | d860a11766da0d0ea064672c6833768b | `-vf flip`
m3jp2k32.dll | Morgan MJPEG2000 (MJ2C) | f3c174edcbaef7cb947d6357cdfde7ff |
m3jpeg32.dll | Morgan Motion JPEG Codec (MJPG) | 1cd13fff5960aa2aae43790242c323b1 |
mpg4c32.dll | Microsoft MPEG-4 v1/v2 | b5791ea23f33010d37ab8314681f1256 |
tsccvid.dll | TechSmith Camtasia Screen Codec (TSCC) | 8230d8560c41d444f249802a2700d1d5 | shareware error on windows
vp31vfw.dll | On2 Open Source VP3 Codec (VP31) | 845f3590ea489e2e45e876ab107ee7d2 |
vp4vfw.dll | On2 VP4 Personal Codec (VP40) | fc5480a482ccc594c2898dcc4188b58f |
vp6vfw.dll | On2 VP6 Personal Codec (VP60) | 04d635a364243013898fd09484f913fb |
vp7vfw.dll | On2 VP7 Personal Codec (VP70) | cb4cc3d4ea7c94a35f1d81c3d750bc8d | wrong FourCC?
ViVD2.dll | SoftMedia ViVD V2 codec VfW (GXVE) | a7b4bf5cac630bb9262c3f80d8a773a1 |
msulvc06.DLL | MSU Lossless codec (MSUD) | 294bf9288f2f127bb86f00bfcc9ccdda | Decodable by Window Media Player, not MPlayer (yet).
camcodec.dll | CamStudio lossless video codec (CSCD) | 0efe97ce08bb0e40162ab15ef3b45615 | sf.net/projects/camstudio

The first column contains the codec names that should be passed after the `codec` parameter, like: `-xvfwopts codec=divx.dll` The FourCC code used by each codec is given in the parentheses.

An example to convert an ISO DVD trailer to a VP6 flash video file using compdata bitrate settings:

    mencoder -dvd-device zeiram.iso dvd://7 -o trailer.flv \
    -ovc vfw -xvfwopts codec=vp6vfw.dll:compdata=onepass.mcf -oac mp3lame \
    -lameopts cbr:br=64 -af lavcresample=22050 -vf yadif,scale=320:240,flip \
    -of lavf -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames

### 7.6.2. Using vfw2menc to create a codec settings file.

To encode with the Video for Windows codecs, you will need to set bitrate and other options. This is known to work on x86 on both *NIX and Windows.

First you must build the vfw2menc program. It is located in the `TOOLS` subdirectory of the MPlayer source tree. To build on Linux, this can be done using Wine:

    winegcc vfw2menc.c -o vfw2menc -lwinmm -lole32

To build on Windows in MinGW or Cygwin use:

    gcc vfw2menc.c -o vfw2menc.exe -lwinmm -lole32

To build on MSVC you will need getopt. Getopt can be found in the original vfw2menc archive available at: The MPlayer on win32 project.

Below is an example with the VP6 codec.

    vfw2menc -f VP62 -d vp6vfw.dll -s firstpass.mcf

This will open the VP6 codec dialog window. Repeat this step for the second pass and use `-s `secondpass.mcf``.

Windows users can use `-xvfwopts codec=vp6vfw.dll:compdata=dialog` to have the codec dialog display before encoding starts.

Indietro | Risali | Avanti
7.5. Encoding with the `x264` codec | Partenza | 7.7. Using MEncoder to create QuickTime-compatible files