annotate DOCS/tech/win32-codec-howto.txt @ 36219:673719da1a92

Extract window creation code to common file.
author reimar
date Sun, 09 Jun 2013 18:33:21 +0000
parents 8ee2eb34a851
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28168
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
1 ============================
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
2 Win32 codecs importing HOWTO
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
3 ============================
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
4
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
5 This document describes how to extract the information necessary to hook
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
6 up Win32 binary codecs in MPlayer from a Windows system. Different methods
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
7 exist depending on which video API your codec uses and which Windows
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
8 version you have.
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
9
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
10 If you have gathered all the necessary information (fourcc, GUID, codec file,
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
11 sample file) as described below, notify the mplayer-dev-eng mailing list.
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
12 If you want to add a codec yourself, read DOCS/tech/codecs.conf.txt.
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
13
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
14
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
15
29025
22d4bb6bf629 typo fixes
diego
parents: 28902
diff changeset
16 VfW codecs
28168
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
17 ~~~~~~~~~~
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
18
29025
22d4bb6bf629 typo fixes
diego
parents: 28902
diff changeset
19 VfW (Video for Windows) is the old video API for Windows. Its codecs have
28168
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
20 the '.dll' or (rarely) '.drv' extension. If MPlayer fails at playing your
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
21 AVI with this kind of message:
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
22
28170
cc5cd29646a5 fix error message example
compn
parents: 28168
diff changeset
23 VIDEO: [HFYU] 352x288 24bpp 25.000 fps 4321.0 kbps (527.5 kbyte/s)
cc5cd29646a5 fix error message example
compn
parents: 28168
diff changeset
24 Cannot find codec matching selected -vo and video format 0x55594648.
28168
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
25
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
26 It means your AVI is encoded with a codec which has the HFYU fourcc (HFYU =
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
27 HuffYUV codec, DIV3 = DivX Low Motion, etc.). Now that you know this, you
28902
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
28 have to find out which DLL Windows loads in order to play this file.
29025
22d4bb6bf629 typo fixes
diego
parents: 28902
diff changeset
29 You can find the VfW codec by searching the internet for e.g. VIDC.HFYU.
28902
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
30
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
31 In our case, the 'system.ini' also contains this information in a line that reads:
28168
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
32
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
33 VIDC.HFYU=huffyuv.dll
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
34
28902
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
35 So you need the 'huffyuv.dll' file.
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
36
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
37
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
38
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
39 ACM Codecs:
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
40 ~~~~~~~~~~~~
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
41 MPlayer may fail at playing the audio in your file with this message:
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
42
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
43 Cannot find codec for audio format 0x55.
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
44 Audio: no sound
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
45
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
46 MPlayer calls this the TwoCC format identifier. From the TwoCC list we find:
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
47
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
48 0x0055 MPEG-1 Layer 3 (MP3)
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
49
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
50 If you are lucky, you can then just search the internet for "codec acm"
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
51 e.g. "mp3 acm". Or if the codec is already installed on Windows,
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
52 it will show up in the system.ini as:
28168
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
53
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
54 msacm.l3acm=L3codeca.acm
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
55
28902
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
56 Note that the audio codecs are specified by the MSACM prefix:
28168
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
57
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
58
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
59
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
60 DirectShow codecs:
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
61 ~~~~~~~~~~~~~~~~~~
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
62
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
63 DirectShow is the newer video API, which is even worse than its predecessor.
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
64 Things are harder with DirectShow, since 'system.ini' does not contain the
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
65 needed information, instead it is stored in the registry and we need the
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
66 GUID of the codec.
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
67
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
68
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
69 New Method:
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
70 -----------
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
71
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
72 Using Microsoft GraphEdit (fast)
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
73
28889
3ec026797553 GraphEdit is also available in the Microsoft SDK nowadays.
diego
parents: 28170
diff changeset
74 - Get GraphEdit from the Microsoft SDK, DirectX SDK or doom9.
28168
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
75 - Start 'graphedit.exe'.
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
76 - From the menu select "Graph -> Insert Filters".
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
77 - Expand item "DirectShow Filters".
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
78 - Select the right codec name and expand item.
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
79 - In the entry "DisplayName" look at the text in winged brackets after the
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
80 backslash and write it down (five dash-delimited blocks, the GUID).
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
81 - The codec binary is the file specified in the "Filename" entry.
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
82
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
83 If there is no "Filename" and "DisplayName" contains something like
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
84 'device:dmo', then it is a DMO-Codec.
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
85
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
86
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
87 Old Method:
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
88 -----------
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
89
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
90 Take a deep breath and start searching the registry...
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
91
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
92 - Start 'regedit'.
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
93 - Press "Ctrl-F", disable the first two checkboxes, and enable the third.
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
94 Type in the fourcc of the codec (e.g. "TM20").
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
95 - You should see a field which contains the path and the filename (e.g.
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
96 "C:\WINDOWS\SYSTEM\TM20DEC.AX").
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
97 - Now that you have the file, we need the GUID. Try searching again, but
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
98 now search for the codec's name, not the fourcc. Its name can be acquired
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
99 when Media Player is playing the file, by checking
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
100 "File -> Properties -> Advanced".
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
101 If not, you are out of luck. Try guessing (e.g. search for TrueMotion).
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
102 - If the GUID is found you should see a "FriendlyName" and a "CLSID" field.
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
103 Write down the 16 byte CLSID, this is the GUID we need.
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
104
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
105 If searching fails, try enabling all the checkboxes. You may have
d093bee92b15 Convert Win32 codec importing HOWTO into a text document in the tech section.
diego
parents:
diff changeset
106 false hits, but you may get lucky...
28902
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
107
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
108
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
109
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
110 Tips:
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
111 ~~~~~~~
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
112 If you get an error loading a new codec, it may need some more files to work.
29025
22d4bb6bf629 typo fixes
diego
parents: 28902
diff changeset
113 Start the filemon utility before loading MPlayer to find out which DLLs are
28902
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
114 trying to be loaded.
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
115
29025
22d4bb6bf629 typo fixes
diego
parents: 28902
diff changeset
116 Your codec may load some external DLL libraries. If the codec is already
28902
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
117 installed in Windows, run listdlls wmplayer.exe while Windows Media
c950f0c545f6 add some info for acm and tips for searching
compn
parents: 28889
diff changeset
118 Player is playing your file to find out which.