ofxGStreamer on Windows


#1

Hi,

i finally got GStreamer working under Windows but i still have one problem.

When doing:
player.setPlayer(ofPtr(new ofGstVideoPlayer));
player.load(“video.mp4”);
player.play();

Video renders fine, i only have around 50 fps though.

If i add player.setPixelFormat(OF_PIXELS_NATIVE); i get a lot more FPS but the video is black & white.

Any suggestions?


#2

What resolution are you playing back? it’s weird that only one video would slow down so much in a desktop computer. In any case, using opengl 3+, will allow you to use native pixels format and see it in color.

in main:

int main(){
	  ofGLWindowSettings settings;
	  settings.setGLVersion(3,3);
	  ofCreateWindow(settings);
	  ofRunApp(new ofApp);
}

#3

Thanks! When settings opengl to 3.3, it works fine.
Just out of curiousity, why doesnt it work with opengl 4?


#4

it should work with opengl 4 just fine. OF defaults to opengl 2.1, if that’s what you mean we use shaders to do the color converstion from native format, usually some form of yuv, to rgb, so the cpu is freed of that work but the shaders only work when using opengl 3 or newer


#5

I see, thanks. I was under the impression oF defaults to opengl 4, but i guess i was wrong.
Anyway, everythings working fine, thanks for your help!

On another note: Im not sure if youre aware, but the the oF 0.10.1 project generator doesnt correctly include all the files from the addon_config.mk from ofxGStreamer in the vs project - this has to be done manually.


#6

no, dind’t knew, can you open an issue in the project generator gihub? https://github.com/openframeworks/prokectGenerator


#7

sorry, nevermind, it works correctly.
All i had to do was in ofxGstreamer/scripts/ci/vs/install.bat to replace

set GSTREAMER_1_0_ROOT_X86_64=C:\gstreamer\1.0\x86_64
dir %GSTREAMER_1_0_ROOT_X86_64%

with

setx GSTREAMER_1_0_ROOT_X86_64 C:\gstreamer\1.0\x86_64
dir %GSTREAMER_1_0_ROOT_X86_64%

set didnt do anything and vs included the wrong directories. with setx, it seems to work