Need some help in setting up an application. I need to combine a live webcam feed video next to a looping static video in the same application (1 window).
Or in other words, 2 applications, 1 window.
My TOTAL window size is 1920x1080.
And for sake of argument lets say the area for my live webcam feed is the left half of my application window, 960px wide X 1080 px high.
How would I do this?
Would I need to set this up somehow in my main with ofGLFWWindowSettings or?
Does it have to be two separate applications ? Can’t you just run the video grabber code and the video player next to each other in one app ? It would be the easiest! Something like:
If it really needs to be two separate application, you probably can make 2 frameless windows and position them next to each other. It will be fine unless you need to use the content of app A into app B and vice versa
Thanks. Since I’m dealing with video in each application, and the source video is 1920 x1080, what I need is to be able to crop as well as position(draw) the video, so that there is no distortion. I’ve posted this as another question.
You can use the drawSubsection function to resize and crop your 1920x1080 video to something that would match what you want.
Thanks again!. Was going to try this https://github.com/armadillu/ofxTextureCrop but drawSubsection seems like what I was looking for.
The only issue is that the video classes I am using ofVideoGrabber, etc don’t implement drawSubsection directly
Something like that should work:
vid.getTextureReference().drawSubsection(0, 0, vid.getWidth(), vid.getHeight(), vid.getWidth()*0.5, vid.getHeight()*0.5)
(obviously you need to configure the video grabber and for the sx and sy parameter it’s up to you to find what values work for you)