Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to check for wmv 9 codec?

94 views
Skip to first unread message

Ariel

unread,
Dec 15, 2005, 11:12:04 AM12/15/05
to
Hi,
I'm writing a simple piece of e-learning that will use some Windows Media 9
video.
What can my program look for on the end-user's computer to see if the proper
codec is installed?
If I wanted to know about 9, 9.1, advanced profile, etc.. Is there a list of
what to look for for each of them?
Thanks,
Ariel

Ariel

unread,
Dec 16, 2005, 9:11:02 AM12/16/05
to
Does anyone out there know the answer to this?
I really like WMV and want to use it, but can't unless I can determine if
the end-user is capable of decoding it!
On the computers I've looked at (only XP and ME), the decoder is
wmvdmod.dll. The file version is either 10.xxx or 9.xxx, and I assume that
means WMPlayer 10 or 9. But earlier WM Players can decode WM9 video (wmv3)
and audio if the codec pack is installed.

So, where do I look for the codec?

I really need help on this one, please,
Ariel

Alessandro Angeli [MVP::DigitalMedia]

unread,
Dec 16, 2005, 3:00:50 PM12/16/05
to
Ariel wrote:

> Does anyone out there know the answer to this?
> I really like WMV and want to use it, but can't unless I
> can determine if the end-user is capable of decoding it!
> On the computers I've looked at (only XP and ME), the
> decoder is wmvdmod.dll. The file version is either 10.xxx
> or 9.xxx, and I assume that means WMPlayer 10 or 9. But
> earlier WM Players can decode WM9 video (wmv3) and audio
> if the codec pack is installed.
>
> So, where do I look for the codec?

wmvdmod.dll *is* the WMV decoder (it's implemented as a DMO
object).

You can check the DLL version (just download the codec pack,
unzip it with WinRAR, and look at the DLL version) or you
can look in the registry:

1. the following key must exist

[HKEY_CLASSES_ROOT\DirectShow\MediaObjects\82d353df-90bd-4382-8bc2-3f6192b76e34]

2. its "InputTypes" value must contain 'WMV3' (better look
for it in a case-insensitive manner)


--
// Alessandro Angeli
// MVP :: Digital Media
// a dot angeli at psynet dot net


Ariel

unread,
Dec 19, 2005, 1:17:03 PM12/19/05
to
Alessandro,
Thanks for the help.
I don't have the means to verify this on any computers with an older version
of WM Player installed. Will this still work for older players that have
newer codecs installed?
Still, it works for me on WM Player 9 and 10 in WinXP and WinME.
Thanks,
Ariel

Geoff Dunbar [MSFT]

unread,
Dec 19, 2005, 2:42:21 PM12/19/05
to
"Alessandro Angeli [MVP::DigitalMedia]" <nob...@nowhere.in.the.net> wrote in
message news:uKCFYunA...@TK2MSFTNGP11.phx.gbl...

You can do the programmatic equivalent of (1) using the DMOEnum() APIs, if
you're looking to write code. I'd probably recommend that over grovelling
through the registry. Look up DMOEnum in MSDN.

Geoff

--
This posting is provided "AS IS" with no warranties, and confers no rights.


Alessandro Angeli [MVP::DigitalMedia]

unread,
Dec 19, 2005, 2:47:51 PM12/19/05
to
Ariel wrote:

> I don't have the means to verify this on any computers
> with an older version of WM Player installed. Will this
> still work for older players that have newer codecs
> installed?
> Still, it works for me on WM Player 9 and 10 in WinXP and
> WinME.

The WMV9 decoder is implemented as a DMO and the registry
keys are the DMO registration info, without which the system
wouldn't even know the DLL is there, so, as long as MS
distributes the WMV9 decoder implemented as a DMO, this will
work for every version of the decoder and on every version
of Windows. I see no reason why MS would re-implement the
WMV9 decoder as something other than DMO in the foreseeable
future.

