I have a few objects with MovieTextures on them. Everything works well except that when I assign a MovieTexture, the texture is black until I call the “Play” function.
Is there any way to set it up so the first frame of the MovieTexture shows up (or some other sort of preview) instead of black?
I tried playing and pausing the MovieTexture before assigning it to my object (so it starts a little ways in), but it doesn’t seem to work consistently.
Not sure if there’s an easier way, but you could possible have a texture that had the first frame on it then swap textures or materials after you start playing the movie.
what I so far did and what normally worked fine is:
Play movie, start coroutine
make coroutine check each frame if movie is playing
if movie is playing, pause it and actually assign the movie texture to your “movie plane”
play movie again.
What you can’t do is get the first frame though, reason is that until the first chunk is decoded there is no image data at all, so you would have to provide it as an image like niosop recommends and then replace that texture with the movie texture in step 3 above
I had this very same issue, and in Windows: The video start with a few seconds of blackness (using WWW object, with an url pointing somewhere in the File System).
I finally found al walkaround that worked for me. It looked like the AudioSource was trying to read the nonexistent audio of my videos, and it was making the playback of the video fail for a few seconds when starting it. I had this code:
If your OGV has no audio with it, do not attempt to reproduce it! It has nothing to do with the -1 duration value of the OGV or anything with the codecs. Just the audio…