ofGstVideoPlayer gmem allocation error when playing loads of videos

Hi there!

I’m getting a windows error window when trying to play videos one after the other using ofGstVideoPlayer on windows after a while.

Windows Error msg :

It looks like some memory leak to me, this could well be with the way i’m loading and playing the videos (see below test case code)

When runnig the test case i do first get this error output for every player.loadMovie(path):

I assumed it was link to this known “issue” : ofVideoPlayer > GStreamer-CRITICAL **: gst_mini_object_unref: assertion So maybe nothing to do with the more problematic crashing behaviour.

aim: playing a lot of videos that seamlessly link to eachother for a long time.

After around 100 occurrences of video playing I do get a new error message when loading the video :

After 1769 loadMovie occurences try i do get again the above gmem.c Windows Error message.

It does look like i’m not clearing up / stopping the video pipeline correctly i’d thought that

or

would do, but no luck.

Any idea where my code fails ? Or any pointer on how to hunt such issue would be welcome.

Thank you.

This is the test case i’m using :




#include "ofApp.h"
#include "ofGstVideoPlayer.h"

ofVideoPlayer * vidPlayer;
string path;
int nTests;


//--------------------------------------------------------------
void ofApp::setup(){

	
	ofSetLogLevel( OF_LOG_VERBOSE );
	
	// player
	vidPlayer = new ofVideoPlayer();
	vidPlayer->setPlayer(ofPtr<ofGstVideoPlayer>(new ofGstVideoPlayer())); 
	
	// path
	path = "movie.mp4";
	nTests = 0;
	
	// go
	playNext();

}


void ofApp::update(){
	
	if(vidPlayer->isLoaded())
		vidPlayer->update();
	
	if( vidPlayer->getIsMovieDone() == true ){
		// play next vid when previous one is done
		vidPlayer->close();
		playNext();
	}

};


void ofApp::playNext(){

	nTests ++;

	vidPlayer->close();

	if(!vidPlayer->isPlaying()){
		vidPlayer->loadMovie(path);
		vidPlayer->update();
	}
	 
	vidPlayer->play();
};


void ofApp::draw(){

	vidPlayer->draw(ofPoint(0,0));

	// display number of video test 
	ofSetColor(255,255,255);
	ofDrawBitmapString("nTest:" + ofToString(nTests) , 20,20 ,0);
};



void ofApp::keyPressed(int key){

	switch(key){
		case (OF_KEY_RIGHT ):
			playNext();
		break;
	}
};

this sounds like a bug in OF, i’ll take a look

Thank you Arturo!

which version of OF are you using? i’m trying on 0.8.3 and although there’s a small memory leak i cannot get it to fail after 400 playbacks

I’ve tried with v0.8.2 will test with 0.8.3 and see how it goes. Its quite edge case, it took me 1769 playback to get the error message. Could it be that small memory leak causing it?

Thanks for your help.

it might be, i’m doing lots of checks but cannot find out what is leakiing. btw, how are you using gstreamer through ofxGStreamer?

I’m using ofVideoPlayer to use ofGstVideoPlayer

declared as such :

vidPlayer = new ofVideoPlayer();
vidPlayer->setPlayer(ofPtr<ofGstVideoPlayer>(new ofGstVideoPlayer()));

Testing on 0.8.3 at the moment with the above test code.

did you manually included the ofGst files in the project? also which version of gstreamer are you using?

the code for 0.10 might be a little outdated, if you are using that i would also consider installing 1.0 instead, you can find instructions in the readme for ofxGStreamer

Oh… maybe i’m not using the lib correctly!

i’ve only included “ofGstVideoPlayer.h”
and added this to my project :
ofGstUtils.cpp
ofGstUtils.h
ofGstVideoPlayer.cpp
ofGstVideoPlayer.h

btw, tested with of v0.8.3 vs release yesterday and got the same issue after 2864 playback.

I’ve tried with gstreamer 1.2.2 and 1.2.4

I will try through the ofxGStreamer addon way and test again, will let you know if it fixes it.

mhh… Still no luck.

Only thing i didn’t have previously was ofxGStreamer added to the addon.make i think.

this is what i tried :

OF v0.8.3 vs release.
visual studio express 2012
gstreamer 1.2.2

Grabbed the git version of ofxGStreamer https://github.com/arturoc/ofxGStreamer
Started a clean project and added ofxGStreamer addon via projectGenerator
pasted the initial test code.

Tested. And failed again after around 2820 something playback.

I don’t think its hardware related as i’ve managed to replicate the bug with two computers one with Nvidia and the other Ati video card.

Could it “simply” be a gstreamer bug?