Solved

How to Check DIVX MPEG-4 codec has installed on system or not?

Posted on 2006-06-12
8
1,074 Views
Last Modified: 2010-05-18
I have question, and hope you can help me.
That is, I write a program for install DIVX MPEG-4 codec for audio and video.
After running my program , i check the video(audio) codec by opening Device Manage and click right mouse in Video Codec and choose Property tab, then i see the line DIVX MPEG-4 video codec.

And now , i will run my program on another PC.
So , i want to my program can check this codec has existed on system or not?
If it has, i will not run Shellexecute and will run if it has not? Can you direct me how to check this codec ?

0
Comment
Question by:CongUan
  • 3
  • 2
8 Comments
 
LVL 86

Expert Comment

by:jkr
Comment Utility
Do you have the codec's GUID? If so, you can just check whether this entry is present in HKEY_CLASSES_ROOT\CLSID.
0
 
LVL 8

Expert Comment

by:mrblue
Comment Utility
You can use DirectShow to enumerate codecs.
Create System Device Enumerator and then class enumerator for appropriate class:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directshow/htm/usingthesystemdeviceenumerator.asp

for video codecs use:
CLSID_VideoCompressorCategory

for audio codecs use:
CLSID_AudioCompressorCategory
0
 

Author Comment

by:CongUan
Comment Utility
Thanks to mrblue.

And can you also help me for another asking??? I hope you can.

Now, my app can use DivX codec for encoding video.
But I also need to add some others codec for video : H.263 and MPEG4 and also AVI(uncompressed ???)
Can you help me how to get .ax or dll files for these adding codecs. And it will be good luck to me if you also show me  .inf file to install these adding codecs.  

 
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 8

Accepted Solution

by:
mrblue earned 250 total points
Comment Utility
"also AVI(uncompressed ???)"

AVI is not data format - it's a container format (another container format is OGG for example). "uncompressed" means that there isn't used any codec for it.

This is from MSDN:

"Codecs may be implemented in one of three different ways:

As a Video for Windows-type audio or video installable codec that is loaded by the Video Compression Manager (VCM) or Audio Compression Manager (ACM). In general, this technology is considered deprecated and its use is not recommended. Installable codecs participate in DirectShow filter graphs through the AVI Decompressor wrapper filter.

As a DirectShow filter. Many third party codecs are implemented as native DirectShow filters. One such filter is the Frauenhofer MP3 decompressor filter. In general, these filters may be added to the filter graph in the usual ways. One exception to this rule is that some Windows Media™ Audio or Windows Media Video codecs, and the Microsoft MPEG-4 codec, cannot be added to a filter graph manually. These filters can only be added by the ASF Reader and ASF Writer filters.

As DirectX Media Objects (DMOs). DMOs are the recommended way to implement codecs because they can be used either within a DirectShow filter graph using the DMO Wrapper filter, or else independently in any other non-DirectShow-based streaming application. Some Windows Media Audio and Windows Media Video codecs are implemented as DMOs. As with the Windows Media filters, these DMOs cannot be used outside the context of the Windows Media SDK. That means that in DirectShow, they can only be added to a graph through the ASF Reader or ASF Writer filters."

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directshow/htm/workingwithcodecs.asp

So installation will depend on type of codec. I guess it will be:

1. For VFW codec you will probabely need to add entry to the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\windows NT\CurrentVersion\Drivers32

and copy codec file to for example system32 directory

I hope this is all what's necessary.

2. For DirectShow user mode filter you will need to copy .ax file (COM .dll in fact) to system32 folder. You will also need to register it (usually installation program will do it if appropriate option is selected).

For kernel mode filter you will need .inf file with some registry entries however I hope this is not your case.

And this is more or less all what I know. Good luck.
0
 

Author Comment

by:CongUan
Comment Utility
Thanks mrblue very much.
i think i will do as 1.
But i donot know how to start to add entry to registry key by programmatically?
Can you help me this problem? Can you direct me a sample source code how to do this???
Hope you can reply soon.
Thank you again
0
 
LVL 8

Expert Comment

by:mrblue
Comment Utility
In API you could use RegOpenKey(), RegQueryValue(), RegSetValue(), RegCloseKey() but installator (like Visual Studio Installer) has its own, higher level mechanizm - for example section with registry keys to add, remove, modify (search you installator doc for "registry").
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now