Experience of making a media player by QT5.4 with VLC API

Yesterday, I use qt to make a simple media player with VLC kit. As there are many tutorials online, so most steps are the same, such as how to add the .dlls, headers and libs. However, although with those guides, I still can not smoothly make it out. One reason is my not familiar with QT. So, I just tell some points about this experience.

1. setting of .pro:
This helps project knows the location of static libraries, headers of vlc kit. We should add INCLUDEPATH which contains the headers and LIBS, containing static libs.

 INCLUDEPATH += vlc
 LIBS += C:/Users/ChangeCheng/Desktop/VideoClient/VideoClient/libvlc.lib
 LIBS += C:/Users/ChangeCheng/Desktop/VideoClient/VideoClient/libvlccore.lib

vlc can be found in VLC media player installation path:sdk/include/vlc, it contains those headers.

libvlc.lib and libvlccore.lib can be found in sdk/lib.

2. add libvlc.dll and libvlccore.dll to destination directory where the target program exists.
At first, when I debug this program, it always crash and the error code is 0x135. It means the .exe can not find dynamic libs. But I really put the .dlls in my project directory!
The reason is that target program is in another directory, and this is quite silly.

As the pic shows, my target .exe is in a directory called build-VideoPlayer-Desktop_Qt_5_4_0_MinGW_32bit-Debug. Under this, there exists a directory called debug, and we should put libvlc.dll, libvlccore.dll and plugins in that debug. Plugins is under VLC media player installation directory.

changecheng 05 March 2015
blog comments powered by Disqus