Managing the codec system in Windows
64bit systems require twice the work
Traditionally Windows was a 32bit operating system. However, since Vista many computers have been supplied with a 64bit edition of Windows. When operating on a 64bit system, 64bit codecs are required. However, this is not the end of the story. 64bit Windows still includes full support for 32bit via emulation, and many parts of Windows are still 32bit. In Windows 7 for example, Windows Media Center is 64bit (and uses the Media Player 64bit engine behind the scenes). If you load Windows Media Player itself however, it operates as 32bit. This frequently causes confusion as something that works in Media Player may not work in Media Center or vice versa. On 64bit systems it is strongly recommended to install and configure both 64bit and 32bit codecs where possible. On 64bit systems, 64bit applications install to the Program Files
folder, and 32bit applications install to the Program Files (x86)
Folder. Some codecs also install application extensions into the Windows system folders. 64bit ones will be found in the system32
folder, and 32bit ones will be found in the SysWOW64
folder. In addition to file locations there are also extra sections of the registry. Entries related to 64bit software will be found in the normal locations (e.g. [HKEY_CURRENT_USER\Software]
, [HKEY_LOCAL_MACHINE\Software]
and [HKEY_CLASSES_ROOT])
. Their 32bit equivalents will be found in [HKEY_CURRENT_USER\Software\Wow6432Node]
, [HKEY_LOCAL_MACHINE\Software\Wow6432Node]
and [HKEY_CLASSES_ROOT\Wow6432Node]
.
Associating files and streams with codecs
Windows uses a GUID to identify filters, rather than their names or filenames. Each filter has its own GUID and these are stored in the registry. Streams are also identified by GUIDs (but file extensions are not!) Various registry settings can (and usually do) specify which splitter to use for each file extension, and in some cases (but not commonly) which filter to use for each type of stream. When installed, each filter provides a list of the GUIDs of stream types it can decode. A filter is selected from the available (and compatible) ones available. This selection is carried out based on the filter’s “merit” (a value they are given by Windows). These “merit” values can be changed to make Windows pick the filters you want. Similarly, the association between file extension and splitter can be changed to make Windows pick the splitter you want to use for each file extension. Finally, the merits of “renderers” can also be changed, to ensure Windows uses the renderer you want. This merit system applies to DirectShow codecs. If there are compatible Media Foundation codecs available Windows will always prefer them. If this is the case you may need to disable some or all of the Media Foundation codecs.
Changing Merits
The merits of codecs can be changed, either via the registry (which is unnecessarily difficult) or with various free utilities. A company called monogram have helpfully produced an improved version of a Microsoft utility called graphedit. Monogram GraphStudio is available as both 32bit and 64bit. When run as administrator, these utilities can be used to change the merits of codecs as shown below. However, some Microsoft codecs cannot, by default, have their merit changed, as the administrator user does not have permissions to the appropriate values in the registry. This can be overcome by changing the permissions to these registry paths. If you run into problems changing the merits of any codecs, refer to the section below on taking ownership and changing permissions.
Over-riding merits for specific stream types
The merit system can be bypassed with specific associations between stream types and decoders. If for example you want the ffdshow codec to decode most streams, and so set it with the highest merit, but want to use the mpc-hc mpeg2 decoder, you can specify in the registry an association between the GUID for mpeg2 video streams and the GUID for the mpc-hc decoder. This is done by creating a String (REG_SZ) in [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectShow\Preferred]
(for 32bit codecs on 64bit Windows the registry path is [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\DirectShow\Preferred]
). The name of each string should be the GUID of the stream type you want to specify a codec for. The value of the string should be the GUID of the codec you wish to use. Make sure you include curly brackets { } at the start and end of each GUID.
Splitter preferences
Splitter preferences are best edited in the registry. This is a fairly simple operation to complete. Each file extension has a key under [HKEY_CLASSES_ROOT\Media Type\Extensions]
(32bit splitters on 64bit systems will be under [HKEY_CLASSES_ROOT\Wow6432Node\Media Type\Extensions]
). In each key there should be a String Value (REG_SZ) called Source Filter
. This will be set to the GUID of the relevant filter. You can change the GUID values to change the splitters. You can also add new keys for other file types. The GUID values for splitters can be found in GraphStudio. The GUIDs for the most common splitters are located in the table at the bottom of this article.
Media Center preferred decoders & Live TV
There is another registry setting that tweakers must be aware of. Windows Media Center has 2 keys which apply only to it, which over-ride merits and all other preferences. These keys are found in [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center\Decoder]
. In my experience if these are set to any other codecs, Media Center cannot decode live TV. If they are left as they are, Media Center will use these codecs to decode a lot of video files that you may not want to decode with these filters. To bypass this problem, the 2 keys should be removed and the merits of Microsoft DTV-DVD Video Decoder and Microsoft DTV-DVD Audio Decoder should be raised to at least 00800000 (by default they are set too low for Windows to ever use them). If you want to use a different codec for mpeg2, simply set its merit higher than 00800000 and Windows will use your preferred codec, except for live TV, where it will recognise that your chosen codec is incompatible and will instead use the DTV-DVD decoders that work with liveTV. Before the merits for the DTV-DVD decoders can be changed the permissions of the registry path that stores their settings must be changed. The paths in question are [HKEY_CLASSES_ROOT\CLSID\{083863F1-70DE-11D0-BD40-00A0C911CE86}\Instance\{212690FB-83E5-4526-8FD7-74478B7939CD}]
and [HKEY_CLASSES_ROOT\CLSID\{083863F1-70DE-11D0-BD40-00A0C911CE86}\Instance\{E1F1A0B8-BEEE-490D-BA7C-066C40B5E2B9}]
. To change the permissions of these paths see the section below on taking ownership and changing permissions.
Taking ownership & changing permissions
To complete some changes it is necessary to change the permissions of some files and some registry entries. Before changing permissions it is often also necessary to “take ownership”. To take ownership of files right click on a file and select properties. Select the security tab and click on advanced. Next, click on the owner tab and click on edit. Select administrators in the list which appears and click ok. Click ok twice to close the file properties. Then right click and re-select properties. And click on the security tab again. Click the edit button and select Administrators and tick full-control. Click ok and ok again.
The procedure for changing permissions in the registry is similar. Open regedit and browse to the key you wish to change. Right click and select permissions and then click on Advanced. Select the owner tab, and click on Administrators to highlight it. If it is present, tick the box which says “Replace owner on subcontainers and objects” and click ok. In the security window that you have been returned to, highlight administrators, and tick “Allow” to full control, and finally click ok.
Disabling Media Foundation partially or fully
To use DirectShow codecs to decode formats supported by Media Foundation it is necessary to disable part or all of Media Foundation. The easiest way to do this is to use the Win7DSFilterTweaker utility. You can also disable Media Foundation manually – to do this requires several Windows files to be renamed or moved. Before they can be renamed or removed you will have to take ownership and change their permissions. These files are found in the System32
folder (32bit files on 64bit systems are found in the SysWOW64
folder). To disable Media Foundation generally rename or move the file mfds.dll. It is also possible to disable specific Media Foundation codecs. mp3dmod.dll is the Media Foundation MP3 decoder, mp4sdecd.dll and mp43decd.dll are Microsoft Mpeg4 decoders, msmpeg2adec.dll is the DTV-DVD Audio Decoder and msmpeg2vdec.dll is the DTV-DVD Video Decoder. Do not disable these last 2 if you wish to view Live TV in Media Center.
“Hi James I realise it has been a long while, but I just checked this on windows 11 (build 23H2)…”