We made changes back in 2015 to fix threading issues with the osg ffmpeg plugin. I don't think these changes ever made it into OSG. <br><br>Source repo: https://bitbucket.org/digitalis/osg-ffmpeg-plugin/<br><br><div class="gmail_quote"><div dir="auto" class="gmail_attr">On Monday, August 10, 2020 at 3:46:32 AM UTC-7 bjs.me...@gmail.com wrote:<br/></div><blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr">Hi Robert,<br><br>Thanks for your response.<br><br>If FFmpegImageStream::publishNewFrame is invoked from a separate thread.<br>Is it then somehow guaranteed that (for example) Texture2D::apply is not using/reading from the image object, while FFmpegImageStream::publishNewFrame is modifying it ?<br><br>Cheers,<br><br>Ben<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Op vr 31 jul. 2020 om 21:24 schreef Robert Osfield <<a href data-email-masked rel="nofollow">robert....@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"></blockquote></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Ben,<div><br></div><div>I'm away from my dev computer so just commenting off the top of my. FFmpegImageStream should be double buffered so that the ffmpeg thread writing to the image will be writing to one part of the data, while the other half is available to be read by the graphics thread. This should avoid threading issues.</div><div><br></div><div>The threading used by the ffmpeg plugin is separate from the viewer threading so settings related to the viewer won't be important, nor will general settings of the scene graph.</div><div><br></div><div>You should be able to just add the ffmpeg genearted imagestream to a texture, start the steam going and then largely forget about it.</div><div><br></div><div>Robert.<br><br></div><div class="gmail_quote"><div dir="auto" class="gmail_attr">On Friday, 31 July 2020 at 20:15:45 UTC+1 <a href data-email-masked rel="nofollow">bjs.me...@gmail.com</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi,</div><div><br></div><div>I was just looking at FFmpegImageStream, I am not very familiar with this code, but I have some questions.</div><div><br></div><div>It is not immediately clear to me how FFmpegImageStream::publishNewFrame is thread safe.</div><div>It seems like the image data is set (setImage) from the video decoder thread.</div><div>The image then uses a pointer to one of the buffers of the video decoder (of which the contents might also change ?).</div><div><br></div><div>FFmpegImageStream also doesn't seem to override requiresUpdateCall, which I believe will result in the texture not being dynamic (Texture2D::setImage).</div><div>Which could be used, for example in StateSet::computeDataVariance(), to determine whether the StateSet should be dynamic (which is needed for multithreaded rendering).</div><div><br></div><div>If anyone could shed more light on this subject, it would be very much appreciated.</div><div><br></div><div>Thank you.</div><div><br></div><div>Cheers,</div><div><br></div><div>Ben</div></div></blockquote></div>
<p></p></blockquote></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
-- <br>
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an email to <a href data-email-masked rel="nofollow">osg-users+...@googlegroups.com</a>.<br>
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/osg-users/386b2bdb-9924-4d01-bc42-98565c685ac0n%40googlegroups.com?utm_medium=email&utm_source=footer" target="_blank" rel="nofollow" data-saferedirecturl="https://www.google.com/url?hl=en&q=https://groups.google.com/d/msgid/osg-users/386b2bdb-9924-4d01-bc42-98565c685ac0n%2540googlegroups.com?utm_medium%3Demail%26utm_source%3Dfooter&source=gmail&ust=1597179535094000&usg=AFQjCNHCqOlFzitUAab_2_BA9l4lHJys6g">https://groups.google.com/d/msgid/osg-users/386b2bdb-9924-4d01-bc42-98565c685ac0n%40googlegroups.com</a>.<br>
</blockquote></div>
</blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:osg-users+unsubscribe@googlegroups.com">osg-users+unsubscribe@googlegroups.com</a>.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/osg-users/89d17cce-a8a9-4c8a-a347-c5a47fc7e8c5n%40googlegroups.com?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/osg-users/89d17cce-a8a9-4c8a-a347-c5a47fc7e8c5n%40googlegroups.com</a>.<br />