Giter VIP home page Giter VIP logo

ofxsyphon's Introduction

Syphon for Open Frameworks

About

Syphon is a system for sending video between applications. You can use it to send high resolution and high frame rate video, 3D textures and synthesized content between your openFrameworks application other applications and environments.

Syphon for openFrameworks includes one add-on with three new objects, ofxSyphonClient, ofxSyphonServer and ofxSyphonServerDirectory:

  • ofxSyphonClient: brings frames from other applications into openFrameworks wrapped in an ofTexture, which can be bound and drawn like any ofTexture.
  • ofxSyphonServer: allows ofTextures and the whole GLUT scene to be named and published to the system, so that other applications which support Syphon can use them.
  • ofxSyphonDirectory: lets users browse the shared Syphon directory of all available servers

Licensing

Syphon for Open Frameworks is published under a Simplified BSD license. See the included License.txt file.

Requirements

Mac OS X 10.6.4 or greater Open Frameworks 008 or better

Installation

Clone ofxSyphon to the addons folder of your openFrameworks installation. Examples projects called example-Basic and example-ServerDirectory are included.

The repository has branches for major OpenFrameworks versions. The master branch corresponds to the latest official OpenFrameworks release. An of_head branch roughly follows current OpenFrameworks development. Use the branch which corresponds to the version of OpenFrameworks you are using.

Instructions

Use the OpenFrameworks Project Generator to add ofxSyphon to your project.

The two example projects demonstrate usage.

Use any Syphon-enabled application to send or receive frames. You can use the Syphon Demo Apps to test functionality.

Credits

Syphon for Open Frameworks - Tom Butterworth (bangnoise) and Anton Marini (vade) and Anthony Stellato (astellato).

http://syphon.v002.info

ofxsyphon's People

Contributors

astellato avatar bangnoise avatar comoc avatar danomatika avatar dimitre avatar hvfrancesco avatar lyptik avatar nil0 avatar oftheo avatar s-ol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ofxsyphon's Issues

Compiling with newest OF (Git Master) errors

I just updated my Openframeworks to the latest found on Github Master branch and found out this error when creating a simple project with ProjectGenerator and adding ofxSyphon :

.../addons/ofxSyphon/libs/Syphon/lib/osx/Syphon.framework: No such file or directory

Syphon.Framework appears as missing on the file tree ?
Not sure which commit from OF has broken this as I was working with Sept.2022 before this update.
Any workaround ?

OFw 0.8 compatilibity

I've tried to compile in OFw 0.8 and got errors in this lines

    mTex.texData.glType = GL_RGBA;
    mTex.texData.pixelType = GL_UNSIGNED_BYTE;

Thanks

Is it possible to send through ethernet?

Hello, not really sure if this is an issue.

I'm grabbing perfectly the Syphon stream in other apps in the same computer, but I would like to do so with multiple computers using this library. Do I need to make some special bridge to connect this between 2 computers (in the same network) using an ethernet cable/router?

Thanks

Installation instructions

I just tried adding oxfSyphon to an openFrameworks 0.8.1 project via the Project Generator. After following the instructions, to get it to compile I also had to add Syphon.framework to the "Link Binary with Libraries" build phase as well as dragging SyphonNameboundClient.m into the project manually.

Pretty simple, but might throw off people not comfortable with XCode.

Thanks for the great addon!

Undefined symbols - _glutDragEventFunc

Hi - I'm coming up with the following two issues when attempting to run the examples in oF 0.8.4 with the latest commit of syphon (c739fea). I've included screenshots of the error and my project setup.

I added syphon to my build settings search paths.

screen shot 2015-06-08 at 8 44 13 am
screen shot 2015-06-08 at 8 45 03 am

Also, a slight correction to your readme - I believe it should say:

addons/ofxSyphon/libs/Syphon/lib/osx

instead of

addons/ofxSyphon/lib/Syphon/lib/osx

can't get the examples to work

hello,

Thanks for the addon.
I can't get it to work even after following precisely the instructions in the readme file.

I then tried to compile the examples but still have problems.
after setting the project i still have an issue compiling the example :

