While investigating alternatives to Quicktime for video playback in Cinder, we over here at Stimulant created a port of Second Story's ofxWMFVideoPlayer addon. This addon allows you to do video/audio playback through WMF by using NVidia WGL_NV_DX_interop extension to carry DirectX textures over to OpenGL. Even though the WGL_NV_DX_interop extension was originally created by NVidia this techniques should work with most AMD cards as well. All credit goes to Second Story for figuring out all the heavy lifting of getting this to work. I just ported it over to using GLee instead of GLew and interfacing with Cinder instead of oF.
It is setup as a Cinder block such that you should be able to create new projects that use it through Tinderbox. There is also a sample that demonstrates very simple video playback. I probably can't help much with hardware specific questions but feel free to hit me up with any questions.
We've only played around a bit with it but we did create a branch of one of our projects to test it out. So far performance is good though we honestly never had too much issue with Quicktime's performance. We would like to move away from Quicktime so that we can run 64bit builds though and we have seen a lot of stability issues with Quicktime. We'll be evaluating this block further for future projects as an alternative.
Good catch. Not sure why that line builds fine on my machine but I'll comment it out if it is unneeded.
I made a fork here https://github.com/brucelane/Cinder-WMFVideo , fixing some paths for the sample project and I commented out wglDXUnregisterObjectNV(gl_handleD3D,gl_handle); (line 134 of PresentEngine.cpp) because if gave me a run-time error on app close.
I'm using it to playback a 4k wmv video - it works pretty well
except even though i did setLoop(true) it stops after a while - mostly
stops after 1 round. I'm wondering if anyone else is experiencing the
also I didn't find a method adjusting the playback speed, is it
hard to implement? If anyone could point me somewhere to start that
will be much appreciated.
Hey guys i've been testing out this block, and for the most part its
a huge improvement. Unfortunately, I hit a problem with getting blank
textures if I draw anything before drawing the video object.
I can replicate this in the sample application with the following:
clear out the window with black
Color( 0, 0, 0 ) );
0, 50, 50));
0, 0 );
This will render a white square, however if I draw the square after
drawing the video it renders as expected. While just drawing the
videos first might work for a simple app, I don't think that would
be a solution in a larger project.
If anyone has suggestions of things to try, that would be fantastic.
If anyone's interested, i took a quick stab at getting this running
under glNext for an upcoming project. Little issue right now, the video
draws upside down by default, guessing something is getting lost in
translation between dx and ogl uv spaces. Probably a minor ish, I'm
just brand new to the whole WGL_NV_DX madness.
I'm running into an issue where I'm unable to get DX to
open the same adapter as my GL context. DX always uses my integrated
HD 4500 while GL uses my GTX 980M. Data can't be shared across
adapters for obvious reasons. I've tried using the Cinder
App's window HWND earlier in the process, but get either nothing
or a crash.
I can enumerate my adapters in DX, so it's seeing them.
However, just setting the adapter to 1 (the one I need) also either
crashes or does nothing. Any clue on how to get these to play nice
with each other?