-
Notifications
You must be signed in to change notification settings - Fork 29
Description
Which platform is your feature request for?
Windows
Description
Hey!
We have this specific use case where we store 3d data into video streams, and decode them in real time using AVPro.
We do something along the lines of:
void UpdateVideo()
{
if (VideoPlayer?.Control == null || !m_initialized) return;
int currentFrame = VideoPlayer.Control.GetCurrentTimeFrames(0);
if (currentFrame != m_lastVideoFrame)
{
var tex = VideoPlayer.TextureProducer?.GetTexture(0) as Texture2D;
if (tex != null)
{
Graphics.CopyTexture(m_currentTexture, m_previousTexture);
Graphics.CopyTexture(tex, m_currentTexture);
m_renderer.UpdateTextures(m_currentTexture, m_previousTexture);
}
m_lastVideoFrame = currentFrame;
}
}
We write it to a separate texture so we don't lose it as the player closes.
Problem is, it's hard to preview the scene correctly when working on it, as it is very unstable outside of play mode.
When you first open the scene no texture is present yet, so you can't decode anything.
After switching to game view, then back to scene mode, you can see the first frame being decoded. But it remains static as the video plays.
Is there any workaround to make texture decoding work more smoothly outside of play mode? Thanks a lot
Btw I'm using [ExecuteAlways] on the class, it doesn't make a difference.