Re: [osg-users] Plugins errors for unsupported files
Hi Robert, maybe I wasn't clear in my previous message. I'm not suggesting to remove the code, only to move it down few lines, and possibly inside an if block which checks if the video is loaded from internet (filename containing an URL path). That should cover the use case of streaming the video from a server and improve a more general file type handling. On Wed, Oct 19, 2016 at 12:29 PM, Robert Osfieldwrote: > Hi Riccardo, > > Just removing a code block might fix the problem you are seeing but > it'll break things for others so isn't an appropriate thing to do as > we'll just end up flip flopping between who's code we break today. > > I haven't looked into the error itself yet, but my inclination would > be to see if is possible to improve the OSG's ffmpeg plugins' file > opening so that it handles the inability to read a file more > elegantly. > > Robert. > > On 19 October 2016 at 10:31, Riccardo Corsi > wrote: > > Hi Robert, > > > > right, the ffmpeg plugin is trying to load files without knowing if they > are > > of a supported format. > > The related code is here: > > https://github.com/openscenegraph/OpenSceneGraph/ > blob/master/src/osgPlugins/ffmpeg/ReaderWriterFFmpeg.cpp#L149 > > > > The comment explains something related to videos served from internet. > > I'm wondering if it would be ok to move that code below, after having > > checked whether the filename contains a URL (performed a few lines > below). > > This would stop the plugin to try loading every possible image and > printing > > errors on the console. > > > > Thanks, > > Ricky > > > > > > On Tue, Oct 18, 2016 at 7:54 PM, Robert Osfield < > robert.osfi...@gmail.com> > > wrote: > >> > >> Hi Ricky, > >> > >> The OSG uses the Chain Of Responsibility Design Pattern for the > >> plugins - so it's the plugins themselves to decide what formats they > >> can load. This enables them to handle multiple formats if they can > >> support it. From the description it sounds like the ffmpeg isn't > >> doing a good enough at deciding what it can or cannot load. > >> > >> Robert. > >> > >> On 18 October 2016 at 18:18, Riccardo Corsi > > >> wrote: > >> > Hi Robert and all, > >> > > >> > I'm currently using the ffmpeg plugin to load some movies - it works > >> > just > >> > fine but my application started generating a lot of errors on console > >> > like > >> > this: > >> >> FFmpegImageStream::open : av_open_input_file() failed : AVERROR_NOENT > >> > every time an image has to be loaded. > >> > > >> > You can reproduce the issue with the modified osgMovie example in > >> > attach, > >> > which also loads the textured cow model. > >> > > >> > Digging a bit I've seen that's because the file reading mechanism > tries > >> > to > >> > read from all the already loaded plugins, reagardless of their > >> > extension(s) > >> > support. > >> > See here: > >> > > >> > https://github.com/openscenegraph/OpenSceneGraph/ > blob/master/src/osgDB/Registry.cpp#L1176 > >> > > >> > I thought that the extension supported by each plugin was checked > before > >> > trying to use it. > >> > Besides the annoying errors on the console, wouldn't it be more > >> > efficient? > >> > > >> > Thanks, > >> > Ricky > >> > > >> > ___ > >> > 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 > > > ___ > 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] Plugins errors for unsupported files
Hi Riccardo, Just removing a code block might fix the problem you are seeing but it'll break things for others so isn't an appropriate thing to do as we'll just end up flip flopping between who's code we break today. I haven't looked into the error itself yet, but my inclination would be to see if is possible to improve the OSG's ffmpeg plugins' file opening so that it handles the inability to read a file more elegantly. Robert. On 19 October 2016 at 10:31, Riccardo Corsiwrote: > Hi Robert, > > right, the ffmpeg plugin is trying to load files without knowing if they are > of a supported format. > The related code is here: > https://github.com/openscenegraph/OpenSceneGraph/blob/master/src/osgPlugins/ffmpeg/ReaderWriterFFmpeg.cpp#L149 > > The comment explains something related to videos served from internet. > I'm wondering if it would be ok to move that code below, after having > checked whether the filename contains a URL (performed a few lines below). > This would stop the plugin to try loading every possible image and printing > errors on the console. > > Thanks, > Ricky > > > On Tue, Oct 18, 2016 at 7:54 PM, Robert Osfield > wrote: >> >> Hi Ricky, >> >> The OSG uses the Chain Of Responsibility Design Pattern for the >> plugins - so it's the plugins themselves to decide what formats they >> can load. This enables them to handle multiple formats if they can >> support it. From the description it sounds like the ffmpeg isn't >> doing a good enough at deciding what it can or cannot load. >> >> Robert. >> >> On 18 October 2016 at 18:18, Riccardo Corsi >> wrote: >> > Hi Robert and all, >> > >> > I'm currently using the ffmpeg plugin to load some movies - it works >> > just >> > fine but my application started generating a lot of errors on console >> > like >> > this: >> >> FFmpegImageStream::open : av_open_input_file() failed : AVERROR_NOENT >> > every time an image has to be loaded. >> > >> > You can reproduce the issue with the modified osgMovie example in >> > attach, >> > which also loads the textured cow model. >> > >> > Digging a bit I've seen that's because the file reading mechanism tries >> > to >> > read from all the already loaded plugins, reagardless of their >> > extension(s) >> > support. >> > See here: >> > >> > https://github.com/openscenegraph/OpenSceneGraph/blob/master/src/osgDB/Registry.cpp#L1176 >> > >> > I thought that the extension supported by each plugin was checked before >> > trying to use it. >> > Besides the annoying errors on the console, wouldn't it be more >> > efficient? >> > >> > Thanks, >> > Ricky >> > >> > ___ >> > 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 > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Plugins errors for unsupported files
Hi Robert, right, the ffmpeg plugin is trying to load files without knowing if they are of a supported format. The related code is here: https://github.com/openscenegraph/OpenSceneGraph/blob/master/src/osgPlugins/ffmpeg/ReaderWriterFFmpeg.cpp#L149 The comment explains something related to videos served from internet. I'm wondering if it would be ok to move that code below, after having checked whether the filename contains a URL (performed a few lines below). This would stop the plugin to try loading every possible image and printing errors on the console. Thanks, Ricky On Tue, Oct 18, 2016 at 7:54 PM, Robert Osfieldwrote: > Hi Ricky, > > The OSG uses the Chain Of Responsibility Design Pattern for the > plugins - so it's the plugins themselves to decide what formats they > can load. This enables them to handle multiple formats if they can > support it. From the description it sounds like the ffmpeg isn't > doing a good enough at deciding what it can or cannot load. > > Robert. > > On 18 October 2016 at 18:18, Riccardo Corsi > wrote: > > Hi Robert and all, > > > > I'm currently using the ffmpeg plugin to load some movies - it works just > > fine but my application started generating a lot of errors on console > like > > this: > >> FFmpegImageStream::open : av_open_input_file() failed : AVERROR_NOENT > > every time an image has to be loaded. > > > > You can reproduce the issue with the modified osgMovie example in attach, > > which also loads the textured cow model. > > > > Digging a bit I've seen that's because the file reading mechanism tries > to > > read from all the already loaded plugins, reagardless of their > extension(s) > > support. > > See here: > > https://github.com/openscenegraph/OpenSceneGraph/blob/master/src/osgDB/ > Registry.cpp#L1176 > > > > I thought that the extension supported by each plugin was checked before > > trying to use it. > > Besides the annoying errors on the console, wouldn't it be more > efficient? > > > > Thanks, > > Ricky > > > > ___ > > 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] Plugins errors for unsupported files
Hi Ricky, The OSG uses the Chain Of Responsibility Design Pattern for the plugins - so it's the plugins themselves to decide what formats they can load. This enables them to handle multiple formats if they can support it. From the description it sounds like the ffmpeg isn't doing a good enough at deciding what it can or cannot load. Robert. On 18 October 2016 at 18:18, Riccardo Corsiwrote: > Hi Robert and all, > > I'm currently using the ffmpeg plugin to load some movies - it works just > fine but my application started generating a lot of errors on console like > this: >> FFmpegImageStream::open : av_open_input_file() failed : AVERROR_NOENT > every time an image has to be loaded. > > You can reproduce the issue with the modified osgMovie example in attach, > which also loads the textured cow model. > > Digging a bit I've seen that's because the file reading mechanism tries to > read from all the already loaded plugins, reagardless of their extension(s) > support. > See here: > https://github.com/openscenegraph/OpenSceneGraph/blob/master/src/osgDB/Registry.cpp#L1176 > > I thought that the extension supported by each plugin was checked before > trying to use it. > Besides the annoying errors on the console, wouldn't it be more efficient? > > Thanks, > Ricky > > ___ > 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