The March Hare [MVP]

unread,
Dec 19, 2005, 3:15:47 PM12/19/05
to
On Mon, 19 Dec 2005 11:42:21 -0800, Geoff Dunbar [MSFT] wrote:

> ... I'd probably recommend that over grovelling
> through the registry.

Grovelling?

Grovel:

1.To behave in a servile or demeaning manner; cringe.
2.To lie or creep in a prostrate position, as in subservience or humility.
3.To give oneself over to base pleasures: “Have we not groveled here long
enough, eating and drinking like mere brutes?” (Walt Whitman).

--
Please read this before replying:
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution

Alessandro Angeli [MVP::DigitalMedia]

unread,
Dec 19, 2005, 4:22:14 PM12/19/05
to
Geoff Dunbar [MSFT] wrote:

>> 1. the following key must exist
>>
>> [HKEY_CLASSES_ROOT\DirectShow\MediaObjects\82d353df-90bd-4382-8bc2-3f6192b76e34]
>>
>> 2. its "InputTypes" value must contain 'WMV3' (better
>> look for it in a case-insensitive manner)
>

> You can do the programmatic equivalent of (1) using the
> DMOEnum() APIs, if you're looking to write code. I'd
> probably recommend that over grovelling through the
> registry. Look up DMOEnum in MSDN.

I'd still prefer looking into the registry myself because
it's faster, uses far less resources and requires less code,
but you're right and DMOEnum() most likely *is* easier for
beginners.

Can't you also do (2) by specifying
WMMEDIATYPE_Video/WMMEDIASUBTYPE_WMV3 as
DMO_PARTIAL_MEDIATYPE? Otherwise it's not useful just
enumerating the DMOs, because the WMV decoder DMO may be
there but it may not support WMV9 if it's an older v7/v8
version.

Ariel

unread,
Dec 20, 2005, 8:42:03 AM12/20/05
to
Alessandro and Geoff,
it appears that this registry key is empty on Win2000 machines (with the
codec installed). I'm in a discussion about this on another site, confer this
link:
http://listserv.cc.kuleuven.ac.be/cgi-bin/wa?A2=ind0512c&L=aware&O=D&F=&S=&P=9073

I don't have a Win2000 machine to test this on (only XP and ME). So,
1. It appears that checking the registry key
[HKEY_CLASSES_ROOT\DirectShow\MediaObjects\82d353df-90bd-4382-8bc2-3f6192b76e34]
is not the way to go.
2. Is checking the key
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Windows
Media\WMSDK\VideoEncode]
a viable alternative?

Thanks again for helping me sort this all out.
Ariel

"Alessandro Angeli [MVP::DigitalMedia]" wrote:

Alessandro Angeli [MVP::DigitalMedia]

unread,
Dec 20, 2005, 10:13:17 AM12/20/05
to
Ariel wrote:

> 1. It appears that checking the registry key
> [HKEY_CLASSES_ROOT\DirectShow\MediaObjects\82d353df-90bd-4382-8bc2-3f6192b76e34]
> is not the way to go.

How did you determine that the WMV9 decoder is installed? By
playing a WMV9-encoded file? Using which player?

The WMV9 decoder documentation clearly states that the CLSID
of the WMV9 decoder is CLSID_CWMVDecMediaObject, which
corresponds to the above
{82d353df-90bd-4382-8bc2-3f6192b76e34} value (as defined in
wmcodecconst.h). Since a DMO *must* be registered there,
otherwise it is not installed as far as the system knows, it
is impossible for the decoder to be installed while that key
does not exist or is empty. Notice that the presence of the
wmvdmod.dll is not enough to assume that the WMV9 decoder is
installed: that DLL must also be properly registered and it
must be a version that supports WMV9 and not just WMV7/8.

Just out of curiosirty, do you have any other key under
[HKEY_CLASSES_ROOT\DirectShow\MediaObjects] whose default
value is "WMVideo Decoder DMO"?

