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