ofxFreeFrame - FFGL for OF!

Hey all,

eloi, smallfly, and myself have been working on this FreeFrame addon for openFrameworks for the past few months and it’s finally stable enough for release so here it is!

Download-ofxFreeFrame-0015.zip

A few notes:

  • The download folder mimicks your openFrameworks folder, so just copy the right files in the right place! (addons goes in addons, apps goes in apps, get it?).
  • You’ll notice that there is an updated version of GLee.h in there. That was necessary because FFGL and GLee both define GL handles and it was giving me trouble. Updating GLee should not affect your other projects in theory, but you should still keep a backup of the old one in case it screws something up.
  • There’s an example project for Xcode under addonsExamples. You should be able to use the source files as-is for Windows.
  • The FFGL host extends ofTexture so you can use it anywhere you would use an ofTexture.
  • ofxFreeFrame should work with any FFGL 1.5 plugin you can get your hands on, for both OS X and Windows. It can only handle a single input texture for now, but multi-texture is in the works.

If you’re interested in helping out, we’re going to set up a repository somewhere soon. We need a Linux-head to port it to Linux and maybe someone familiar with FreeFrame to help with the multi-texturing stuff.

So, try it out and let us know what you think!

Hi

I was looking how to do some effects with video in OF so this is perfect, I’ve compiled everything for linux, without too much problem, but when I try to load the plugins it returns an error.

I’m compiling the plugins as shared libraries, is there anything special you need to do to compile them, I’m looking the web page, but I cannot find anything related to how to compile plugins…

Maybe you should try with the pre-compiled plugins that come in the “official” download first and see how it goes with those: http://sourceforge.net/projects/freeframe/

Also, if you look at the load(…) function in ofxFFGLPlugin.cpp, you’ll notice we don’t have any Linux specific plugin-loading code yet, so that should be added as well.

  
  
#ifdef TARGET_WIN32  
    string path = ofToDataPath(filename);  
    printf("ofxFFGLplugin Win32 : Loading ... %s\n",path.c_str());  
#endif  
  
#ifdef TARGET_OSX  
    string path = ofToDataPath(filename)+".bundle/Contents/MacOS/"+filename;  
    printf("ofxFFGLplugin OSX : Loading ... %s\n",path.c_str());  
#endif  
  

Let us know how it works out!

awesome! looking forward to trying it out…

mmmh no luck!

I’d already noticed about the load function, I’ve copied the windows one and compiled the plugins as shared libraries, but there’s seem to be an error in the loading.

Also there’s no plugins already compiled for linux, not in the distrubution, nor in the whole FreeFrame site… :frowning:

I’ll post if I manage to do something, it will be useful to know how do you compile them for mac, as it should be more or less the same in linux.

For Mac I just used the Xcode project that comes with the FFGLSDK_1_5 download off of SourceForge.
I just checked under FFGLSDK_1_5/Projects/FFGLPlugins/Linux and there seems to be a makefile for compiling the plugins for Linux. Is that what you used to compile your plugins?

If anyone’s curious, I just posted a video made with ofxFreeFrame: http://vimeo.com/1776203

Hello!

I’ve got one question regarding the plugins:
How to get more?
When looking in the source of FreeFrame I only find Brightness, Heat, Mirror, Tile and Time as .bundle, but in the Video you also use

a film strip, a pixelator, and a background substractor.

When browsing links of the FreeFrame download site, i only find binary windows dll versions… so how to get/compile more for os x?

Ah, by the way: Thanks for this great addon!!!

Thanks,
Gestalt

did you look at http://www.petewarden.com/ ?

also some more here http://freeframe.sourceforge.net/downloads.html
and

http://community.freeframe.org/plugindatabase

enjoy! :stuck_out_tongue:

ok, didn’t notice the projects folder, so I was compiling manually and adding more files than actually necesary, now its working.

Under codeblocks, I couldn’t manage to make it work with your lib/common folder structure so I’ve used the original one with the common files in lib and …/xxx.h in the includes of freeframe.

Also in your install.xml there was an error as it should be

<folder…>
<file…

and you had:

<folder…>
<src…

Appart from that and adding some code to load the plugins under linux, everything else worked without problem.

The folder structure is the same as in the original file and there’s a codeblocks project instead of the xcode one:

http://65.111.166.199/openframeworks/ofxfreeframe.tar.gz

About the other plugins:
Those are plugins that smallfly and I wrote for a specific application. They’re basically GLSL shaders or OpenGL calls that were transformed into FFGL plugins. The plan is to make some of these available once we get a repository going.

About the links memo sent:
Make sure you use FFGL 1.5 plugins and not FF 1.0 plugins. There were lots of changes for v1.5 so it is not backwards compatible!

