Solved

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

Posted on 2006-06-12
8
1,077 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
ID: 16885785
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
ID: 16887430
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
ID: 16892103
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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 8

Accepted Solution

by:
mrblue earned 250 total points
ID: 16892419
"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
ID: 16892658
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
ID: 16892862
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

806 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