Vector of ofVideoPlayer* - segmentation fault


Hi all,

I have a around 2 hours of HD video material (each clip about a minute long), that i put into a vector of pointers to ofVideoPlayers. Loading and playing them is no problem. But as soon as i use loadAsync the program crashes with a segfault. I can however change the speed…

The machine I am using is a Nvidia Jetson Nano - which uses the ARM7 nightly build of openframeworks with Platform aarch64. As explained here: Setup Nvidia Jetson Nano for openFrameworks


vector<ofVideoPlayer*> videos;

in setup():

if (nFiles) {
	for (diaNum = 0; diaNum < vecSize; diaNum++) {
        	// first 3 videos added to the vector
	       filePath = dir.getPath(diaNum);
	       ofVideoPlayer *vid;

	       vid = new ofVideoPlayer();


	       cout << "FilePATH: " << dir.getPath(diaNum) << endl;
else ofLog(OF_LOG_WARNING) << "Could not find folder";


in update():

//update timers
bool changeFrame = timer.gotEndOfCycle();
alpha = timer.getOpacity() / 255.;
if (changeFrame) {		

	if (diaNum == nFiles) {
		diaNum = 0;
	if (frameIndex > maxIndex) {
		frameIndex = 0;

	filePath = dir.getPath(diaNum);
    videos[getFrameIndex(frameIndex - 1, maxIndex)]->stop(); //stuck for ~5 seconds or crashes
	videos[getFrameIndex(frameIndex - 1, maxIndex)]->close(); //crashes
	videos[getFrameIndex(frameIndex - 1, maxIndex)]->loadAsync(filePath); //crashes
	videos[getFrameIndex(frameIndex - 1, maxIndex)]->setSpeed(1.5); // does NOT crash

	triggerPause = true;

videos[getFrameIndex(frameIndex + 1, maxIndex)]->update();

I checked all the forum posts and I cant see what s wrong with the code, the adresses the pointers are pointing to, are the same as in setup … and as changing speed does work, it seems to me that the problem lies in the ofGstVideoPlayer ?

Thanks in advance,

1 Like