> 2. Is checking the key
> [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Windows
> Media\WMSDK\VideoEncode]
> a viable alternative?

No. Try the DMOEnum() suggestion by Geoff, even though it is
just an API-level interface to read the DMO registry, so it
is bound to produce the same results as querying the
registry directly.

Ariel

unread,
Dec 21, 2005, 5:42:03 AM12/21/05
to
Alessandro,
I don't have a Win2000 computer available to me, but an associate does. He
tested this and wrote to me:
"On that Win2000 box I played a Windows Media 9 Video encoded file via the
installed Windows Media Player 9 and is was fine. This would lead me to
conclude that that key, at least on a Win2000 box isn't a bullet-proof way to
determine whether the box has the codec or not. "
He attached a gif image of the registry key. I'll email it to you.

"Alessandro Angeli [MVP::DigitalMedia]" wrote:

> How did you determine that the WMV9 decoder is installed? By
> playing a WMV9-encoded file? Using which player?
>

Alessandro Angeli [MVP::DigitalMedia]

unread,
Dec 21, 2005, 8:25:25 AM12/21/05
to
Ariel wrote:

> Alessandro,
> I don't have a Win2000 computer available to me, but an
> associate does. He tested this and wrote to me:
> "On that Win2000 box I played a Windows Media 9 Video
> encoded file via the installed Windows Media Player 9 and
> is was fine. This would lead me to conclude that that
> key, at least on a Win2000 box isn't a bullet-proof way
> to determine whether the box has the codec or not. "
> He attached a gif image of the registry key. I'll email
> it to you.

Well, WMP v7+ is not a good test, since it handles WMV in a
special way.

Anyway, from your screenshot I think I know what the problem
is: you are looking at the subkey [InputTypes] instead of at
the value "InputTypes" of the key
[HKEY_CLASSES_ROOT\DirectShow\MediaObjects\82d353df-90bd-4382-8bc2-3f6192b76e34].

In any case, the subkeys of the [InputTypes] subkey are
equivalent to the binary blob of the "InputTypes" value:
where the binary "InputTypes" value contains a 'vids' /
'WMV3' FOURCC, the [InputTypes] subkey contain the subkey
[73646976-0000-0010-8000-00AA00389B71\33564D57-0000-0010-8000-00AA00389B71]
(which means WMMEDIATYPE_Video\WMMEDIASUBTYPE_WMV3 - if you
look at the first DWORDs, they are FOURCCs that spell 'vids'
and 'WMV3').

So you can either look for the value or the subkey or both,
even if you should look for the value first, since from the
screenshot it seems you are looking at the wrong thing.

Looking at this registry key *is* bullet-proof: this is what
the system looks at to find the WMV9 decoder DMO.

Anyway, as Geoff suggested, the DMOEnum() just does the
above registry lookup for you, so you may want to use that
instead:

