this post is going to be a long one, so I make it short first: is there a way to play a video file on windows, oF 0.9.3, visual studio 2015? Details follow.
After trying for almost the whole day to play a video file I’m giving up and asking for help. It should be simple (on OSX I could do it very easily) but for some reason I really can’t get it to work on windows.
There is no need to supply a code sample because the standard videoPlayerExample is enough to reproduce the problem. With different video formats the player does not display anything at all, or only shows the first frame then it freezes.
The forum already gave hints about the origin of the problem (basically the new directShow based player that comes with oF 0.9.0) and possible solutions. I tried, following what is reported here and in this thread, to install the k-lite codecs but they did not work. They have a huge list of options, so huge that hoping to find the right combination (if any) is worse than finding a needle in a haystack.
Besides, having users to install a codecs pack to run my application does not look like a good idea. It would be good enough to find a video format that renders well with the standard player, but none of the many I tried seemed to work.Even wmv files (that should be at home with directshow) refuse to play. And, last, the ofxWMFVideoplayer addon did not work too, complaining that my video card does not support WGL_NV_DX_interop.
Of course being able to play almost everything out of the box (like the Mac version) would be the best option, but even finding a video format that works would be fine. The video will be the background of the app, with things being drawn over it.
Any help will be greatly appreciated, thank you
It could be that as the Nlite link downloads the latest klite, sometimes the version its grabbing breaks the support ( if thats the case, we could find a way to host a good versions of the codec pack )
We’re hoping to switch over to a WMF approach, but as you have noticed it doesn’t work on all hardware.
Someone also mentioned tweaking the infinite settings this way:
We’ve noticed a fairly wide range of issues in OF can be attributed to not having the Intel GPU driver install, it could affect video playback if the codec is trying to use hardware decoding.
ps: I just tried a clean install on my Windows 10 machine with the N-LITE link and the video player example worked well with the N-Lite install process. ( this is what made me think it could be driver related )
Sorry today I won’t be able to investigate the item further, but from a quick try it seems that enabling hardware acceleration in k-lite drivers does the trick (at least for .mp4 file, with a .mov a larger video is still very slow, like 2 fps).
The WMF decoder should work on my hardware too, (the GPU is an AMD Radeon HD 6970M) since windows plays everything out of the box.
The best option (for my application) would still be to find a video format that the player can manage without additional codecs/drivers, that would make the install experience for the final app user much easier.
Tomorrow I’ll have more time and will try more options and combinations, and I will report here the results.
another possibility if you can’t get directshow to work is ofxGStreamer. it depends on gstreamer which contains a lot of libraries and has to be installed in the system, also it’ll only work in visual studio in windows but is more tested than the direct show player: https://github.com/arturoc/ofxGStreamer
Directshow is dated and Windows now uses primarily windows media foundation. If you can play a video on your computer out of the box its probably using the newer video foundation which you can use this addon to help with. https://github.com/DomAmato/ofxWMFVideoPlayer
You shouldnt have to install any drivers to get it to work with that addon and it works very similarly to the directshow player thats part of the OF core
I agree that ofxWMFVideoPlayer is the way to go, I tried it and it is better both performance wise and because it does not need any external codec. The only drawback (for me) is that it does not work in my virtual machine (Win7 on OSX el capitan). If I boot the same OS (not another windows 7 but the same installation) with bootcamp then everything works like charm.
It is almost certain that the problem is driver related, since it work with the same hardware. The VM installs a driver of its own for the video card, but until now everything has worked fine. This is the first time I find some application that requires me to use bootcamp.
Anyway ofxWMFVideoPlayer is so much better that if I won’t have any other option I’ll buy a PC to develop the windows version of my software. Of course a workaround would be super useful