VideoMapping / lpmtX2

the 2nd version to the recoded lpmt video mapping sofware for linux & osx
MIT License
14 stars 4 forks source link

framerates drop when using preview #6

Open jamet opened 8 years ago

jamet commented 8 years ago

it seems in my test setup, that i have some problems with framerates with the master branch.

first thing is the use of glfw window, which can't make it faster than 40FPS, changing it to glut makes the trick, and framerates goes to 60 as configured. -> @Giladx , @nanu-c can anyone try to compile two versions of lpmt (one with glfw and the other with glut, there is only minor changes to do in main.cpp) to see if you have the same problem.

second thing is that streaming lpmt's output seems very time consuming, and i think it's due to grabbing an opengl screen every cycle through ofImage.grabScreen(). With preview on, i can't have better perf than 15FPS, which is really low to dysplay a live stream, when turning it off, i go back to 60FPS! -> i don't know about a better method to grab a screen, any ideas? an other option would be to thread the stream from lpmt, so that the streaming part would not slow down the dysplay part, but i have never done such a thing...

jamet commented 8 years ago

quite struggling on this, there is no way to make a threaded screen capture, since only the main thread has the lock on the gl context. I tried to create a new branch using oftexture and not ofImage to grab screen to e more efficient, but i can't make it work, so i have made a few more commits to master to grab screen only 1 out n render cycle (frames), that is the REFRESH_RATE parameter in the XML config.

On my setup, with the few tests i 've made : Preview on at refresh_rate 1 (grabbing every render cycle) :12-15FPS Preview on at refresh_rate 4 (every 4 cycle) : 30-35 FPS Preview on at refresh_rate 16 (every 16 cycles) : 50 FPS Preview off : 60FPS

i think if there is no other solution than use grabScreen, one's must do a fine tunning depending what is the most important in the setup, reactive display or reactive preview... can't do much better right now, and a bit running out of ideas....

Giladx commented 8 years ago

Hey @jamet @nanu-c what about vnc as a remote and preview? I use it now externally (with a vnc client) while I am using remoteX on network. maybe there is a way to integrate a simple vnc client into remoteX instead of piping output window back as a video?

jamet commented 8 years ago

@Giladx , well, i don't know if it will be less cpu consumming to go through a vnc client, i know very few things about it, so i won't even be able to look for it :)

I also don't understand why should the vnc client be integrated in lpmt? but that's maybe because we don't really know how each others plans to use it, might be interssant to talk about it with @nanu-c also.

for the stream stuff,it works quite good, but as i want to use lpmt with live caption, i' m looking to have as much idle cpu possible for a display with minimum latency, but it's only a control preview, and anyway it's easily stopped if you don't want that feature, just set preview on to 0 in config.xml .

jamet commented 8 years ago

hey @Giladx @nanu-c,

i've just a made a quick and dirty video of a test setup with lpmt, remoteX, twisty.ligth, 2 webcams a customised keyboard., this a just to show a live sampling video-mapped to the background, i know hat videos are not well filmed, but just to show the concept : https://youtu.be/oia1TgbHNlE

adding video loops: https://youtu.be/b5WYjt_EaXY

and you, how do you use lpmt?

Giladx commented 8 years ago

Hey jamet this is very nice! @jamet @nanu-c I am a freelance as a video artist and I use all kind of software such as blender, dataton watchout, natron, hippotizer etc. I use lpmt for more complex mapping installations and sometimes I capturing it thru a different software for multi display projections and led walls I believe lpmt can be made to work as standalone (without the use of other software) video server and that's way I started twisty and RemoteX. I use also Duration timeline and I believe that it can be tweaked to be lpmt external timeline too ... I am sorry i am in a hurry I cannot finish this now I will be back to give more info
Thanks great day