Play specific frames of your movieTexture

Hallo,

Maybe this is a question with the most simple answer, but I can’t find a solution.

I got a MovieTexture with 300 frames. I want to play frame 0-200 in a loop.
I created a triggerEvent for the Windows Kinect V2 to do something if the player is between 100cm from the kinect. At that point i want to play frame 200-300 once.

How can I do this? I’m using Unity 4.6.5PRO. I also tried the AVPRO plugin for unity but with no succes.

Hi

There is no api for frame selection. So you should do it with your own script. You can convert time domain to frame domain.

Example:

video1.mp4 → 30 fps, for 10 sec total frames 300

1/30 sec per frame

float GetFrameTime(int fps,int frame) 
{
   float periot = 1.0f/fps;
   return periot*frame;
} 

Now you can check frames of your video

if (myMovieTexture.time >= GetFrameTime(30,200)) {

    myMovieTexture.time = GetFrameTime(30,0);
}