Video Objects
The video objects falicitates the creation of video integration in the
scene-graph. A list of predefined and useful objects associates with a
video can be rapidly instancied to manipulate video stream in a higher
level.Introduction
The diagram below summarizes the idea of the video object:A video input (live camera, video file, streaming video),instance of a class derived from GenericVideo can be associate to a video object (derived from GenericVideoObject). Internally this video input will be associate with a video texture (derived from a VideoTexture). The video object will therefore deal about the mapping of the video texture on the object (like in the image we can have a VideoCylinder object).
We propose in our library this list of video objects:
- VideoLayer: define a
video layer which is screen aligned and can be superpose (like HUD).
the user can specify the depth of this video layer, and therefore
create multiple layers of videos info for creating overlays, multiple
plans etc.
- VideoBackground: it's a
video layer with depth equal to 1 (the background layer). notice by
default this layer can't be transparent. This is the layer you will use
for creating a simple AR application.
- VideoForeground: it's a video layer will be always positioned at the front. Useful for having for example video HUD.
- VideoPlane: a simple
quad to display video input. the video plane can support multiple
video input which can be mix together with video shaders (see below for
more information).
- VideoBillboard: a video plane that can automatically align with the camera orientation.
- VideoAvatar: a specialized video plane that can deal with chroma key or matte compositing effect. This object therefore simplify the creation of video avatar for CVE, AR teleconferencing, etc.
Some video objects: video layers,
video plane (with multiple videos) and video avatar
Complimentary to these objects, the developer can easily create their own videoobject from a Geode node and associate it a video texture.
Video Texture
The library support actually three types of dynamic textures:- Texture Rectangle: this is the default solution actually
implemented on all graphics card. It simplify the creation and the
definition of texture coordinates independently of the size of the
texture.
- Texture 2D: this is the solution to use if your PC doesn't
support Texture Rectangle, derived from the standard Texture2D of
OpenSceneGraph.
- Image Stream: the one used with xine plugin, using PBO for optimizing the texture refreshing and transfert to the video memory.
videoBackground->setTextureMode(osgART::GenericVideoObject::USE_TEXTURE_RECTANGLE);
Video Shader
The library integrate the concept of video shaders, a shader you can apply to a texture using a video image. The video shader can transform your video image in sepia mode, black and white, gaussian blur, laplacien filtering, etc. To simplify the development of these shaders, the library offers a structure to associate a high level definition of a shader to an object by the usage of the GenericVideoShader class. A GenericVideoShader class can be associate to a video object:Rather than to be a complex mechanism, this simple principle offers an easy solution to use basic video shaders for their applications. It can be really useful for developping ART demonstration, live VJ software, video player in 3D, etc.
A Black and White VideoShader
apply to the default video input