How to enumerate installed Windows Media Codecs in Qt

To get a list of all available Windows Media Codecs in Qt you have no other choice but to use C++ interfaces from Windows Media Format SDK. In this post I am sharing an example source code which allows you to do that in Qt. If you are developing using Qt and MSVC compilers for Windows then  you can definitely download this source code, build and run it for yourself.

You will probably notice this for yourself after downloading the source code but to be sure I am going to mention it anyway.



You need to add the following to your qmake .PRO file file if you are going to use parts of this code in your program.

LIBS += -lWmvcore

You must have the following includes added you your header files.

#include "Windows.h"
#include "Wmsdk.h"

One last thing to note is that this is also a very useful example on how to use Windows interfaces in Qt. There are numerous situations where you need to mix Qt C++ code with Windows SDK specific codes and this can be used as a guideline.

Here is an screenshot of this example program.

codecs


If you have any questions, put a comment below.

You can download source code from here.

Download



Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.