- Home /
MovieTexture cutscene - performance issues (stuttering) in Unity5
I'm using uGUI Raw Image component to play 720p .ogv (Theora) video, 31 seconds long, 45MB of size, using Unity 5.1.3. My setup is like this:
The CutscenePlayer assigns the MovieTexture demo_intro_cutscene_720p to RawImage.texture
and calls Play()
.
This indeed works, but I experience very noticeable stutter of the cutscene - in the Editor and in the build too - and I can't seem to find any way to mitigate this. I've tried setting the Quality of the video (in the import settings of the video asset) to 0, but it doesn't help with the stutter at all and honestly, I can't even see any quality difference on this setting.
Is there anything I can do to increase the performance? My computer runs other 720p videos with no problems.
Things I've tried so far (to no avail):
lowering the Quality of the video in import settings of the video asset
using Plane object to play the video on, instead of uGUI's RawImage
just calling Play() on MovieTexture and rendering it via
GUI.DrawTexture()
called inOnGUI()
methodcreating a clean scene containing nothing but the cutscene player to see if other objects/scripts don't cause this performance loss
turning the VSync off - not sure if this is even supposed to change anything about the cutscene performance
Many thanks!
Edit 1:
Here's the CutscenePlayer script:
using UnityEngine;
using UnityEngine.UI;
public class CutscenePlayer : MonoBehaviour
{
public bool EnableLogging = true;
public MovieTexture Cutscene;
private RawImage ThisRawImage;
void Start()
{
ThisRawImage = GetComponent<RawImage>();
ThisRawImage.enabled = true;
ThisRawImage.texture = Cutscene;
Cutscene.Play();
}
}
Also, while checking FPS with this script I've noticed the FPS is around 30-60, 30 in the time positions where it stutters most.
Can we see the script CutscenePlayer.cs ? you may want to add a script to check the fps in your scene (wiki), to know if the scene is lagging or if it is a problem with the video. Have you tried other ogv videos and/or other formats?
I added the CutscenePlayer script to the question (it is now awaiting moderation again as I understand it). Also, trying the FPS script you suggested, I see the FPS is around 30 in time positions where the cutscene stutters the most, otherwise it's 50-60. As for other formats - frankly, as I'm not very knowledgeable in this area, I had problems importing any other formats into Unity, but if you have any specific formats in $$anonymous$$d, I'd gladly take a look if I can manage to export it from AfterEffects and import to Unity in that way.
Having similar issues. It feels like $$anonymous$$ovieTexture is meant to display movies within a game object, like billboards in a 3D scene, and suffers from needless performance issues when playing full screen. It probably goes through shading and all.