CLSID clsid; LPWSTR name;
IEnumDMO* pEnum;
DMO_PARTIAL_MEDIATYPE wmv3 = {
WMMEDIATYPE_Video,
WMMEDIASUBTYPE_WMV3 };
DMOEnum(
DMOCATEGORY_VIDEO_DECODER,
DMO_ENUMF_INCLUDE_KEYED,
1, &wmv3,
0, NULL,
&pEnum);
if(S_OK == pEnum->Next(1,&clsid,&name,NULL)) {
/// The WMV9 decoder is installed!
if(name != NULL) CoTaskMemFree(name);

Alessandro Angeli [MVP::DigitalMedia]

unread,
Dec 21, 2005, 8:25:25 AM12/21/05
to
Ariel wrote:

> Alessandro,
> I don't have a Win2000 computer available to me, but an
> associate does. He tested this and wrote to me:
> "On that Win2000 box I played a Windows Media 9 Video
> encoded file via the installed Windows Media Player 9 and
> is was fine. This would lead me to conclude that that
> key, at least on a Win2000 box isn't a bullet-proof way
> to determine whether the box has the codec or not. "
> He attached a gif image of the registry key. I'll email
> it to you.

Well, WMP v7+ is not a good test, since it handles WMV in a
special way.

Alessandro Angeli [MVP::DigitalMedia]

unread,
Dec 21, 2005, 1:18:26 PM12/21/05
to
The registry stores 2 types of objects, like a simple
filesystem: the "keys", which are the folder-like tree that
RegEdit displays on the left, and the "values", which are
the list of data that RegEdit displays on the right.

What the screenshots show is that you are looking at the
[InputTypes] *key* and its subkeys while I asked you to look
at the "InputTypes" *value*.

Navigate to [HKEY_CLASSES_ROOT\DirectShow\MediaObjects\
82d353df-90bd-4382-8bc2-3f6192b76e34] and look at the values
on the right, not the subkeys on the left.

So, does the Win2000 machine really not have the
"InputTypes" *value*?

If it really doesn't, maybe it's because it's running an
older version of DirectX which stores the input types as
subkeys instead of as a value (something that didn't occur
to me until now). On my Win2003SP1/DX9.0 I only have the
value, and you seem to confirm that on your WinME and WinXP
you have it too (but what version of DX is every machine
running?).

Changing WMP version has no effect on the DirectX and WMF
runtime versions (at most, they upgrade WMF but never
downgrade it), which is what counts here, nor does
installing the VCM wrapper for the WMV9 codec, since it
works with the VFW/WMM runtime and it is not a DMO.

Anyway, the screenshots also show that the subkeys have just
the same meaning as the value. Let me explain:

The "InputTypes" value is a REG_BINARY blob that lists the
media types supported by the DMO as an array of
DMO_PARTIAL_MEDIATYPE structures and each element is a
DMO_PARTIAL_MEDIATYPE structure, which is the same as saying
a pair of GUIDs (16 byte long integers) that specify the
majortype/subtype pair of the media type. So you need to
look if any of the elements of the DMO_PARTIAL_MEDIATYPE
array contains WMMEDIATYPE_Video/WMMEDIASUBTYPE_WMV3.

As a shortcut, I suggested to just look to the 'WMV3' FOURCC
in the binary blob, since those GUIDs all start with a
FOURCC as GUID::Data1 field and the rest is fixed (that is,
if you read the first 4 BYTEs of the GUID as a string, it
spells out a 4 chars word like 'vids' or 'WMV3').

So you should see (the binary value is printed in hex and @
is the default value of the key):

HKCR
\DirectShow
\MediaObjects
\82d353df-90bd-4382-8bc2-3f6192b76e34
@="WMVideo Decoder DMO"
"InputTypes"=
{
76696473 00001000 8000000AA 00389B71
574D6431 00001000 8000000AA 00389B71
76696473 00001000 8000000AA 00389B71
574D6432 00001000 8000000AA 00389B71
76696473 00001000 8000000AA 00389B71
574D6433 00001000 8000000AA 00389B71
76696473 00001000 8000000AA 00389B71
574D6450 00001000 8000000AA 00389B71
}
"OutputTypes"=...

Which has the meaning:

HKCR
\DirectShow
\MediaObjects
\<CLSID_CWMVDecMediaObject>
@="WMVideo Decoder DMO"
"InputTypes"=
{
{
<WMMEDIATYPE_Video>
<WMMEDIASUBTYPE_WMV1>
}
{
<WMMEDIATYPE_Video>
<WMMEDIASUBTYPE_WMV2>
}
{
<WMMEDIATYPE_Video>
<WMMEDIASUBTYPE_WMV3>
}
{
<WMMEDIATYPE_Video>
<WMMEDIASUBTYPE_WMVP>
}
}
"OutputTypes"=...

When a GUID is represented in a readable form, like in
registry key names, it is written as
82d353df-90bd-4382-8bc2-3f6192b76e34 (often, but not this
time, with curly braces:
{82d353df-90bd-4382-8bc2-3f6192b76e34}). So, for example
WMMEDIASUBTYPE_WMV3, which has the value (in hex) 574D6433
00001000 8000000AA 00389B71 is written has
{33564D57-0000-0010-8000-00AA00389B71} (notice that the
first 4 BYTEs, which spell 'WMV3', look reversed because
they are printed as a DWORD and the x86 CPUs are
little-endian).

You see the following key tree:

HKCR
\DirectShow
\MediaObjects
\82d353df-90bd-4382-8bc2-3f6192b76e34
\InputTypes
\73646976-0000-0010-8000-00AA00389B71
\31564D57-0000-0010-8000-00AA00389B71
\32564D57-0000-0010-8000-00AA00389B71
\33564D57-0000-0010-8000-00AA00389B71
\50564D57-0000-0010-8000-00AA00389B71

Which is just equivalent in meaning to what I told you to
expect in the "InputTypes" value, since those printed GUIDs
correspond to:

HKCR
\DirectShow
\MediaObjects
\<CLSID_CWMVDecMediaObject>
\InputTypes
\<WMMEDIATYPE_Video>
\<WMMEDIASUBTYPE_WMV1>
\<WMMEDIASUBTYPE_WMV2>
\<WMMEDIASUBTYPE_WMV3>
\<WMMEDIASUBTYPE_WMVP>

So you can make your routine smarter and, if it doesn't find
the 'WMV3' FOURCC in the "InputTypes" value, it can look for
the [HKEY_CLASSES_ROOT\DirectShow\MediaObjects\82d353df-90bd
-4382-8bc2-3f6192b76e34\InputTypes\33564D57-0000-0010-8000
-00AA00389B71].

Or do as Geoff suggested (and this proves he was absolutely
right) and use DMOEnum(), which just does the registry
lookup, but it will look correctly for the subkey or the
value as need by the running DirectX version:

CLSID clsid; LPWSTR name;
IEnumDMO* pEnum;
DMO_PARTIAL_MEDIATYPE wmv3 = {
WMMEDIATYPE_Video,
WMMEDIASUBTYPE_WMV3 };
DMOEnum(
DMOCATEGORY_VIDEO_DECODER,
DMO_ENUMF_INCLUDE_KEYED,
1, &wmv3,
0, NULL,
&pEnum);
if(S_OK == pEnum->Next(1,&clsid,&name,NULL)) {
/// The WMV9 decoder is installed!
if(name != NULL) CoTaskMemFree(name);
}

So, what does that specific call to DMOEnum() do? It starts
by listing all subkeys in
[HKEY_CLASSES_ROOT\DirectShow\MediaObjects\Categories\<DMOCATEGORY_VIDEO_DECODER>],
since each is the CLSID of a DMO registered in that
category. Then, for each of those DMO <clsid>s, it looks at
the input types of
[HKEY_CLASSES_ROOT\DirectShow\MediaObjects\<clsid>] to see
if any matches {WMMEDIATYPE_Video,WMMEDIASUBTYPE_WMV3}. If
it finds a match, it returns the <clsid> and also the <name>
(which is just the default value of
[HKEY_CLASSES_ROOT\DirectShow\MediaObjects\<clsid>]).

This call takes care of querying the "InputTypes" value or
the [InputTypes] subkey, since it meant to work for the
specific DirectX version it runs on. But is also somewhat
slower because it list several keys.

Your choice, at this point you know more than the
documentation about this issue :-)

--
Alessandro


Alessandro Angeli [MVP::DigitalMedia]

unread,
Dec 21, 2005, 1:27:45 PM12/21/05
to
Another way: create an instance of the WMV decoder and
configure its input type as WMV9. If it succedes, the WMV9
decoder is properly installed and working. This is even
better than looking for registry keys or system files,
because it tests not just whether the components are there
or are registered, but that they actually work.
0 new messages