Speed up video play

And another quality question :wink:

As we are rendering everything as fast as possible in our application, and I already figured out how to speed up the animations (look in my other questions), I now switched to movies playing on a plane (or rather on the material).

And while the movie does play, it does so in original speed. Which is what I do not want. I want each frame of the movie played in exactly one frame in the application. Kind of fast forward as fast as the application framerate lets me.
I could probably simulate that via script, but a Movie texture only has Play(), Stop(), etc. and does not seem to have any JumpToFrameX() function.

Any idea how I could do that, speeding up a movie clip on a plane?
Or, as a possible alternative, go to time/frame X of a movie?

In our current engine, we do that by decoding a movie via ffmpeg into single pictures and then pass those to a shader. Needless to say, this works, but is pretty complicated and heavy on the performance. I COULD implement this for Unity, too I guess, but a better way without any plugins would be… well… better. :slight_smile:

Hey! Although 1 year later but I’ve worked out how to change the speed of video playback.
Thanks to vogles’s nice hack in this post( http://forum.unity3d.com/threads/33181-Movie-seeking )

And the answer is simply change the PITCH of the video’s SOUND CLIP when play them all, you need an extra “audio source” to handle the sound clip, and AudioSource.Play() and MovieTexture.Play().

public MovieTexture myMovieTex;
public AudioSource myAudioSource;

void Start()
{
	myAudioSource.clip = myMovieTex.audioClip;
	myAudioSource.pitch = 2.0f; //The scale factor you want
	myMovieTex.Play();
	myAudioSource.Play();
}

This works fine.
Unity seems to sync the video according to its audio clip, you’re not able to set the MovieTexture.audioClip.time. If your video clip has no sound, just use any other video app to add a blank sound on it.

On the Wiki is a plugin and associated scripts for doing advanced movie playback, and among the features is the ability to set the framerate. You could probably easily modify the script to set the framerate on a per-frame basis to some multiple of Time.deltaTime.