..libs/openFrameworks/types/ofTypes.h:9:10: 'tr1/memory' file not found

Using oF 0.8.4 on macosx 10.9.2

trouble compiling with 0.8.3

i'm trying to compile the basic example with 0.8.3 using the project generator

i'm copying the three source code files over to my new app folder:
main.cpp
ofApp.cpp
ofApp.h

i'm manually adding syphon.framework to "Link Binary with Libraries" as indicated in the previous issue posted to this board:

image

but i'm still getting compilations errors:

image

of 0.9x compatibility

FYI - glTypeInternal has changed to glInternalFormat. I think there were a couple of other changes. I haven't had any time to fork it and update changes - sorry.

OfxSyphon LLVM compiler error (C++ syntax problem)

I've tried ofxSyphon beta 2 on OX6.8 and OF008 (on xcode 4.2)
The compiler used is GCC 4.2.
It seems that there is some syntax problem with the auto type
The compiler complains in the file ofxSyphonServerDirectory.mm at the function below

bool ofxSyphonServerDirectory::serverExists(ofxSyphonServerDescription _server){
for(auto& s: serverList){
if(s == _server)
return true;
}

return false;

}

It says that the loop variable s must not be declared as auto.

It's a c++11 syntax and of008 is not yet compatible with it

Sharing GL_RGB16 or GL_RGB32F Texture

Hi,

I am trying to share a (pointcloud) texture of ofFloatImage/ofShortImage. But no matter what I try it looks I am loosing data at the receiving end (as if the RGB are only of 8bit per channel).

Is it possible to share a texture that is not of type GL_RGB/GL_RGBA but of type GL_RGB16/GL_RGB32F after all?

OF 0.12.0 is out ⚡️

I'm writing just to inform the ARC enabled release is now the default go to OF.
In the case you want to move of_head to master
feel free to close here.

Normalized tex coords don't work

When I put ofEnableNormalizedTexCoords at the start of ofApp::setup in example-Basic, the client no longer renders the texture from the server correctly.

The same happens I do

mClient.bind();
mClient.getTexture().draw(50,50);
mClient.unbind();

instead.

Manually add ofxSyphon to Xcode

Because of complications with other addons I need to install this one manually to my xcode project and I am having trouble.

I am using OF 9.8 on OSX 10.12.6 and I successfully compiled the example when I use the project generator. I tried to add ofxSyphon to my project by replicating the settings in the successful example project.

I did the following:

  1. Create the same file structure.
    Screen Shot 2019-04-03 at 2 03 09 PM

  2. Link the framework
    Screen Shot 2019-04-03 at 2 04 03 PM

  3. Add ../../../addons/ofxSyphon/libs/Syphon/lib/osxto framework search paths

  4. Add the following to header search paths.

../../../addons/ofxSyphon/libs
../../../addons/ofxSyphon/libs/Syphon
../../../addons/ofxSyphon/libs/Syphon/lib
../../../addons/ofxSyphon/libs/Syphon/lib/osx
../../../addons/ofxSyphon/libs/Syphon/src
../../../addons/ofxSyphon/src

These were all the custom setting I could find in the successful xcode project created by the project generated, but my new project won't compile. I get a bunch of Undefined symbols for architecture x86_64 errors.

Screen Shot 2019-04-03 at 2 07 48 PM

Are there additional step I should take to manually add ofxSyphon?

Consider removing example project files

As oF and Xcode change over time, it is extra maintenance work to manually update the Xcode projects. I'd suggest considering removing all project files which users can generate themselves using the oF ProjectGenerator.

I have done this many years ago with my addons and it hasn't been a major issue since I also include information on how to generate them, ex. https://github.com/danomatika/ofxLua#running-the-example-projects

For this addon, I think the only thing you would need to leave for each example is addons.make and src with maybe a bin/data/.gitkeep thrown in for completeness if/when someone uses the example as a template.

ofEnableArbTex / ofDisableArbTex();

I had an issue with the texture not filling the syphon recorder screen size. It comes down to ofDisableArbTex() being called in setup. Turned out that the shader that needed ofDisableArbTex still worked if I called ofEnableArbTex() inside the draw function.

