PDA

View Full Version : Getting Phonon to work on Non-Development (Windows) Machines



Brit
11th January 2012, 19:29
I use Phonon in my QT application, and everything seems to work fine on my development machine. However, I can't seem to get Phonon to work on any non-development machines. (I'm using Windows, by the way.) If I attempt to play audio through phonon, nothing comes out of the speakers. If I attempt to play video, nothing appears. I've been checking all the DLLs and using dependency checker. I can't seem to find anything missing.

I'm using QT 4.7.1, Windows 7, Microsoft VisualStudio. The non-development machines I've tested range from Windows XP to Windows 7, but the main one I'm testing on is Windows 7.

I eventually copied the entire c:\Qt\4.7.1\bin directory to the non-development machine to see if I could get the Qt Phonon examples working there. (The "bin" directory contains lots of Qt and Phonon DLLs.) Then I copied C:\Qt\4.7.1\examples\phonon\capabilities\release\c apabilities.exe and C:\Qt\4.7.1\examples\phonon\qmusicplayer\release\q musicplayer into the bin directory. When I do this procedure on my development machine, the applications work fine.

On the non-development machine, when I attempt to run qmusicplayer.exe the application appears and then I try to play a .wav file, but nothing happens (doesn't appear in the audio list, doesn't play). When I run capabilities.exe, the application comes up blank (maybe that means that the backend capability isn't there). This non-development machine I'm using is Windows 7, so I don't know what would be missing. It contains DirectX 11. I downloaded and installed DirectX 9.0c. I think Windows 7 machines already contain DirectShow. I tried copying some extra DLLs into the bin directory - mscvm90.dll, msvcp90.dll, msvcr90.dll, phonon_ds94.dll. Still no luck.

Here's a screencap of what my non-development machine shows when I run capabilities.exe:
7252

Here's what it looks like when I run capabilities.exe on my development machine:
7253

Any idea what I might be missing on the non-development machines? Missing DLLs? Do I need to install something else on the non-development machines?

SIFE
11th January 2012, 22:37
Try to ship phonon4.dll with your application. There was also a thread (http://www.qtcentre.org/threads/29639-Running-a-Qt-application-with-Phonon-on-a-non-development-computer) like your issues.

Brit
11th January 2012, 23:51
Thanks. I had included phonon4.dll, but adding the plugin directories seems to have fixed some of the problems. I have audio working now, but not the video. I'll look into it some more to get that fixed, but this is a step in the right direction. Thanks, again.

SIFE
12th January 2012, 16:29
Thanks. I had included phonon4.dll, but adding the plugin directories seems to have fixed some of the problems. I have audio working now, but not the video. I'll look into it some more to get that fixed, but this is a step in the right direction. Thanks, again.
In order to make the video work, you should install vlc or gstream in the targeted machine.

Brit
12th January 2012, 18:44
In order to make the video work, you should install vlc or gstream in the targeted machine.

Will all of my users will need to install this? There isn't any way to simply add a dll to my install? I'm looking all over the place trying to figure out where to get the VLC installer. Is this it or is this something else? http://www.videolan.org/vlc/releases/1.1.4.html

I've looked through pages of google search results to try to get this working. I'm surprised Qt/phonon hasn't made this easier.

SIFE
17th January 2012, 16:58
I found the download link in this page:http://www.videolan.org/vlc/
http://sourceforge.net/projects/vlc/files/1.1.11/win32/vlc-1.1.11-win32.exe/download

Brit
18th January 2012, 21:57
After doing some more testing, I discovered that *.mpg files can be played on my Windows, non-development machine. Presumably the /codecs and /phonon_backend directories contain all the necessary dlls to make that happen.

I can't play *.mov files, and I tried installing the VLC Player, but it didn't fix anything. I don't know why my development machine can play the *.mov files - either the necessary dlls are inside the QT install or maybe some other video-player installed the appropriate codecs.

Brit
31st January 2012, 03:20
Well, as I mentioned in my last post, I was able to get the video to play on my non-development Windows 7 machine. It only works if I play *.mpg files and doesn't work if I try to play *.mov files. Now, I've run into another problem: if I attempt to play video on WindowsXP or WindowsVista machines it doesn't work (the video is black, but the audio plays). I'm seriously considering not using Phonon since it seems to be limited to Windows7 machines, documentation is scarce, and nobody seems to know how to fix this problem.

Tabs
11th April 2012, 08:19
Hello,

a late answer to this post but that might help others with the same troubles.

From what I understood Phonon relies on some backends to play multimedia content. When installed on windows (for instance with the Qt SDK) phonon uses the DirectShow backend. You can also compile Qt with a different backend such as VLC. This is the reason why you need to add the backend directory in the directory of the application. You can find it at this place:
%QTDIR%\plugins\phonon_backend
this directory will contain a dll (this is the important file) that has a different name depending on the backend you use (in my case phonon_ds94.dll, for Directshow backend, it would be something like phonon_vlc.dll for the VLC backend I guess).

Some say you also need the directory:
%QTDIR%\plugins\codecs
but I am not sure about that last one.

Finally, and I think this is your problem here. If you are using the Directshow backend you will be able to only play videos from which you have a the adequate pluggin installed. Basically just try to open the video with the windows media player. If it works than you should be able to play the video with phonon. If it does not then you should install the pluggin necessary for directshow (DivX, Xvid, etc...). SO I am nearly sure that the problem does not come from phonon but rather from these %&ç%& pluggin that you always need to install. This is the reason why some prefer to use VLC that is able to read (almost?) any media file easily.

I hope this will help someone !