Hi Luis,

The osg::Texture/osg::Image classes support both texture subloading and
using of PixelBufferObjects so it well equipped for doing live video work.
All you need to do at your end is use an osg::Image or osg::ImageStream that
is assigned to textures you want and each time you update the image data the
texture will automatically update using subloading.

The ImageStream is a subclass from osg::Image that adds extra movie related
methods, and by default the use of PBO to help speed the texture downloads.
You can subclass from osg::ImageStream yourself like the xine-lib, quicktime
and the new ffmpeg plugin do, or just use osg::Image and update the data
using Image::setData or just updated the local pixel image data assigned to
the Image and then call dirty() so that the texture knows about the change.

The other alternative is just to use either the ffmpeg or the quicktime
plugins as they already support reading from live video sources.  For
instance, under Linux,  with the latest OSG dev releases you can use the
ffmpeg plugin to read from a web cam:

  osgmovie -e ffmpeg /dev/video0

Robert.

On Tue, Mar 24, 2009 at 4:13 PM, Luis Rodriguez
<[email protected]>wrote:

> Hi,
>
> I'm working on an application that copies video from a web cam to a
> texture. I've done this in the past using glTexSubImage2D when coding
> straight to OpenGL. What is the correct way to do this with OpenSceneGraph?
> I need the route with the least overhead.
>
> Thank you.
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=9107#9107
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to