ofEnableArbTex();
tex.loadScreenData(0,0,ofGetWidth(),ofGetHeight());
//both work
mainOutputSyphonServer.publishScreen();
individualTextureSyphonServer.publishTexture(&tex);
ofDisableArbTex();

Worth mentioning I figure.

Compilation on OSX with QT-creator

Hey,
I'v been trying to compile ofxSyphon with Qt creator instead of Xcode and finally succeeded. :)

  • Generate a qt-creator project with the Project Generator frontend app.
  • Then set your ofApp.qbs file to match these lines:
ofApp {
    // dirty workaround for Qt Creator not parsing .mm files from the addons folder
    files: [
        // main.cpp, ofApp.h+cpp, etc.
        '../../../addons/ofxSyphon/src/ofxSyphonClient.mm',
        '../../../addons/ofxSyphon/src/ofxSyphonServer.mm',
        '../../../addons/ofxSyphon/src/ofxSyphonServerDirectory.mm',
        '../../../addons/ofxSyphon/libs/Syphon/src/SyphonNameboundClient.m'
    ]
    of.includePaths: [
        '../../../addons/ofxSyphon/libs',
        '../../../addons/ofxSyphon/libs/Syphon',
        '../../../addons/ofxSyphon/libs/Syphon/lib',
        '../../../addons/ofxSyphon/libs/Syphon/lib/osx',
        '../../../addons/ofxSyphon/libs/Syphon/src',
        '../../../addons/ofxSyphon/src',
    ]
    // include macosx framework
    of.frameworks: ['Syphon']
}
  • Adding the .framework library search path doesn't work so you have to copy the Syphon.framework to /Library/Frameworks in order to link against it.
  • Then it should compile correctly but won't launch on other computers.
    To fix this, either copy /addons/ofxSyphon/libs/Syphon/lib/Syphon.Framework to /bin/ofApp/Contents/Frameworks/Syphon.Framework or copy Syphon.framework to /Library/Frameworks on the computer you'd like to run your ofApp on.

So that's about how far I got, the next step would be using the Syphon.Framework from the addons folder rather then from /Library/Frameworks. Any ideas ?
With these lines I couldn't get it to work while it should. (even using absolute paths)
of.linkerFlags: ['-F../../../addons/ofxSyphon/libs/Syphon/lib/osx']
of.cxxFlags: ['-F../../../addons/ofxSyphon/libs/Syphon/lib/osx']

Including the Syphon.Framework copy step in the Qt build process would be nice too.

(Still looking for better solutions so no PR yet, leaving issue open until then.)

Add client and server clear() functions

Currently, to dynamically stop and (re)start a server or client, you need to use a pointer and delete/create. We could add a clear() function, similar to most oF classes, which clears the internal Obj-C instances.

I'd be up for making a PR if there is interest. What do you think @dimitre @ofTheo ?

Make build issues

ofxSyphon source isn't being compiled for Makefile builds

Running make in example-Basic gives (shortened):

HOST_OS=Darwin
Compiling OF library for Release
HOST_OS=Darwin
HOST_OS=Darwin
HOST_OS=Darwin
Done!


