Re: [osg-users] FFmpeg and sound
Robert Osfield wrote: I have been thinking about the potential of an osgAudio library that abstracts away from the implementation details of OpenAL and keeps the door open to multiple implementations, and then within this have some form of registration of the audio implementation, then the audio implementations would plugin in to this, or like osgViewer just be built into the osgAudio library. osgViewer and it's handling of GraphicsWindow implementation might be a reasonable model for this. An straight audio sink is rather more straight forward than this though... so perhaps one could just have a slimline AudioSystemInterface/Factory class a bit like osg::GraphicsContext::WindowingSystemInterface singleton and then have this be where you register your scheme for implementing the AudioSink. Then in the plugins that need an audio sink it can go to this singleton and grab and implementation. The plugin might also use osgDB to load a plugin to force the registration of a implementation of a AudioSystemInterface. Such an approach would be easier to graft on than writing a full blown osgAudio library. Thanks, that helps a lot. I'll keep that in mind if I find myself with more free time anytime soon :-) --"J" ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FFmpeg and sound
Hi Jason, On Tue, Jan 19, 2010 at 8:43 PM, Jason Daly wrote: > If I were to implement an OpenAL AudioSink, I'd imagine you'd want it to be > a plugin (so the OSG can still be compiled without OpenAL). How would you > envision this plugin being tied in to the core? I started on an OpenAL > plugin last week, but I hit a wall when trying to figure out how to do this. > > The ReaderWriter interface works great for file-based plugins, but the > AudioSink seems like it's different enough that a new kind of interface is > needed. Do you agree? If so, would this interface also live in osgDB? > Would it be part of Registry, like ReaderWriter, DotOsgWrapper, etc.? > > Any other thoughts? I have been thinking about the potential of an osgAudio library that abstracts away from the implementation details of OpenAL and keeps the door open to multiple implementations, and then within this have some form of registration of the audio implementation, then the audio implementations would plugin in to this, or like osgViewer just be built into the osgAudio library. osgViewer and it's handling of GraphicsWindow implementation might be a reasonable model for this. An straight audio sink is rather more straight forward than this though... so perhaps one could just have a slimline AudioSystemInterface/Factory class a bit like osg::GraphicsContext::WindowingSystemInterface singleton and then have this be where you register your scheme for implementing the AudioSink. Then in the plugins that need an audio sink it can go to this singleton and grab and implementation. The plugin might also use osgDB to load a plugin to force the registration of a implementation of a AudioSystemInterface. Such an approach would be easier to graft on than writing a full blown osgAudio library. Robert. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FFmpeg and sound
Robert Osfield wrote: OpenAL and other dedicated audio libs would certainly be a better bet for handling multiple videos. We just need to code up such a solution. Hi, Robert, If I were to implement an OpenAL AudioSink, I'd imagine you'd want it to be a plugin (so the OSG can still be compiled without OpenAL). How would you envision this plugin being tied in to the core?I started on an OpenAL plugin last week, but I hit a wall when trying to figure out how to do this. The ReaderWriter interface works great for file-based plugins, but the AudioSink seems like it's different enough that a new kind of interface is needed. Do you agree? If so, would this interface also live in osgDB? Would it be part of Registry, like ReaderWriter, DotOsgWrapper, etc.? Any other thoughts? --"J" ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FFmpeg and sound
Hi Serge, Robert is right, SDL only provides a very low-level sound API. If you have several sounds, you need to write your own software mixer. SDL advantage is that it's very easy to use. Because it's so low level, it does not have obscure side effects, which is what you want when you develop a movie plugin. But I wouldn't recommend to use it with the FFmpeg plugin for more than just testing. Libraries like OpenAL and FMOD are better suited. In fact we are using the FFmpeg plugin with FMOD in a commercial product, and playing several movies in parallel just fine. If you're interested by the FMOD audio sink, I'm sure I could provide you with a part of our implementation. T -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: 13 January 2010 6:38 PM To: OpenSceneGraph Users Subject: Re: [osg-users] FFmpeg and sound HI Serge, I believe the SDL interface only allows for one audio channel so implementating multiple videos would be problematic, or at least that was be reading of the API in my brief encounter with trying to get this working quickly. OpenAL and other dedicated audio libs would certainly be a better bet for handling multiple videos. We just need to code up such a solution. Robert. On Wed, Jan 13, 2010 at 6:25 PM, Serge Lages wrote: > Hi all, > > I've made some tests with the FFmpeg plugin and sound using the code from > osgmovie (with the SDLAudioSink), it works but with limitations : > > - When there are multiple videos it produces random behaviors, sometimes > only one sound from one video works, other times no sound is played. > - When deleting my video objects, I've got a crash, I didn't had time to > investigate where precisely it comes from yet. > > I'm under Windows 7 and VS9 Express, is anyone experiencing this kind of > problem, or is having success playing multiple videos with sound ? > > I would also like to know if anyone knows how to control the sound volume > with the SDL ? We should also modify the AudioSink class to allow it, > currently there is a setVolume method on the ImageStream class but not on > the AudioStream one. > > Thanks ! > > -- > Serge Lages > http://www.tharsis-software.com > > ___ > 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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FFmpeg and sound
HI Serge, I believe the SDL interface only allows for one audio channel so implementating multiple videos would be problematic, or at least that was be reading of the API in my brief encounter with trying to get this working quickly. OpenAL and other dedicated audio libs would certainly be a better bet for handling multiple videos. We just need to code up such a solution. Robert. On Wed, Jan 13, 2010 at 6:25 PM, Serge Lages wrote: > Hi all, > > I've made some tests with the FFmpeg plugin and sound using the code from > osgmovie (with the SDLAudioSink), it works but with limitations : > > - When there are multiple videos it produces random behaviors, sometimes > only one sound from one video works, other times no sound is played. > - When deleting my video objects, I've got a crash, I didn't had time to > investigate where precisely it comes from yet. > > I'm under Windows 7 and VS9 Express, is anyone experiencing this kind of > problem, or is having success playing multiple videos with sound ? > > I would also like to know if anyone knows how to control the sound volume > with the SDL ? We should also modify the AudioSink class to allow it, > currently there is a setVolume method on the ImageStream class but not on > the AudioStream one. > > Thanks ! > > -- > Serge Lages > http://www.tharsis-software.com > > ___ > 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