Re: [osg-users] High resolution screencast
Hi Jeremy, I have a Nvidia Card, so thanks for your tip? Yet I don't undertand what it's supposed to do exactly. On Fri, Jan 9, 2009 at 9:43 PM, Jeremy Moles jer...@emperorlinux.comwrote: On Fri, 2009-01-09 at 19:33 +0100, Simon Loic wrote: Ok forget about it it was a problem of -fPic flag in the compilation of some libraries. The next step is to make osg framerate constant in order to get smooth videos. If I undertood well what was said before this consists in rewriting the Mainloop of the viewer. I'll try this soon. It's much easier if you're using an NVidia card! :) Here are two bash functions I wrote to help: # Run an OpenGL application with antialiasing. function __fsaa() { if [ -z ${*} ]; then echo -e usage: fsaa NUM CMDLINE\n echo -e \t0 = FSAA disabled echo -e \t1 = 2x Bilinear Multisampling echo -e \t2 = 2x Quincunx Multisampling echo -e \t3 = FSAA disabled echo -e \t4 = 4x Bilinear Multisampling echo -e \t5 = 4x Gaussian Multisampling echo -e \t6 = 2x Bilinear Multisampling 4x SS echo -e \t7 = 4x Bilinear Multisampling 4x SS echo -e \t8 = 4x Bilinear Multisampling 2x SS\n return 1 else local MODE=${1} shift 1 eval __GL_FSAA_MODE=${MODE} ${*} fi } # Run an OpenGL application with vsync enabled. function __glsync() { eval __GL_SYNC_TO_VBLANK=1 ${*} } ... Once you've added these to your bashrc, you can do something like this: # __glsync osgviewer ...or... # __fsaa 4 __glsync osgviewer The general idea is to export the __GL_* variables properly. :) Thanks once again. On Thu, Jan 8, 2009 at 10:56 AM, Simon Loic simon1l...@gmail.com wrote: Hi, I'm back at work and I can give you the details. The first problem I had was at compile time. I think it was linked with conflicting definitions. Here is the error message. /bin/mkdir -p bc/gl perl ./gengl/gengl.perl --mode=alias /usr/include/GL/gl.h /usr/include/GL/glx.h /usr/include/GL/glext.h /usr/include/GL/glxext.h bc/gl/alias.bc glFramebufferTextureLayerEXT is defined in both GL_NV_geometry_program4 and GL_EXT_texture_array at ./gengl/gengl.perl line 436, H line 10154. To solve it I did something quite ugly : I commented the mentioned line 436 of gengl/gengl.perl. After that It compiles but I looking forward a better fix. The second problem I get is the more important. The bugle filterset associated with screen capture is not recognised. I get the following warning : warning: ignoring unknown filter-set screenshot BTW, Im using the following command : BUGLE_CHAIN=video LD_PRELOAD=libbugle.so my_application with the following chain: # Captures a video file. chain video { # Press C-V to start and to stop recording. By removing the inactive # tag, recording will start immediately. filterset screenshot C-V inactive { video yes filename bugle.avi # You can in theory use any codec supported by ffmpeg codec mpeg4 # Roughly DVD size, although no high quality options are set bitrate 750 # By default, a frame is captured every 30th of a second, with # frames skipped or duplicated as necessary. Uncomment this # line to instead capture every frame exactly once to the # output. # allframes yes # Control the encoding latency. A higher latency may give # better throughput, at the expense of more memory. # lag 1 } } Just so you know, here is the recap of the configure script call (it may help): Configuration: libavcodec: yes readline: yes GUI: yes (with OpenGL) X event interception: yes Thanks very much. On Wed, Jan 7, 2009 at 11:38 PM, Simon Loic simon1l...@gmail.com wrote: I tried it but I encountered few problems. I will send you the detailed tomorrow. Still thanks for the tip. On Tue, Jan 6, 2009 at 5:40 PM, Jeremy Moles jer...@emperorlinux.com wrote: Not trying to hijack this thread--and I
Re: [osg-users] High resolution screencast
Ok forget about it it was a problem of -fPic flag in the compilation of some libraries. The next step is to make osg framerate constant in order to get smooth videos. If I undertood well what was said before this consists in rewriting the Mainloop of the viewer. I'll try this soon. Thanks once again. On Thu, Jan 8, 2009 at 10:56 AM, Simon Loic simon1l...@gmail.com wrote: Hi, I'm back at work and I can give you the details. The first problem I had was at compile time. I think it was linked with conflicting definitions. Here is the error message. /bin/mkdir -p bc/gl perl ./gengl/gengl.perl --mode=alias /usr/include/GL/gl.h /usr/include/GL/glx.h /usr/include/GL/glext.h /usr/include/GL/glxext.h bc/gl/alias.bc glFramebufferTextureLayerEXT is defined in both GL_NV_geometry_program4 and GL_EXT_texture_array at ./gengl/gengl.perl line 436, H line 10154. To solve it I did something quite ugly : I commented the mentioned line 436 of gengl/gengl.perl. After that It compiles but I looking forward a better fix. The second problem I get is the more important. The bugle filterset associated with screen capture is not recognised. I get the following warning : warning: ignoring unknown filter-set screenshot BTW, Im using the following command : BUGLE_CHAIN=video LD_PRELOAD=libbugle.so my_application with the following chain: # Captures a video file. chain video { # Press C-V to start and to stop recording. By removing the inactive # tag, recording will start immediately. filterset screenshot C-V inactive { video yes filename bugle.avi # You can in theory use any codec supported by ffmpeg codec mpeg4 # Roughly DVD size, although no high quality options are set bitrate 750 # By default, a frame is captured every 30th of a second, with # frames skipped or duplicated as necessary. Uncomment this # line to instead capture every frame exactly once to the # output. # allframes yes # Control the encoding latency. A higher latency may give # better throughput, at the expense of more memory. # lag 1 } } Just so you know, here is the recap of the configure script call (it may help): Configuration: libavcodec: yes readline: yes GUI: yes (with OpenGL) X event interception: yes Thanks very much. On Wed, Jan 7, 2009 at 11:38 PM, Simon Loic simon1l...@gmail.com wrote: I tried it but I encountered few problems. I will send you the detailed tomorrow. Still thanks for the tip. On Tue, Jan 6, 2009 at 5:40 PM, Jeremy Moles jer...@emperorlinux.comwrote: Not trying to hijack this thread--and I can't really read it all for now because I'm still fighting off lots of complications from a recent oral surgery--but what you want is called bugle. I used it to make all of the old osgWidget and osgPango videos and it works like a charm. What it does is LD_PRELOAD's glSwap() or whatever and replaces it with a version that shimmies off data to ffmpeg for encoding. Simple, clean, and easy for basic usage. On Thu, 2008-12-18 at 20:38 +0100, Simon Loic wrote: Hi, I apology in advance if this thread have been heavily answered before (if so just tell where I can find the solution). Still I would like to know the different alternative (the good ones) to record a video of my scene. So far I was using an external tool for screenCast (called istanbul). But I'm not satisfied by this because when my scene is very complex, my osg based application is lagging and this leads to a poor quality of th video. I'm especially interested if there is a way to create an RecordCameraPathHandler to record a path, and then instead of saving it as a .path file compute the video in a batch mode. By batch mode I mean that the creation of the video doesn't need to be real time. In that way I could hopefully control the lag effects and eventually the resolution of the video. Sincerely, -- Loïc Simon ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Loïc Simon -- Loïc Simon -- Loïc Simon ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] High resolution screencast
On Fri, 2009-01-09 at 19:33 +0100, Simon Loic wrote: Ok forget about it it was a problem of -fPic flag in the compilation of some libraries. The next step is to make osg framerate constant in order to get smooth videos. If I undertood well what was said before this consists in rewriting the Mainloop of the viewer. I'll try this soon. It's much easier if you're using an NVidia card! :) Here are two bash functions I wrote to help: # Run an OpenGL application with antialiasing. function __fsaa() { if [ -z ${*} ]; then echo -e usage: fsaa NUM CMDLINE\n echo -e \t0 = FSAA disabled echo -e \t1 = 2x Bilinear Multisampling echo -e \t2 = 2x Quincunx Multisampling echo -e \t3 = FSAA disabled echo -e \t4 = 4x Bilinear Multisampling echo -e \t5 = 4x Gaussian Multisampling echo -e \t6 = 2x Bilinear Multisampling 4x SS echo -e \t7 = 4x Bilinear Multisampling 4x SS echo -e \t8 = 4x Bilinear Multisampling 2x SS\n return 1 else local MODE=${1} shift 1 eval __GL_FSAA_MODE=${MODE} ${*} fi } # Run an OpenGL application with vsync enabled. function __glsync() { eval __GL_SYNC_TO_VBLANK=1 ${*} } ... Once you've added these to your bashrc, you can do something like this: # __glsync osgviewer ...or... # __fsaa 4 __glsync osgviewer The general idea is to export the __GL_* variables properly. :) Thanks once again. On Thu, Jan 8, 2009 at 10:56 AM, Simon Loic simon1l...@gmail.com wrote: Hi, I'm back at work and I can give you the details. The first problem I had was at compile time. I think it was linked with conflicting definitions. Here is the error message. /bin/mkdir -p bc/gl perl ./gengl/gengl.perl --mode=alias /usr/include/GL/gl.h /usr/include/GL/glx.h /usr/include/GL/glext.h /usr/include/GL/glxext.h bc/gl/alias.bc glFramebufferTextureLayerEXT is defined in both GL_NV_geometry_program4 and GL_EXT_texture_array at ./gengl/gengl.perl line 436, H line 10154. To solve it I did something quite ugly : I commented the mentioned line 436 of gengl/gengl.perl. After that It compiles but I looking forward a better fix. The second problem I get is the more important. The bugle filterset associated with screen capture is not recognised. I get the following warning : warning: ignoring unknown filter-set screenshot BTW, Im using the following command : BUGLE_CHAIN=video LD_PRELOAD=libbugle.so my_application with the following chain: # Captures a video file. chain video { # Press C-V to start and to stop recording. By removing the inactive # tag, recording will start immediately. filterset screenshot C-V inactive { video yes filename bugle.avi # You can in theory use any codec supported by ffmpeg codec mpeg4 # Roughly DVD size, although no high quality options are set bitrate 750 # By default, a frame is captured every 30th of a second, with # frames skipped or duplicated as necessary. Uncomment this # line to instead capture every frame exactly once to the # output. # allframes yes # Control the encoding latency. A higher latency may give # better throughput, at the expense of more memory. # lag 1 } } Just so you know, here is the recap of the configure script call (it may help): Configuration: libavcodec: yes readline: yes GUI: yes (with OpenGL) X event interception: yes Thanks very much. On Wed, Jan 7, 2009 at 11:38 PM, Simon Loic simon1l...@gmail.com wrote: I tried it but I encountered few problems. I will send you the detailed tomorrow. Still thanks for the tip. On Tue, Jan 6, 2009 at 5:40 PM, Jeremy Moles jer...@emperorlinux.com wrote: Not trying to hijack this thread--and I can't really read it all for now
Re: [osg-users] High resolution screencast
Hi, I'm back at work and I can give you the details. The first problem I had was at compile time. I think it was linked with conflicting definitions. Here is the error message. /bin/mkdir -p bc/gl perl ./gengl/gengl.perl --mode=alias /usr/include/GL/gl.h /usr/include/GL/glx.h /usr/include/GL/glext.h /usr/include/GL/glxext.h bc/gl/alias.bc glFramebufferTextureLayerEXT is defined in both GL_NV_geometry_program4 and GL_EXT_texture_array at ./gengl/gengl.perl line 436, H line 10154. To solve it I did something quite ugly : I commented the mentioned line 436 of gengl/gengl.perl. After that It compiles but I looking forward a better fix. The second problem I get is the more important. The bugle filterset associated with screen capture is not recognised. I get the following warning : warning: ignoring unknown filter-set screenshot BTW, Im using the following command : BUGLE_CHAIN=video LD_PRELOAD=libbugle.so my_application with the following chain: # Captures a video file. chain video { # Press C-V to start and to stop recording. By removing the inactive # tag, recording will start immediately. filterset screenshot C-V inactive { video yes filename bugle.avi # You can in theory use any codec supported by ffmpeg codec mpeg4 # Roughly DVD size, although no high quality options are set bitrate 750 # By default, a frame is captured every 30th of a second, with # frames skipped or duplicated as necessary. Uncomment this # line to instead capture every frame exactly once to the # output. # allframes yes # Control the encoding latency. A higher latency may give # better throughput, at the expense of more memory. # lag 1 } } Just so you know, here is the recap of the configure script call (it may help): Configuration: libavcodec: yes readline: yes GUI: yes (with OpenGL) X event interception: yes Thanks very much. On Wed, Jan 7, 2009 at 11:38 PM, Simon Loic simon1l...@gmail.com wrote: I tried it but I encountered few problems. I will send you the detailed tomorrow. Still thanks for the tip. On Tue, Jan 6, 2009 at 5:40 PM, Jeremy Moles jer...@emperorlinux.comwrote: Not trying to hijack this thread--and I can't really read it all for now because I'm still fighting off lots of complications from a recent oral surgery--but what you want is called bugle. I used it to make all of the old osgWidget and osgPango videos and it works like a charm. What it does is LD_PRELOAD's glSwap() or whatever and replaces it with a version that shimmies off data to ffmpeg for encoding. Simple, clean, and easy for basic usage. On Thu, 2008-12-18 at 20:38 +0100, Simon Loic wrote: Hi, I apology in advance if this thread have been heavily answered before (if so just tell where I can find the solution). Still I would like to know the different alternative (the good ones) to record a video of my scene. So far I was using an external tool for screenCast (called istanbul). But I'm not satisfied by this because when my scene is very complex, my osg based application is lagging and this leads to a poor quality of th video. I'm especially interested if there is a way to create an RecordCameraPathHandler to record a path, and then instead of saving it as a .path file compute the video in a batch mode. By batch mode I mean that the creation of the video doesn't need to be real time. In that way I could hopefully control the lag effects and eventually the resolution of the video. Sincerely, -- Loïc Simon ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Loïc Simon -- Loïc Simon ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] High resolution screencast
I tried it but I encountered few problems. I will send you the detailed tomorrow. Still thanks for the tip. On Tue, Jan 6, 2009 at 5:40 PM, Jeremy Moles jer...@emperorlinux.comwrote: Not trying to hijack this thread--and I can't really read it all for now because I'm still fighting off lots of complications from a recent oral surgery--but what you want is called bugle. I used it to make all of the old osgWidget and osgPango videos and it works like a charm. What it does is LD_PRELOAD's glSwap() or whatever and replaces it with a version that shimmies off data to ffmpeg for encoding. Simple, clean, and easy for basic usage. On Thu, 2008-12-18 at 20:38 +0100, Simon Loic wrote: Hi, I apology in advance if this thread have been heavily answered before (if so just tell where I can find the solution). Still I would like to know the different alternative (the good ones) to record a video of my scene. So far I was using an external tool for screenCast (called istanbul). But I'm not satisfied by this because when my scene is very complex, my osg based application is lagging and this leads to a poor quality of th video. I'm especially interested if there is a way to create an RecordCameraPathHandler to record a path, and then instead of saving it as a .path file compute the video in a batch mode. By batch mode I mean that the creation of the video doesn't need to be real time. In that way I could hopefully control the lag effects and eventually the resolution of the video. Sincerely, -- Loïc Simon ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Loïc Simon ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] High resolution screencast
Not trying to hijack this thread--and I can't really read it all for now because I'm still fighting off lots of complications from a recent oral surgery--but what you want is called bugle. I used it to make all of the old osgWidget and osgPango videos and it works like a charm. What it does is LD_PRELOAD's glSwap() or whatever and replaces it with a version that shimmies off data to ffmpeg for encoding. Simple, clean, and easy for basic usage. On Thu, 2008-12-18 at 20:38 +0100, Simon Loic wrote: Hi, I apology in advance if this thread have been heavily answered before (if so just tell where I can find the solution). Still I would like to know the different alternative (the good ones) to record a video of my scene. So far I was using an external tool for screenCast (called istanbul). But I'm not satisfied by this because when my scene is very complex, my osg based application is lagging and this leads to a poor quality of th video. I'm especially interested if there is a way to create an RecordCameraPathHandler to record a path, and then instead of saving it as a .path file compute the video in a batch mode. By batch mode I mean that the creation of the video doesn't need to be real time. In that way I could hopefully control the lag effects and eventually the resolution of the video. Sincerely, -- Loïc Simon ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] High resolution screencast
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Simon Loic wrote: Hi, Hello, I have discovered this: http://nullkey.ath.cx/projects/glc/wiki It has supposedly decent quality capture for OpenGL apps. I didn't try it myself yet, but you may want to give it a shot. Regards, Jan -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org iD8DBQFJY5I4n11XseNj94gRAls0AJ0TCdkDdP9gwA+ORmLeIdFuVROdfgCghKPP +5MQLY0an0ucwnORddfD10c= =FdzU -END PGP SIGNATURE- ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] High resolution screencast
Thanks to all of you. I'll give a try to the screencapture example. On Sun, Dec 21, 2008 at 12:27 PM, Robert Osfield robert.osfi...@gmail.comwrote: Hi Guys, I haven't really followed this thread as it had plenty of discussion already. In my speed reading I have seen mention of the osgscreencapture example that has an option for opening a pbuffer for taking a snapshot. This particular example is setup to demonstrate streaming imagery from the graphics card, rather than taking just a single frame, but the ideas are similar. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Loïc Simon ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] High resolution screencast
Hi Guys, I haven't really followed this thread as it had plenty of discussion already. In my speed reading I have seen mention of the osgscreencapture example that has an option for opening a pbuffer for taking a snapshot. This particular example is setup to demonstrate streaming imagery from the graphics card, rather than taking just a single frame, but the ideas are similar. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] High resolution screencast
Hi Simon, My loop was something totally independant from the camera movement. You can imagine what you want with it. And about capturing a different size, I guess no, you'll probably have to resize your image with your encogind API. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ Le Fri, 19 Dec 2008 17:57:15 +0100, Simon Loic simon1l...@gmail.com a écrit: Thanks Jean-Sebastien, Your reply is very helpful. I don't have the time to day to implement it but I will try during the next week. Of course I'm interested by your new ScreenCaptureHandler class. BTW do you think that with this approach it's possible to have a capture resolution different from the one of the screen? I will give a look to ffmpeg too. On Fri, Dec 19, 2008 at 4:40 PM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Hello Simon, Second, I tried some times ago to do an offscreen rendering but If you know an easy way in osg to do it I'm interested (I think there are ways based on osg::Camera::DrawCallBack). There is now (since OSG 2.6) an osgViewer::ScreenCaptureHandler which you can use. Unfortunately it only responds to key presses right now, but you can subclass it like this to get it to capture programmatically: class OurScreenCaptureHandler : public osgViewer::ScreenCaptureHandler { public: OurScreenCaptureHandler(CaptureOperation* defaultOperation = 0) : osgViewer::ScreenCaptureHandler(defaultOperation) { } /** Capture the given viewer's views on the next frame. */ virtual void captureNextFrame(osgViewer::ViewerBase viewer) { addCallbackToViewer(viewer); } }; Then in your frame loop, you can just call screenCaptureHandler-captureNextFrame(viewer); (note: I'll be sending a new version of ScreenCaptureHandler which includes this method soon, I had to do it for our framework recently, so it will probably be included in OSG after that, no need to subclass) Eventually, do you know some good (easy to handle) API for compressing video? Once you have images of each frame, you can just use ffmpeg to compress the sequence into a video. See the ffmpeg man page or web page for more information. Hope this helps, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] High resolution screencast
Hi Simon, Sukender, And about capturing a different size, I guess no, you'll probably have to resize your image with your encogind API. Yes, Sukender is right, the ScreenCaptureHandler was designed for a screenshot functionality, so just takes the current resolution of any graphics context(s) that you have in the viewer. J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] High resolution screencast
Hi, thanks guys for your help, Ümit: I'm indeed using Ubuntu... I don't see how using an external camera can help. In fact the lags are not due to istanbul but to the complexity of the scene : even without screencasting my graphic card is not able to render at a sufficient frame rate. Sukender: Your proposal seems to fit what I wanna do. Though I need some more help about some points. First, a point you didn't referred to in your pseudo code : How will I move around the scene? Are you thinking of traversing along an osg::AnimationPath like I proposed? If so, do you have any Idea of how to do this? Second, I tried some times ago to do an offscreen rendering but If you know an easy way in osg to do it I'm interested (I think there are ways based on osg::Camera::DrawCallBack). Eventually, do you know some good (easy to handle) API for compressing video? Thanks a lot for your support. On Thu, Dec 18, 2008 at 11:00 PM, Sukender suky0...@free.fr wrote: Hi Simon, I got a solution for you, which is not an out-of-the-box one and requires a little coding, but I already did a similar thing to capture the output of an OpenGL/SDL app and it worked properly: You may tweak the main loop and control yourself the simulation time of the scene graph. That way, you could render and capture a constant frame-rate video (25fps for example). The video rendering is then not realtime: if your PC is fast, the redering will last less than the video, but the video itslef would always have a constant frame rate. Here is my solution in pseudo-code: while( !viewer.done() ) { videoTime += 1/25.f; // Advance 1/25th of second viewer.frame(videoTime); // ... and tell the scene graph Capture the rendered image If you have an API for compressing video, send the captured image to it. Else save it to disk for manual encoding. } Hope it helps. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ Le Thu, 18 Dec 2008 20:38:12 +0100, Simon Loic simon1l...@gmail.com a écrit: Hi, I apology in advance if this thread have been heavily answered before (if so just tell where I can find the solution). Still I would like to know the different alternative (the good ones) to record a video of my scene. So far I was using an external tool for screenCast (called istanbul). But I'm not satisfied by this because when my scene is very complex, my osg based application is lagging and this leads to a poor quality of th video. I'm especially interested if there is a way to create an RecordCameraPathHandler to record a path, and then instead of saving it as a .path file compute the video in a batch mode. By batch mode I mean that the creation of the video doesn't need to be real time. In that way I could hopefully control the lag effects and eventually the resolution of the video. Sincerely, ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Loïc Simon ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] High resolution screencast
Hello Simon, Second, I tried some times ago to do an offscreen rendering but If you know an easy way in osg to do it I'm interested (I think there are ways based on osg::Camera::DrawCallBack). There is now (since OSG 2.6) an osgViewer::ScreenCaptureHandler which you can use. Unfortunately it only responds to key presses right now, but you can subclass it like this to get it to capture programmatically: class OurScreenCaptureHandler : public osgViewer::ScreenCaptureHandler { public: OurScreenCaptureHandler(CaptureOperation* defaultOperation = 0) : osgViewer::ScreenCaptureHandler(defaultOperation) { } /** Capture the given viewer's views on the next frame. */ virtual void captureNextFrame(osgViewer::ViewerBase viewer) { addCallbackToViewer(viewer); } }; Then in your frame loop, you can just call screenCaptureHandler-captureNextFrame(viewer); (note: I'll be sending a new version of ScreenCaptureHandler which includes this method soon, I had to do it for our framework recently, so it will probably be included in OSG after that, no need to subclass) Eventually, do you know some good (easy to handle) API for compressing video? Once you have images of each frame, you can just use ffmpeg to compress the sequence into a video. See the ffmpeg man page or web page for more information. Hope this helps, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] High resolution screencast
Hi, I apology in advance if this thread have been heavily answered before (if so just tell where I can find the solution). Still I would like to know the different alternative (the good ones) to record a video of my scene. So far I was using an external tool for screenCast (called istanbul). But I'm not satisfied by this because when my scene is very complex, my osg based application is lagging and this leads to a poor quality of th video. I'm especially interested if there is a way to create an RecordCameraPathHandler to record a path, and then instead of saving it as a .path file compute the video in a batch mode. By batch mode I mean that the creation of the video doesn't need to be real time. In that way I could hopefully control the lag effects and eventually the resolution of the video. Sincerely, -- Loïc Simon ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] High resolution screencast
Hi Simon, I think your system is UBUNTU. Because I tried İstanbul deb package before :) I don't think batch video creation would be easy and effectively. Because created path by RecordCameraPathHandler is only the movement of objects on the screen. So after you run program by using path record, rendering will be the same amount of overloading on graphics card. So you can use external video camera to capture application vid. I have tried video camera way and it's most effective :) Regards. 2008/12/18 Simon Loic simon1l...@gmail.com Hi, I apology in advance if this thread have been heavily answered before (if so just tell where I can find the solution). Still I would like to know the different alternative (the good ones) to record a video of my scene. So far I was using an external tool for screenCast (called istanbul). But I'm not satisfied by this because when my scene is very complex, my osg based application is lagging and this leads to a poor quality of th video. I'm especially interested if there is a way to create an RecordCameraPathHandler to record a path, and then instead of saving it as a .path file compute the video in a batch mode. By batch mode I mean that the creation of the video doesn't need to be real time. In that way I could hopefully control the lag effects and eventually the resolution of the video. Sincerely, -- Loïc Simon ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Ümit Uzun ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] High resolution screencast
Hi Simon, I got a solution for you, which is not an out-of-the-box one and requires a little coding, but I already did a similar thing to capture the output of an OpenGL/SDL app and it worked properly: You may tweak the main loop and control yourself the simulation time of the scene graph. That way, you could render and capture a constant frame-rate video (25fps for example). The video rendering is then not realtime: if your PC is fast, the redering will last less than the video, but the video itslef would always have a constant frame rate. Here is my solution in pseudo-code: while( !viewer.done() ) { videoTime += 1/25.f; // Advance 1/25th of second viewer.frame(videoTime); // ... and tell the scene graph Capture the rendered image If you have an API for compressing video, send the captured image to it. Else save it to disk for manual encoding. } Hope it helps. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ Le Thu, 18 Dec 2008 20:38:12 +0100, Simon Loic simon1l...@gmail.com a écrit: Hi, I apology in advance if this thread have been heavily answered before (if so just tell where I can find the solution). Still I would like to know the different alternative (the good ones) to record a video of my scene. So far I was using an external tool for screenCast (called istanbul). But I'm not satisfied by this because when my scene is very complex, my osg based application is lagging and this leads to a poor quality of th video. I'm especially interested if there is a way to create an RecordCameraPathHandler to record a path, and then instead of saving it as a .path file compute the video in a batch mode. By batch mode I mean that the creation of the video doesn't need to be real time. In that way I could hopefully control the lag effects and eventually the resolution of the video. Sincerely, ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org