Hi,
I render a video game based on osg into a video stream, you can have an
idea here http://plopbyte.net/?page_id=6/ you need a firefox plugin to
watch it.

The basic idea works on linux with gstreamer. Dont tested on windows but
because there is gstreamer, maybe it works too.

In the game code i added a thread that write image at a given rate. This
file is written into a file descriptor created with mkfifo.
Then i use a command line when the game is running:
gst-launch-0.10 filesrc location=myfifo ! videoparse width=800
height=600 format=15 framerate=20/1 ! ffmpegcolorspace ! videoscale !
video/x-raw-yuv, width=800, height=600 ! videoflip method=5  ! theoraenc
quality=40  ! oggmux ! gdppay ! tcpserversink port=12000 2>&1 >>log

The advantage using gstreamer is that you can use the codec you want to
encode the video and stream it over the web.

The code is inside this project http://hg.plopbyte.net/pokme/

Cheers,
Cedric

-- 
Provide OpenGL services around OpenSceneGraph and more
+33 659 598 614 Cedric Pinson mailto:[email protected]
http://www.plopbyte.net


On Mon, 2010-02-01 at 17:39 -0500, [email protected] wrote:
> Adrian -                                                                      
>                                  
>   A way that I've used for that type of functionality is through a            
>                                  
> Camera::DrawCallback subclass.  You can get the rendered scene through        
>                                  
> an (osg::Image) readPixels() call and pass it out through whatever
> stream you                                  
> like frame by frame.  It isn't extremely fast since it depends on the         
>                                  
> readPixels() call, but on a Quadro or the like it has always been 'fast       
>                                  
> enough' for my purposes.                                                      
>                                  
>                                                                               
>                                  
>   For the video stream output, I can't offer too much advice because I        
>                                  
> have usually been happy to work with the raw frames, but you can pretty       
>                                  
> much tie whatever you like at that point. 
> 
> Rudy
> 
> On Mon, Feb 01, 2010 at 03:51:27PM +0100, Adrian Egli OpenSceneGraph (3D) 
> wrote:
> > Hello all,
> > 
> > i am looking for a library or idea how we could render osg into a video
> > stream?
> > 
> > /adrian
> > 
> > -- 
> > ********************************************
> > Adrian Egli
> 
> > _______________________________________________
> > 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
> 

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to