And finally, about arturo’s Linux port:

  • Great, I’m happy to hear it’s running!
  • Neither of us use the install.xml file so we weren’t too sure what to do with it. Thanks for fixing it :slight_smile:
  • How come you couldn’t get it to work with the “lib/common” structure? I think it would be good to keep it that way if possible just to keep everything tidy.
  • We don’t need the lib/Linux/LinuxMain.cpp file, right?

Cheers

How come you couldn’t get it to work with the “lib/common” structure? I think it would be good to keep it that way if possible just to keep everything tidy.

Not very sure, under eclipse it worked just by modifying the headers of the librery to change the includes, but in codeblocks it complained about not being able of finding some types, I didn’g tried very hard :slight_smile: as the original distribution was like that with the common files in the root folder, but I’ll give it a try…

We don’t need the lib/Linux/LinuxMain.cpp file, right?
no, I suppose I forgot it there.

hi all …

well related to FFGL addon we just made, next step would be to be able to create FFGL plugins within the usual compilers that OF users use.

i’ve been trying to compile the plugins based on the FFGL_SDK (http://freeframe.sourceforge.net/) in CodeBlocks under Windows XP.

i do compile the libraries and the DLLs are generated correctly, but they don’t load in any of the host’s i’ve tried . Seems like the DLL has some configuration settings under CodeBlocks which makes that is not “understandable” or “loadable” by the FFGL hosts …

anyone has experience on generating DLL’s under mingw in XP or Linux ?
any ideas if there’s any setting which should be twicked from a standard DLL CodeBlocks project ?

any info is wellcome as i’m a newbie on generating DLL’s an so …

salut

e*

PD : i’ll post the project code tonight in case anyone could take a look at it …

eloi, I was working around this problem without success. I downloaded the “Visual C++ Express Edition” and compiled the MSVC examples and it worked. It was just as it. I’d rather use the code::blocks but it was incredible easy with the MSVC.

If somebody find a way to compile the examples on Code::Blocks it will be great, in the meantime… micro$oft… :frowning:

F.

Yes, it would be awesome to create FFGL patches inside of and to compile them from there!

did someone knows how freeframe plugin are dealing with openGL blending ?

I work on some code using it and when plugin are activate, it disables all instance using openGL blending (ofRect(); all ofXGUI ) on the screen…Strange.

Thanks

First of all thanks, it’s wicked to be able to use FreeFrame in openFrameworks.

Have there been any developments regarding this addon? I’m trying to use it beyond a simple example but I’m not getting where I want to go, I think due to the commented out destructor in ofxFFGLPlugin.

I’m trying to cycle through all plugins in a visual layer … and it seems the only way that’s possible is loading every single freeframe in advance and only enabling the one you need to use… this is fine for a simple example but what if I want to add the same plug twice to a layer ? Also for every layer I add I must load all plugins again? (takes 20 seconds here if I add a layer) …

I spent a couple of days tearing my hair out trying to change the addon to allow each ofxFFGLHost to start with an empty ‘plugins’ vector and just loading/unloading plugins to/from it, spent days looking thru my code to see what is going wrong, it looks like what I’m trying to do is not possible, at least without a functional destructor in ofxFFGLPlugin.

here is the code I tried to implement an unloadPlugin with:

  
void ofxFFGLHost::unloadPlugin(int idx)   
{  
	cout << "attempting to unload plugin " << idx << "\n";  
	if (idx<plugins.size()) {  
		plugins.erase(plugins.begin() + idx);  
		cout << "plugins.size: " << plugins.size() << "\n";  
	}  
	else   
	{  
		cout << "idx > count \n";  
	}  
}  

if I call it and load a new plugin instance, I’m getting all kinds of “EXC_BAD_ACCESS” probs, am I right in suspecting that the lack of a proper destructor in ofxFFGLPlugin could be the cause? Any help/pointers would be much appreciated.

I’m doing a VJing app on Mac OS X 10.5 and i’ve got a simple 2 layer mixing working. I’m using ofxFBTextures and would like to apply FreeFrame filters before drawing to screen. How can I use a texture as an input to the ofxFFHost? I’ve tried to to assign the texture reference to the FreeFrame Host but it didn’t work.

PS: sorry for a confusing post but I don’t have the source with me right now and I can’t give much details

Grabbed this addon from the git repository, but I’m having some problems compiling.

Same error as in prisonerjohns post from a few years ago.

error: conflicting declaration ‘typedef unsigned int GLhandleARB’

Tried copying the glee library found in the repository, but no luck.

Anyone got this working on a mac with snow leopard and 0.61?

If this is still unanswered:

There seems to be a conflict between the GLHandles in the addons/ofxFreeFrame/src/GLHandles.h and the GLHandles.h found in your libs/glee/inlcude directory.

just make sure they match (so make 'm both unsigned int works for me)