- Home /
Problem is not reproducible or outdated
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.
Help is always welcome! You'll get a cookie if you got the solution!
Answer by Lordinarius · Jun 03, 2015 at 08:37 AM
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);
}
Follow this Question
Related Questions
Render MovieTexture frame by distance. 0 Answers
Changing Part Of Texture/Material 1 Answer
[SOLVED]my original texture change to movie texture 0 Answers
Texture BoxCollider2D in scene view only 1 Answer
Using Video in a 4.6 UI 0 Answers