PDA

View Full Version : Scale and rotate video feed



mickeh
09-05-2012, 02:36 AM
Hi!
I wonder if anyone can point in right direction for solving following problem.
I have a program in OpenGL developed on Linux that gives a video feed in really high resolution.

Now I want to show a copy of that feed on another screen but in lower resolution.
I also would have an option to rotate the feed.

Is the best solution to modify my program to send out to feeds in two different
resolutions and rotated view or is it better to make a separate program that capture the feed,
scale it down (rotate) and send it to free gfx-out?
I know that it's difficult to make changes in the program that give me the video feed...

Perhaps there already exists a program out there that solves my problem?

thokra
09-05-2012, 02:47 AM
In a brute force approach you only need a rectangle or something which obeys your resolution constraints and you simply texture that rectangle. The hardware will automatically apply the minification filter if the texture covers an area smaller than it's resolution. Thus scaling is implicitly handled. Open the video in some media player and play around with the window size and note how scaling affects the area that displays the video - you'll see what I'm talking about.

Rotating the geometry will yield the desired effect automatically. What you need is the ability to retrieve single frames from the video feed. You also need to make sure that the number of frames per second is the same as the original video feed's. Otherwise you'll have a video running either in slow motion or too fast - unless you want to provide such functionality.