Compiling example-Basic for Release
HOST_OS=Darwin
cat: obj/osx/Release/.compiler_flags: No such file or directory
Compiling /Users/tom/Development/OpenFrameworks/of_v0.9.3_osx_release/addons/ofxSyphon/example-Basic/src/main.cpp
...
Compiling /Users/tom/Development/OpenFrameworks/of_v0.9.3_osx_release/addons/ofxSyphon/example-Basic/src/ofApp.cpp
...
Linking bin/example-Basic for osx
...
Undefined symbols for architecture x86_64:
  "ofxSyphonClient::set(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)", referenced from:
      ofApp::setup() in ofApp.o
  "ofxSyphonClient::draw(float, float)", referenced from:
      ofApp::draw() in ofApp.o
  "ofxSyphonClient::setup()", referenced from:
      ofApp::setup() in ofApp.o
  "ofxSyphonClient::ofxSyphonClient()", referenced from:
      _main in main.o
  "ofxSyphonClient::~ofxSyphonClient()", referenced from:
      ofApp::~ofApp() in ofApp.o
      ofApp::~ofApp() in ofApp.o
      non-virtual thunk to ofApp::~ofApp() in ofApp.o
      non-virtual thunk to ofApp::~ofApp() in ofApp.o
  "ofxSyphonServer::publishScreen()", referenced from:
      ofApp::draw() in ofApp.o
  "ofxSyphonServer::publishTexture(ofTexture*)", referenced from:
      ofApp::draw() in ofApp.o
  "ofxSyphonServer::setName(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)", referenced from:
      ofApp::setup() in ofApp.o
  "ofxSyphonServer::ofxSyphonServer()", referenced from:
      _main in main.o
  "ofxSyphonServer::~ofxSyphonServer()", referenced from:
      _main in main.o
      ofApp::~ofApp() in ofApp.o
      ofApp::~ofApp() in ofApp.o
      non-virtual thunk to ofApp::~ofApp() in ofApp.o
      non-virtual thunk to ofApp::~ofApp() in ofApp.o
  "_glutDragEventFunc", referenced from:
      ofAppGlutWindow::setup(ofGLWindowSettings const&) in libopenFrameworks.a(ofAppGlutWindow.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [bin/example-Basic] Error 1
make: *** [Release] Error 2

ofxSyphonClient getTexture not working without draw

I took a while to discover, but getTexture actually is not allocated if I don't use draw command.
I'm now using a draw to circumvent this.

syphonIn.draw(0,0,0,0);
ofTexture & tex = ui->pBool["syphon"] ? syphonIn.getTexture() : webcam.getTexture();

Thanks

using a FBO with ofxSyphon on 008 crashes openFrameworks

Hi Astellato. I've been getting major headaches with this, I managed to get ofxSyphon basic example to compile against 008 but when I add

fbo.begin();
ofClear(0,0,0,0);
fbo.allocate(ofGetWidth(),ofGetHeight(),GL_RGBA);
fbo.end();

in my test app setup after declaring an ofFbo in my .h I get the following error.
screen shot 2013-10-21 at 7 31 50 am

I have replicated this same error on 3 mac computers now all using oF008, 2 using Xcode 5 and 1 using Xcode4. Weirdly, if I just allocate the fbo in my setup code, leaving out the fbo.begin() and fbo.end() then it compiles fine....?

Any ideas on what is going on here?

Thanks,
Josh

Syphon/Syphon.h file not found with open frameworks nightly (20170714)

Hi! I've been using syphon in my xcode project for a while. I've just swapped to openframework nightly in order to use some specific feature, but now I can't get syphon working anymore.

I've read this thread, and have checked that I've got Syphone.framework in Link Library with Binaries (see the following screenshot)

screen shot 2017-10-06 at 17 29 06

Has anyone got it working with the latest OF nightly? Am I missing certain configurations?

Syphon frames received out of order

Has anyone here used ofxSyphon successfully?

I'm trying to use syphon to make a recording of my performance software on a 2014 MBP with i7 & GT750M.

My software uses openFrameworks and ofxSyphon. The output is 1080p and I'm using the standard way of publishing the stream from the examples - ie mainOutputSyphonServer.publishScreen() on the main thread.

When I open syphon recorder, I can see the output, but the frames play out of sequence - movement jumps back and forth, I would estimate by at least a second - as if there's a buffer of 25 frames and they are being displayed in the wrong order.

Has anyone seen anything like this with ofxSyphon? Or has anyone used syphon successfully to record a 1080p stream?

Problem on wrapping the texture to cvMat

I am trying to wrap ofxSyphon texture to cvMat, that is my process:

    tex = client.getTexture();
    tex.readToPixels(pix);
    syphonMat = toCv(pix);

but there are the error while I run this line: tex.readToPixels(pix);
[ error ] ofPixels: format doesn't support channels
[ error ] ofGLUtils: ofGetGLFormatFromPixelFormat(): unknown OF pixel format-1, returning GL_LUMINANCE

Anyone have the ideas?

converting an ofTexture extracted from a ofxSyphonClient to an ofImage

Hello,

I’m trying to convert an ofTexture—extracted from a ofxSyphonClient—to an ofImage as follows:

ofTexture sTexture(syphonClient.getTexture());
sTexture.draw(0, 0, ofGetWidth()/2, ofGetHeight());
ofPixels pixels;
sTexture.readToPixels(pixels);
ofImage sFrame;
sFrame.setFromPixels(pixels);
sFrame.draw(ofGetWidth()/2, 0, ofGetWidth()/2, ofGetHeight());

The problem is that sFrame is not being currently drawn (line 7). My sTexture, on the other hand, is drawn as expected (line 2). No errors are shown in the console.

The same code works fine if the sTexture is loaded from somewhere else (say a ofVideoPlayer) instead of a Syphon client.

Is this a bug or am I missing something?

Getting EXC_BAD_ACCESS on startup.

Hi! I'm seeing this behavior with regularity when quitting & relaunching my app. I'm using OF 0.9.0 and the OpenFrameworks-0.9 branch of this repo. Looks like mSyphon is pointing at something...that doesn't exist anymore?

Nothing crazy with Syphon in my app, just an ofxSyphonServer syphon; declaration in my header file and a syphon.publishScreen(); in draw() Any thoughts? Thanks!

screen shot 2015-11-29 at 8 14 49 pm

Server doesn't list clients existing before app start

I'm not sure if this is maybe a known limitation of Syphon itself, but ofxSyphonServerDirectory doesn't seem to list servers that existed before startup.

To reproduce:

  1. Start the Simple Server example app from Syphon
  2. Start example-ServerDirectory
  3. The screen remains blank even after pressing a key
  4. Close and reopen the Simple Server app
  5. The server appears in the (still open) example-ServerDirectory

Range based for loops

I think most users on osx compile by gcc 4.2 which does not know range based for loops. Would it be possible for you to not use them in order to make your otherwise brilliant software available to as many as possible?

Non-void function does not return a value in all control paths

This function returns this error

Non-void function does not return a value in all control paths

ofxSyphonClient & ofxSyphonClient::operator= (ofxSyphonClient const& s)
{
if (&s == this)
{
return *this;
}
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
[(SyphonNameboundClient*)mClient release];
mClient = [(SyphonNameboundClient*)s.mClient retain];
[(SyphonOpenGLImage*)latestImage release];
latestImage = [(SyphonOpenGLImage*)s.latestImage retain];
mTex = s.mTex;
width = s.width;
height = s.height;
bSetup = s.bSetup;
appName = s.appName;
serverName = s.serverName;
[pool drain];
}

syphon.getTexture potential race condition?

Is there a potential race condition/gotcha if I add a method like

ofTexture SyphonClient::getTexture(){
return mTex;
}

?

It seems like it could have an issue with the various GL stuff, but I don't know - I was able to implement it and it worked, but I'm not sure if it would eventually break and I just got lucky.

What about the future ?

Hello,

Syphon is really a must have for openFrameworks.
Unfortunately, this addon is quite complicated to use for XCode noobs.

I tried and keep trying but can't get it to work with oF0.8.4

Is there a chance this addons will work properly with projectGenerator one day ?

thanks a lot by the way

is it possible to change file name + path for syphon recorder?

Is it possible through the addon to change the path where files get saved by the syphon recorder app?

Is it possible to change the file name after calling individualTextureSyphonServer.setName("Texture Output"); in setup?
I would like it to contain custom info for each recording.

Ideally one would also be able to change the resolution settings from OF for the recorded videos.

My app starts and stops multiple recordings automatically using this solution:
https://forum.openframeworks.cc/t/ofxsyphon-start-and-stop-recording/24187

I know this might be not possible but i thought i'd ask.
thanks.

Server produces just diagonal line

Hi, I'm finding ofxSyphonServer is producing just a single diagonal line of pixels from the output - this is using both publishScreen() and publishTexture(&fbo.getTexture())

Screengrab attached

screen shot 2017-05-02 at 16 37 57

The line of pixels that is there though does seem to be realtime!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.