Get rid of the "set" member of the subopt-parser struct, it made
[mplayer/glamo.git] / DOCS / tech / win32-codec-howto.txt
blob81dfafca831866c252d8dd2ba248c4f39c315227
1 ============================
2 Win32 codecs importing HOWTO
3 ============================
5 This document describes how to extract the information necessary to hook
6 up Win32 binary codecs in MPlayer from a Windows system. Different methods
7 exist depending on which video API your codec uses and which Windows
8 version you have.
10 If you have gathered all the necessary information (fourcc, GUID, codec file,
11 sample file) as described below, notify the mplayer-dev-eng mailing list.
12 If you want to add a codec yourself, read DOCS/tech/codecs.conf.txt.
16 VFW codecs
17 ~~~~~~~~~~
19 VFW (Video for Windows) is the old video API for Windows. Its codecs have
20 the '.dll' or (rarely) '.drv' extension.  If MPlayer fails at playing your
21 AVI with this kind of message:
23 VIDEO:  [HFYU]  352x288  24bpp  25.000 fps  4321.0 kbps (527.5 kbyte/s)
24 Cannot find codec matching selected -vo and video format 0x55594648.
26 It means your AVI is encoded with a codec which has the HFYU fourcc (HFYU =
27 HuffYUV codec, DIV3 = DivX Low Motion, etc.). Now that you know this, you
28 have to find out which DLL Windows loads in order to play this file. In our
29 case, the 'system.ini' contains this information in a line that reads:
31 VIDC.HFYU=huffyuv.dll
33 So you need the 'huffyuv.dll' file. Note that the audio codecs are
34 specified by the MSACM prefix:
36 msacm.l3acm=L3codeca.acm
38 This is the MP3 codec.
42 DirectShow codecs:
43 ~~~~~~~~~~~~~~~~~~
45 DirectShow is the newer video API, which is even worse than its predecessor.
46 Things are harder with DirectShow, since 'system.ini' does not contain the
47 needed information, instead it is stored in the registry and we need the
48 GUID of the codec.
51 New Method:
52 -----------
54 Using Microsoft GraphEdit (fast)
56 - Get GraphEdit from either DirectX SDK or doom9.
57 - Start 'graphedit.exe'.
58 - From the menu select "Graph -> Insert Filters".
59 - Expand item "DirectShow Filters".
60 - Select the right codec name and expand item.
61 - In the entry "DisplayName" look at the text in winged brackets after the
62   backslash and write it down (five dash-delimited blocks, the GUID).
63 - The codec binary is the file specified in the "Filename" entry.
65 If there is no "Filename" and "DisplayName" contains something like
66 'device:dmo', then it is a DMO-Codec.
69 Old Method:
70 -----------
72 Take a deep breath and start searching the registry...
74 - Start 'regedit'.
75 - Press "Ctrl-F", disable the first two checkboxes, and enable the third.
76   Type in the fourcc of the codec (e.g. "TM20").
77 - You should see a field which contains the path and the filename (e.g.
78   "C:\WINDOWS\SYSTEM\TM20DEC.AX").
79 - Now that you have the file, we need the GUID. Try searching again, but
80   now search for the codec's name, not the fourcc. Its name can be acquired
81   when Media Player is playing the file, by checking
82   "File -> Properties -> Advanced".
83   If not, you are out of luck. Try guessing (e.g. search for TrueMotion).
84 - If the GUID is found you should see a "FriendlyName" and a "CLSID" field.
85   Write down the 16 byte CLSID, this is the GUID we need.
87 If searching fails, try enabling all the checkboxes. You may have
88 false hits, but you may get lucky...